CS 6848 - Principles of Programming Languages

Homework 5: Java CPS Transformer

Use JTB/GJ and JavaCC and write in Java one or more visitors which translate a MicroJava program to a NanoJava program. You can assume that the MicroJava program can be compiled by javac. Your main file should be called P5.java, and if P.java contains a MicroJava program to be translated, then
java P5 < P.java > Q.java
creates the NanoJava program Q.java which has the same behavior as P.java. Specifications about the subset of MicroJava and NanoJava can be found here.

Note, your program must take input from standard input and write to standard output (so that we can use the redirection).

A sample Main.java can be found here.

Grading policy
Your homework will be graded for a total of 100 marks. Of these 50 marks will be for the public testcases and 50 marks for the TAs testcases.