Project for 2016 Fall's Compilers course @ Fudan University.
The task is to build a compiler frontend for MiniJava.
Implemented with ANTLR v4.5.3.
Report and git log are under doc/
.
Linghao Zhang (13307130225@fudan.edu.cn)
make grammar
: Generate ANTLR lexer & parser & listener & visitor codes fromMiniJava.g4
.make build
: Compile all the Java codes.make test
: Output the AST forBinaryTree.java
in LISP-style string.make rig
: Display the AST forBinaryTree.java
in tree diagram.make tests
: Test for syntax errors.make test1
: Test for duplicated declaration.make test2
: Test for type lookup.make test3
: Test for symbol lookup and type compatibility.make testc
: Test for cyclic inheritence.