CSE401 Assignment 4

Assigned: Wednesday 10/11/00

Readings (in the Dragon Book)
Read before the lecture on the specified day

10/20/00 Friday Sections 6.1-6.4
10/23/00 Monday Sections 6.5-6.6

 

NOTE WELL:
YOU CAN DO THE PROJECT PART IN PAIRS, BUT THE
ASSIGNMENTS FROM THE BOOK, ETC., MUST BE DONE ON YOUR OWN.

Assignment/Project

10/23/00 Monday

Note: This is by far the biggest change you'll have made to the PL/0 compiler, so please don't leave it until the last moment. 
Your first implementation project for modifying the syntactic analysis part of the PL/0 compiler is in two steps.  You are not required to hand in the first one as an intermediate step, but you should still think about it very carefully, and you must make your decisions in this dimension very clear when you turn this step in.
  1. Design the necessary extensions to the PL/0 AST class hierarchy to represent the extended PL/0 language.  The extended EBNF to use is found here.
  2. Extend the PL/0 parser by modifying the parsing routines to parse the extended syntax and construct extended ASTs.  Mark will announce how he wants the turn in to take place.  Very likely, he will want you to turn in highlighted printouts of your changed parsing files, test input programs, and output demonstrating that your parser parses the extended language.  For this, you can run the extended compiler with the "-p -P" flags to print the parse tree and stop.

    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.