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 context-insensitive conditional constant propagation.
Use CHA to build a call-graph.
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).
Your code should (i) do constant propagation, and (ii) elide unused assignments + unreachable code that can be identified after the constant propagation pass.
Some instances of redundant code:
Grading policy
Your homework will be graded for a total of 100 marks.
[ under development ]