next up previous
Next: Using Precedence Up: No Title Previous: An Expression Parser in

A shift-reduce Conflict

If we enter the grammar
\begin{program}
Expression~~::=~Expression~PLUS~Expression
\ ~~~~~~~~~~~~~~~~~~~~~~~~;\end{program}
without precedence JavaCUP will tell us:
\begin{program}
$*$$*$$*$~Shift/Reduce~conflict~found~in~state~\char93 4
\ ~~~~...
 ...ion~
\ ~~~~under~symbol~PLUS
\ ~~~~Resolved~in~favor~of~shifting.\end{program}

Telling JavaCUP that PLUS is left associative helps!



Christoph Zenger
4/6/2000