CS712/CS812
Project Phase 2
Spring 2008
Due Sunday March 9


Add control statements, block statements and empty statements to your T compiler. The control statements to be added are the if-then-else, while, return, break and continue statements. Note that the break and continue statements have been very recently added to T. Be sure you are reading an up-to-date copy of the specification.

First, you should fix all bugs in your Phase 1 compiler. Testing (and grading) your Phase 2 submission will depend on the Phase 1 functionality.

You will need to upgrade your scanner to add support for the new keywords required by the control statements.

You will need to upgrade your parser to add the necessary productions for the control, block and empty statements and to build AST nodes for these constructs.

You will need to upgrade your semantic analysis routines to properly handle the new AST nodes that represent the control, block and empty statements. Be sure to detect the necessary semantic errors and issue appropriate messages to stderr.

Finally, you will need to upgrade your code generator to generate code for the control, block and empty statements.

Your compiler should maintain all the behavior mandated by the Phase 1 specification, regarding command-line switches, AST dump format, Makefile goals, README file, etc.

Archive all your files in a tar file called "phase2.tar". This tar file should un-tar into a single directory called "phase2", which should contain the Makefile, the README file, the "RTS.cxx" file and all the source files. All submitted files should be placed directly in the top-level of this directory. (That is, please do not use subdirectories.) You should submit your tar archive from euler.unh.edu or zeno.unh.edu using my "submit" script. (The submission script will not work from gauss.unh.edu.) Please note: the tar file you submit should not be compressed. But, please, do not include any executable or object files in the tar file.

To turn in this assignment, type:
~cs712/bin/submit phase2 phase2.tar

Submissions can be checked by typing (also on euler.unh.edu or zeno.unh.edu):
~cs712/bin/scheck phase2

Points will be assigned for this assignment in the following manner:

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday March 10. Late submissions will be accepted at a penalty of 2 points for one day late, 5 points for two days late, 10 points for three days late, 20 points for four days late, and 40 points for five days late. No program may be turned in more than 5 days late.

Remember: you are expected to do your own work on this assignment.


Last modified on February 23, 2008.

Comments and questions should be directed to hatcher@unh.edu