Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Latest commit

 

History

History
37 lines (25 loc) · 1.02 KB

Readme.md

File metadata and controls

37 lines (25 loc) · 1.02 KB

MiniJava

The project is a front-end of the compiler of language MiniJava(BNF, Samples).

Usage

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