Take the InfixSum codes from the progress webpage (week 5) or right here InfixSum.jar. You will need to extract the jar file.
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 = "-" factor | number | "(" expr ")"You can add debug print statements, so you can follow the sequences of parse events.