CSCE 3650/5650 ASSIGNMENT #3
Due Monday, March 12, 2012
Design and implement an LALR(1) parser for TinyJava which will parse programs
according to
the prescribed grammar.
This process has the following steps:
- The layout of the parser should conform to the EBNF grammar of TinyJava
given in Assignment #1.
- The parser should interact with the lexical analyzer
to retrieve tokens as it needs them.
- The parser may terminate execution
if a syntax error is detected. No error recovery is required.
- If the source program has no syntax errors, the result of the parse
should be a source program listing (e.g., this can be printed by the lexical
analyzer as the program is read) and a statement that parsing was successful.
Suggestion:
Use the yacc, bison, or
CUP tool to automatically construct a parser for TinyJava
from an appropriate grammar specification.
Barrett Bryant
2012-02-27