Next: The if-then-else Solution
Up: No Title
Previous: Precedence
A standard problem in parsing is the if-then-else:
reports a shift-reduce conflict. It resolves in favor of shifting,
which is what we want.
We can
- Give ELSE higher priority than the production:
precedence left ELSE.
- Tell JavaCUP on the command line to expect one conflict:
-expect 1.
- Fix the grammar properly!
Christoph Zenger
4/6/2000