Compilers (CS362 2001S)

Project, Phase 2: Parser

Assigned: Friday, March 9, 2001
Due: Wednesday, March 14, 2001

Summary: In this stage of the project, you will design and build the parser for your Pascal compilers. The output from your parser should be a parse tree in which the internal nodes are all objects (members of classes).

Warning: You may be required to use each others' lexers at the next stage of the project.

Group Work: You should work in groups of size 3. You have been assigned to particular groups.

Code Reuse You may use any of the lexers created for this class (or you may create a new one).

Building a Parser

1. Begin by deciding on the natural grammar for Pascal. You should do this in the next day or so. You can certainly rely on the grammar that appears in the Pascal User Manual and Report.

2. Design Java interfaces and classes for the various nonterminals. I'd suggest that you have a different interface for each nonterminal and subclass it for each of the different productions.

3. Implement the parser. It should read input (probably passed as a parameter) and return a parse tree with Program at the root. You may iomplement the parser using the recursive-descent techniques we've discussed in class or you may implement the parser using a parser generator.

 

History

Friday, 2 March 2001

 

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Wed Mar 14 10:08:29 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS362/2001S/project.02.html.
You may validate this page's HTML.
The source was last modified Fri Mar 2 10:45:32 2001.