CSC448: Code Generation: Homework [82/133] |
Corin did not show
Reading: chapter 9 (section 9.1, section 9.2, section 9.3 ) of the Dragon book.
Download hw-week-9.zip
and extract it to c:\compiler
(UNIX users:
anywhere will do, but the ZIP file does not include a
top-level directory, so unzip it in an empty directory).
Add an existing JavaCC directory as before.
Read through CodeGen.java
,
DualPrintWriter.java
, and
Frame.java
in the src/codegen/
directory and implement the changes described there (look
for TODO comments, only in CodeGen.java
). Test
your code using ant test
as usual. Look in the
TEST-*
files for summaries of the tests and the
appropriate subdirectories created under the
output/codegen
directory with the results of
code generation.
Your output need not be identical to that in the lecture slides, but it must be correct (meaning: the output program must have the same behaviour as the input program).
Debugging hint: you will not be able to run an executable
until everything is completed, but you can make a small
change to your code generator and then check that it is
correct by comparing your test096.s
against
file:test096.s.
Write a text file named grader.txt
that
contains your full name and email address(es) and save it in
the c:\compiler
directory.
Add a description to say whether or not you completed the
assignment. If you did not complete the assignment,
describe how much you have completed.
To submit your solution, ensure that your
grader.txt
file is still in place, then run
ant submit
from the c:\compiler
directory and upload the resulting ZIP file to the COL/DL
system for "Week 9 Homework".
Due at the start of the next lecture.