This repository contains code, sample programs and the entire documentation regarding the implementation details of our new programming language, ALPI - Another Lexer Parser Interpreter.
- OS: MacOS and Linux
- Lexer: Python3 using the NLTK package
- Parser: Prolog
- Runtime: Prolog
- Download this repository either directly from GitHub or just use
gitclone https://github.com/sudhanvaghebbale/SER502-Spring2020-Team26.git - Go to
SER502-Spring2020-Team26/src/runtime - Check the path for Python and swipl by typing:
where pythonandwhere swipl - Insert these paths in their respective files at the top of the script like:
#!/opt/anaconda3/envs/prolog/bin/pythonand#!/usr/local/bin/swipl - Get current path by typing
pwdin the terminal. - Put current path in bash script for Python and swipl
vim ALP- edit this line to
python your/path/to/here/SER502-Spring2020-Team26/src/runtime/lexer.py - Same for pl file.
- Put the current path for script.txt and tokens.txt to
lexer.pyandprogram.plrespectively. - Run
chmod +x ALPand./ALPto execute (Run these two everytime a change is made).
- Install NLTK tokenizer by
pip install nltk - Under lexer.py file uncomment the following if you're running the NLTK tokenizer for the first time.
import nltk
nltk.download('punkt')