In this assignment you will be writing a program that parses, type checkes, and generates code for the PA3 subset of the MeggyJava language that includes the detection of button presses (Meggy.checkButton), the use of the delay function (Meggy.delay), the function for reading the screen pixel values (Meggy.getPixel), the while statement, the if statement, byte casts, plus, minus, and times, and boolean expressions. Notice the dangling else syntax, and the unary minus syntax.
Java, and therefore MeggyJava allows int, byte mixed type expressions for addition, subtraction, comparison, and negation. This is relevant for type checking as well as code generation.
You will
Example ASTs of some test cases are here:
Most importantly there is a regression testing directory called TestCasesMeggy/. This includes the regression testing script for your generated MJ.jar. See the README in that directory for more information.
The input files for your compiler can be any PA3 MeggyJava program. The PA3 test cases you wrote for PA1 are possible test cases for MJ.jar you will create. Plan on writing more test cases as well. Additionally, the InputFile.java.s file must be such that we can run it through the MJSIM simulator. See the Meggy Sim instructions for usage notes. You will also be able to assemble and link the program with the run time library and run it on the Meggy Jr device by using the provided build process.
For more details about the AVR instructions see the 06-AVR.txt notes.
For this assignment, type checking will be performed with a visitor. Your goal is to match the type error messages that are printed by the provided MJ.jar reference compiler made available in ~cs453/public/ or by matching javac. The grading will ensure that your type error messages occur when javac error messages occur. The error messages do not have to be an exact match.
svn log svn info
~cs453/bin/checkin PA3 PA3.tar
tar -xf PA3.tar cd PA3 // We will also run the test cases with different arg_opts files. java -jar MJ.jar TestCase.java java -jar MJSIM.jar TestCase.java.s > t1 javac TestCase.java java TestCase > t2 diff t1 t2