dnc1994 / MiniJavaCF

Compiler Frontend for MiniJava.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MiniJavaCF

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/.

Author

Linghao Zhang (13307130225@fudan.edu.cn)

Usage

  • make grammar: Generate ANTLR lexer & parser & listener & visitor codes from MiniJava.g4.
  • make build: Compile all the Java codes.
  • make test: Output the AST for BinaryTree.java in LISP-style string.
  • make rig: Display the AST for BinaryTree.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.

About

Compiler Frontend for MiniJava.


Languages

Language:Java 97.7%Language:ANTLR 1.6%Language:Makefile 0.5%Language:Shell 0.2%