CS 6013 - Modern Compilers, Theory and Practice

Assignment 3: Conditional Constant Propagation.

This assignment is the third part of a multi part project to write an optimizing compiler for Minijava. We start with TACoJava programs and after doing constant propagation (P3), generate optimized programs in TACoJava2 format.

Use JTB and JavaCC, to write in Java one or more visitors which implement Intra procedural conditional constant propagation. Your main file should be called P3.java, if P.java contains a program to be optimized in TACoJava form then

java P3 < P.java > Pc.java

should create Pc.java in TACoJava2 form and is semantically equivalent to P.java with some of the variables replaced with constants. Note, your program must take input program from standard input and write to standard output (so that we can use redirection).

Grading policy
Your homework will be graded for a total of 100 marks. 20 marks for the contributed testcases and 80 marks for the TAs testcases.
[ under development ]