The project is a front-end of the compiler of language MiniJava(BNF, Samples).
Make sure that the antlr4 is installed already and added to class path. (follow the QuickStart of the Antlr page.)
cd /usr/local/lib
sudo curl -O http://www.antlr.org/download/antlr-4.5.3-complete.jar
export CLASSPATH=".:/usr/local/lib/antlr-4.5.3-complete.jar:$CLASSPATH"
Then, compile the java code and run the main class.
cd src/
javac *.java
java Test input/BinarySearch.minijava
Use java Test [file path]
to run the main class, the default file path is input/BinarySearch.minijava
.
If you just want to see the default lexer and parser, you can run:
alias antlr4='java -jar /usr/local/lib/antlr-4.5.3-complete.jar'
alias grun='java org.antlr.v4.gui.TestRig'
grun MiniJava prog -gui
Author: irmo
Date: 2016.11