Logo University of Washington Department of Computer Science & Engineering
 CSE 401Sp '01: Assignment #6, Due Friday, 5/25/01
  CSE Home  About Us    Search    Contact Info 

Individual homework

None to turn in, but I strongly recommend that you try, say by middle of next week, 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 godegen gets the information it needs to address variables, pick registers, make decisions, etc., etc.


As usual, turn in only one solution per group.

Complete the extended PL/0 compiler by implementing the code generation routines for your new AST classes. 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. Run the extended compiler with the "-a" option to print the assembly code, and/or test execution via SPIM.

Again, you only need to turn in printouts of those files in which you make major changes, presumably only {decl,expr,stmt}.{h, codegen.c} and symtab.codegen.c. (Note that you may not need to change all of these files.) As usual, please highlight your changes on your listings, and turn in your whole directory electronically.

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.

In summary, turn in: