CS 327 Homework 3

Due Wednesday January 31 at 11:59 PM.

Modify Parser.java and AST.java in the following ways:

  1. Change the file names to Parser2.java and AST2.java and the class name to Parser2 and AST2. Also
  2. Add relational operators < <= > and >= to the operator enum and the parser. Use LT, LE, GT, and GE for the operator types.
  3. Add reserved words true and false to the parser. The parser should create constants with values 1 and 0.
  4. Add a repeat until statement class (class RepeatStatement) to AST2 and modify the parser to parse it. The production will be repeat-statement → 'repeat' statements 'until' expression. Make the type REPEAT_STATEMENT.

Make a copy of TestParser called TestParser2, change the class name, and modify it to work with Parser2.