# test grammar for slr generator with reduce-reduce conflict
# also tests computation of follow set
nonterminal S Integer
nonterminal T Integer
terminal x ( )
topsym S
left ) 50
left ( 900
left x 500
S --> x { return 1; }
T --> x { return 1; }
S --> T { return 3; }
EOF
Output of my SLR parser generator (the rr-conflict was resolved in favor of the
first rule listed in the grammar, which is S-->x)
!!! Reduce-reduce conflict detected. Conflict state:
S --> x .
T --> x .
FSM with 5 states created
state 0:
S --> .x
T --> .x
S --> .T
START --> .S EOF
state 1:
S --> x .
T --> x .
state 2:
S --> T .
state 3:
START --> S .EOF
state 4:
START --> S EOF .
Nullible Nonterminals:
FIRST SETS:
S : x
T : x
START : x
FOLLOW SETS:
S : EOF
T : EOF
START :