CS200 Lab 6, Parsing Expressions

Overview

In this lab you will extend the given Sum Parser to a complete Expressions Parser.

Take the following codes from the progress webpage, and put them in an Eclipse project:

Add to these your TokenIter.java from P2. Now extend the code so that it parses full arithmetic expressions:

   expr = term ( "+"|"-" term )*
   term = factor ( "*"|"/" factor )*
   factor = number | "(" expr ")"
Make sure you add valid debug print statements, so you can follow the sequences of parse events.