In this project, you will be asked to write a recursive descent LL(1) parser and code generator for the tinyL language. Your compiler will generate RISC machine instructions called ILOC (Intermediate
Language for Optimizing Compilers). You will also write a code optimizer that takes ILOC
instructions as input and implements different peephole optimizations. The output of the
optimzer is a sequence of ILOC instructions which produces the same results as the original
input sequence. To test your generated programs, you can use a virtual machine (simulator)
that can “run” your ILOC programs. The project will require you to manipulate linked
lists of instructions. In order to avoid memory leaks, explicit deallocation of “eliminated”
instructions is necessary
The project consists of two main parts:
1. Complete the partially implemented recursive descent LL(1) parser that generates
2. Write a peephole optimizer for constant folding and operator strength reduction.
In addition, you are asked to write the PrintInstructionList routine. The project
represents an entire programming environment consisting of a compiler, an optimizer, and a
simulator (virtual machine) for ILOC. The ILOC simulator is called sim and will be made
available to you as an executable on the ilab machines. This will allow you to check for
correctness of your generated and optimized code.
Need help for implementing part 2 (contact me for more info). 95% code has been given just need to write some lines of code to make it work. We have to write it in C programming.