CS712/CS812
Project Phase 4
Spring 2003
Due Sunday April 13


This phase concerns the compilation of C statements. Your work will be done in the context of the CS712 compiler pcc3. The phase4 release of the pcc3 source files will be available in ~cs712/public/phase4 on Monday April 7. You can begin your work on phase 4 by using your code from phase 3.

At the 70% level, you should implement the following statements: while, if, break and continue.

At the 85% level, you should also implement the following statements: for and do-while.

At the 100% level, you should also implement the following statements: label, case, default, switch and goto.

There are two steps to implementing these statements: add semantic analysis and add code generation support. The semantic analysis code for each statement should be placed in the corresponding routine in analyzeStmt.c. The code generation code for each statement should be placed in the corresponding routine in encodeStmt.c. The IA-32 code to be used for each statement will be discussed in class.

You do not need to support pointer and array types at this time. This will be added as part of phase 5.

Be sure to consider semantic errors.

Your code will be graded primarily by testing it for correct functionality. However, you may lose points if your program is not properly structured or adequately documented.

Your code will be graded using turing.unh.edu so be sure to test in that environment.

Your code should be submitted for grading from turing.unh.edu.

To turn in this assignment at all levels, type:
~cs712/bin/submit phase4 analyzeStmt.c encodeStmt.c

Submissions can be checked by typing (also on turing.unh.edu):
~cs712/bin/scheck phase4

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday April 14. Late submissions will be accepted at the penalty of 5 points per day up to one week late.

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


Last modified on January 2, 2003.

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