Project Description
The course project is to add the following language constructs to PL/0:
- comments ("#" to end of line)
- allow "_" in identifiers
- if/then/else statements
- simple for loops, plus break statements
- procedures with results, plus return statements
- call-by-reference parameter passing
- arrays and array indexing
- booleans as first-class data types, with true and false
constants and and and or operators
- expressions allowed as constants
Each language addition will require language design and specification
work (extending the initial PL/0 language specification to include the
new features) as well as implementation work (extending the initial
C++ implementation of PL/0 to compile the new features).
Emphasis in the implementation should be placed on making clean,
understandable changes that fit in well to the existing compiler
structure. This will make reading the changed code easier, both for
me, the TA, and you. Gross, low-level hacks, even for better compiler
efficiency, will not be appreciated.
You are encouraged to organize yourselves into two-person teams to
work on the project. When turning in a part of the project, simply
list the names of the members of the project team. The grade for that
part of the project will be assigned to all members of the team. Teams
can be dissolved at any point, after which the two people will do
independent work and receive independent grades. You are not required
to be on a team, but you are likely to learn more and work less by
being on a team.
All implementation work for this class should be done on
ceylon, fiji, sumatra, or
tahiti. The C++ source for the initial version of the PL/0
compiler is in the directory /cse/courses/cse401/00sp/pl0 .
Instructions on installing and using the compiler are
here.
Project Due Dates (tentative):
- 3/31: get PL/0 compiler built; write and compile PL/0 programs
- 4/10: extend RE description of tokens of PL/0; extend lexical analysis of compiler
- 4/14: extend EBNF description of syntax of PL/0
- 4/19: extend AST implementation of compiler
- 4/24: extend syntax analysis of compiler
- 5/8: extend type-checker of compiler
- 5/15: extend run-time storage allocation of compiler
- 6/2: extend code generator of compiler