Extend the BNF description of the PL/0 syntactic structure
to include the new language features, and hand in your revised
description (a sheet of paper). (You'll be given a solution set
grammar on the turn-in day, so don't start implementing the most
complex parts of the AST or parsing code until you get it.)
You will need to give some thought to which language features
(e.g., "variables must be declared", or "break may occur only in
a loop", or "every for loop must have an end token") are best
enforced by the grammar and which are best enforced during
semantic analysis (or later). Write a few sentences to document
these major design decisions, i.e., explain what you decided to
do and sketch why. Turn this in with your revised BNF.
In summary, the new language features are:
- if/then/else
- for loops
- break statements
- boolean types
- and/or operators
- constant expressions
- arrays & array indexing
- call by reference
- functions & function calls with results.
See the project description for
full details.