|
CSE Home | About Us | Search | Contact Info |
As usual, turn in only one solution per group.
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 be done to ensure that it is used legally in its context.
For your debugging pleasure, you can run the extended compiler with the "-p -s -S" options to print the abstract syntax tree, the symbol table, and then stop.
Turn in printouts for {decl,expr,stmt}.tc.c, symtab.{h,c}, type.{h,c}, and any other files that you modify substantially. (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 probably minor; you don't have to turn in printouts for them in that case.) 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.
In summary, turn in: