Assignments / #5

----------------------------------------------------------------------

Due Friday, 11/12/99

Implement typechecking and other semantic checking and analysis for the extended PL/0 language. This assignment involves not only coding the type checking, but deciding what type checking should be done (which may be harder!). Think both about determining the type of an object and other checks that must ensure that it is used legally in its context.

Run the extended compiler with the "-p -s -S" options to print the abstract parse tree, the symbol table, and then stop.

As usual, follow the printing instructions and turnin instructions posted in the Help Section. Turn in printouts for {decl,expr,stmt}.tc.c, symtab.{h,c}, and type.{h,c}. You may need to change some of your AST .h files, because methods you had only declared are now actually going to be implemented; however, these changes are minor, so you don't have to turn in printouts for them. Turn in your whole working directory electronically, even if you only changed a couple of files.

Please highlight the changes you make, and include a short desciption of what semantic errors you think your typechecker should catch and what kinds of tests you tried to verify that it catches these errors. Note that there should be a lot of overlap here - you can list the semantic errors you think your typechecker should catch and just say, "We tested each of these individually." If you test programs with multiple errors, be sure to mention what combinations you tried.

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.

Since this chunk of the project is fairly sizable, please begin early on your design and implementation! Making a list of those checks you need to include might be a good place to start.

Reminder: Midterm Monday 11/1/99