- Python 3.7
- ANTLR 4.8
To install ANTLR4 use the following command:
$ cd /usr/local/lib
$ sudo curl -O https://www.antlr.org/download/antlr-4.8-complete.jar
$ export CLASSPATH=".:/usr/local/lib/antlr-4.8-complete.jar:$CLASSPATH"
$ alias antlr4='java -jar /usr/local/lib/antlr-4.8-complete.jar'
$ alias grun='java org.antlr.v4.gui.TestRig'
You should also install ANTLR4 python runtime in PIP:
$ pip install antlr4-python3-runtime
After installing ANTLR you can recompile the grammar by running:
$ antlr4 -Dlanguage=Python3 grammar/low.g4
To test a program's grammar run:
$ python3 main.py test1.txt