next up previous
Next: The if-then-else Solution Up: No Title Previous: Precedence

The if-then-else Problem

A standard problem in parsing is the if-then-else:
\begin{program}
Statement~\=::=~\=IF~LPAREN~Expression~RPAREN~Statement~
\ ~~~~...
 ... gt$\vert$\ gt...~other~statements~...
\ ~~~~~~~~~~~~~~~~~~\ gt;\end{program}
reports a shift-reduce conflict. It resolves in favor of shifting, which is what we want. We can



Christoph Zenger
4/6/2000