CSL 6848 - Principles of Programming Languages

Homework 2: Java Interpreter

Using JTB and JavaCC, write in Java one or more visitors which interpret a MicroJava program. You can assume that the MicroJava program can be compiled by javac. Your main file should be called P2.java, and if X.java contains a program to be interpreted, then

java P2 < X.java

should have the same behavior as if one compiles X.java with javac, and then interpretes X.class with 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, 10 marks for the contributed testcases, and 40 marks for the TAs testcases.