|
This assignment consists of three subparts:
- implement all abstract syntax tree classes,
- extend the parser to generate abstract syntax trees, and
- write a pretty printer for abstract syntax trees.
For the classes of the abstract syntax tree a framework is provided
on the WWW in the file Tree.java.
For extending the parser you will sometimes need arrays of subtrees.
You can use TreeArrayBuffer.java
for doing this.
There is also a framework for the pretty printer:
Printer.java. This pretty printer
uses the concept of a visitor. You will need the pretty printer
to check, whether you built a correct tree. It is not neccessary
to give out correct J0 and it does not matter if you have
additional parentheses.
|