|CSE Home||About Us||Search||Contact Info|
None to turn in, but I strongly recommend that you try some of the code generation exercises in the book before you start hacking. E.g., try 9.1e, 9.2e, 9.3c (particularly recommended), 9.3e, and/or 9.5bce. Don't just hand-translate the code; try to be mechanical about it, and think carefully about where codegen gets the information it needs to address variables, pick registers, make decisions, etc., etc.
Complete the extended PL/0 compiler by
implementing the code generation routines for your new AST classes.
Run the extended compiler with the "-a" option to print the assembly
print() methods as needed), and/or
test execution via SPIM.
Be sure that you test the differences between call-by-reference and
call-by-value, and that references to up-level variables work,
whether the up-level variable was declared as a local, a
call-by-value formal, or a call-by-reference formal.
Codegen should retarget to either MIPS or X86 based on the appropriate compiler flag, and you shouldn't do anything to disrupt that structure, but you do not need to test both; just test MIPS, that's what we'll be grading.
As usual, turn in one solution per group, including:
As usual, you will be graded on correctness of your implementation, on clarity and good design of your implementation, and on sufficiency of your test cases.