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

irmowan/MiniJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A compiler of language MiniJava

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published