Project 4

This last project involves adding additional features to the compiler or interpreter you developed for project 3.  Grading for the whole set of projects will be on a 100 point basis, with the final project grade then being used in the overall grading formula given on the class web page.  The weights of the project parts will be:
 
Project 1
20
Project 2
25
Project 3
25
Project 4
          Procedures (with nested scopes)
8
          Recursion
8
          Parameters
8
          Arrays
8
          Records
6
          Local constant propogation
4
          Local common subexpression elimination
6
          Global analysis and optimization of your choice
10

Procedures and recursion are required features of this assignment.  Beyond these, you may implement any of the others you choose.
 

Details

You can find some sample test cases here. Here are the important points.

Procedure declarations look much like they do in Pascal or Ada; they can be nested; there are forward declarations. Tests 1-7 show some examples.

Procedures can have three type of parameters: "in", "out" or "in out". "in" are pass-by-value, the other are pass-by-reference. Tests 8 and 9 show this.

Records can be declared much like in Pascal; test10 has an example.

Arrays can be declared much like in Pascal; test11 has an example.

There are probably some ambiguities, omissions, and errors as yet, but this should be enough to get you started. Keep asking questions on the newsgroup.

Turnin info

You should turnin...
   turnin  prj4  directory_with_all_files

Last updated on Tue Dec 7 16:13:10 EST 1999 by Brian McNamara