CS 6848 - Principles of Programming Languages

Homework 1: Java Simplifier

Use JTB and JavaCC to write a MiniJava to MicroJava translator. You can assume that the input MiniJava programs are valid MiniJava programs (and hence also valid Java programs). Your main file should be called P1.java and if X.Java contains a valid MiniJava program to be simplified then

java P1 < X.java > Y.java

should create the equivalent MicroJava program in Y.java. 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.