Here are some example programs: PA4noDef.java, PA4doubleDef.java, and PA4bluedot.java, its symbol table, and its PA4bluedot.java.s file.
Notice that PA4doubleDef is legal Java but illegal MeggyJava (no overloading is allowed in MeggyJava).
The above .s file is from the reference compiler and includes code for passing the pointer to object instances for each method call. Your compiler does not have to generate a pointer to object instances yet for PA4.
For lexical analysis, your compiler needs to handle lexer errors by printing out an error message for the first lexer error seen. If you print more error messages that is fine. For syntactic analysis (parser), your compiler needs to handle parsing errors by printing out an error message for the first parser error seen. If you print more error messages that is fine. For semantic analysis (type checking) your compiler needs to check for undefined, doubly defined, and incorrectly typed symbols (parameters and method names). Just catching the first type error is sufficient.
Another difficult piece will be adding line and column information to the tokens provided by lexical analysis. This line and column information will make error messages much more useful.
Break things into small testable pieces.
Groups can be of size 1 to 5 for PA4.
You can create a github repository for PA4 by going to the PA4 assignment in the github classroom for cs453.
stack build MJCPA4 stack exec MJCPA4 TestCase.java java -jar MJSIM.jar -b -f TestCase.java.s > t1 // Executing the Java-only version with the meggy/ package. javac TestCase.java java TestCase > t2 diff t1 t2
The input files can be any PA4 MeggyJava program. The InputFile.java.s file must be such that we can run it through the AVR simulator, MJSIM.jar.
If you need additional Haskell libraries, you need to post a message on Piazza indicating you would like to use the external library. We will reply with a .cabal file that will be used to grade ALL projects. This means everyone will then be able to use that same external library.
We highly recommend you use the regression script regress.sh. Read the comments in the file header to see how it works. Create multiple test cases, put them in the WorkingTestCases/ subdirectory and test your mjc compiler against the Java-only output.
You will need to submit a video of your MeggyJr with a MeggyJava program that only demonstrates the features in the PA4 grammar. The picture should be named PA4demo.something, where something is .mov or whatever video format you used for PA1.
turnin cs453PA4 README revision-control.txt *.hsOf course, we expect that all files within a group will be identical. Only one person in the group should submit the demo video.
turnin cs453PA4 PA4demo.mp4Double check that all your files are readable and can be compiled and run on lectura. Any fixes to files will cost 40 points for PA4. You can check that all your files were submitted with the following command:
turnin -ls cs453PA4