java -jar MJPA3_groupname.jar InputFile.java
The input files can be any PA3 MeggyJava program. The PA3Picture.java example you wrote for PA2 is a possible test case for MJPA3_groupname.jar. The output file named InputFile.java.s should be an AVR assembly program that using the provided build process will run on the MeggyJr device. Additionally, the InputFile.java.s file must be such that we can run it through the AVR simulator MJSIM.jar. See the Meggy Sim instructions for usage notes. The set of instructions you will need include those already provided in the avrH.rtl.s and avrF.rtl.s files and the following:
# Examples of each statement type are provided.
# Register numbers, constant values, and labels can change.
ldi r24,lo8(1)
ldi r24,73
push r24
pop r24
call functionName
For more details about the instructions see
the 08-MeggyJrSimple-n-AVR.txt notes.
Notice that avrF.rtl.s already has an infinite loop at the end of main so that the program will always remain running on the Meggy Jr device even if there is no while loop in the MeggyJava program.
For this assignment, no error handling is necessary. In other words, you can assume the input is correct.
PA3/
Makefile
java-cup-11a.jar
java-cup-11a-runtime.jar
TestCases/
...
java_cup/
runtime/
*.class
src/
avrH.rtl.s
avrF.rtl.s
MJPA3Driver.java
MJPA3MainClass.txt
mjparser/
mj.cup
mj.lex
The Makefile will create a .jar file
provided you use the suggested directory structure. You can use any directory
structure and any build process
as long as your MJPA3_groupname.jar file works as required.
Remember that we suggest you start from example .lex and .cup files that already work. We also recommend that you start out with a small driver that builds into a jar file and does something right away. Incrementally add functionality and test along the way.
svn log
svn info
svnlook tree REPOSITORY_PATH
Note that svnlook must be issued on the machine where the repository resides.
~cs453/bin/checkin PA3 MJPA3_groupname.jar
java -jar MJPA3_groupname.jar TestCase.java
java -jar MJSIM.jar TestCase.java.s > t1
javac TestCase.java
java TestCase > t2
diff t1 t2
jar xf MJPA3_groupname.jar // to get the README and other files like subversion.txt
// Will read README and other files.