CS 451/651    Homework 1 -- Simple Recursive Descent Parser


I've prepared a few pieces, including a parser framework.   Your job is to finish building a parser for the language indicated in the assignment.

The resulting parser program should
When you have the rest working, please add an additional grammar rule to read:

    primary ::=  identifier |  number |  "("  expr  ")"



Due Monday Sept 21

Here are some helpful files:

simple main program  ScannerDemo.java 
             (input string is "argument to main")
Simple Scanner .java   
             (remember: tokens must be separated by spaces)
Parser Skeleton Parser1.java
             (framework includes some possibly helpful debug output)

Java Class File with my version of Parser Parser.class
       (To use this, ScannerDemo should create a "new Parser", not a Parser1)
   You can run this to see (one possible) way of doing the parser.


BTW:
 I have provided two forms of the "if" statement, one with parens (in my implementation -- like Java), one with a "then" keyword (in the grammar).  Your choice.