jiahao42 / MeggyJava-Compiler

Compiler (parsing, code gen, type cast/checking) for MeggyJava (including variable/function/class)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MeggyJava Compiler

This is the course work for UVa CS6620, Compiler.

MeggyJava is a programming language based on MiniJava. It can be used to program Meggy Jr RGB, which is a handheld platform for developing your own pixel-scale video games.

This complier will translate MeggyJava code into AVR Assembly, which can be run on the simulator and Meggy Jr RGB device. Also, it will generate a dot file to visualize its AST and Symbol Table.

Usage

// using only lexer
java -jar MJPA2.jar example.java
// using compiler
java -jar MJ.jar example.java
// using simulator
java -jar MJSIM.jar -b -f example.java.s
// visualize AST
dot example.ast.dot -Tpng -o example.ast.png
// visualize Symbol Table
dot example.ST.dot -Tpng -o example.ST.png

For example, Test.java has the following AST and Symbol Table:

AST Symbol Table

About

Compiler (parsing, code gen, type cast/checking) for MeggyJava (including variable/function/class)


Languages

Language:Java 67.6%Language:Assembly 28.1%Language:Lex 1.7%Language:C++ 1.1%Language:Makefile 0.7%Language:Shell 0.5%Language:C 0.2%