136 |
exp: exp OP exp | NUM; |
exp: exp OP exp | NUM; |
137 |
]]) |
]]) |
138 |
|
|
139 |
AT_CHECK([bison input.y -o input.c -v], 0, [], |
AT_CHECK([bison input.y -o input.c --report=all], 0, [], |
140 |
[input.y contains 1 shift/reduce conflict. |
[input.y contains 1 shift/reduce conflict. |
141 |
]) |
]) |
142 |
|
|
172 |
state 0 |
state 0 |
173 |
|
|
174 |
$axiom -> . exp $ (rule 0) |
$axiom -> . exp $ (rule 0) |
175 |
|
exp -> . exp OP exp (rule 1) |
176 |
|
exp -> . NUM (rule 2) |
177 |
|
|
178 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
179 |
|
|
208 |
|
|
209 |
state 4 |
state 4 |
210 |
|
|
211 |
|
exp -> . exp OP exp (rule 1) |
212 |
exp -> exp OP . exp (rule 1) |
exp -> exp OP . exp (rule 1) |
213 |
|
exp -> . NUM (rule 2) |
214 |
|
|
215 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
216 |
|
|
220 |
|
|
221 |
state 5 |
state 5 |
222 |
|
|
223 |
exp -> exp . OP exp (rule 1) |
exp -> exp . OP exp [$, OP] (rule 1) |
224 |
exp -> exp OP exp . (rule 1) |
exp -> exp OP exp . [$, OP] (rule 1) |
225 |
|
|
226 |
OP shift, and go to state 4 |
OP shift, and go to state 4 |
227 |
|
|
248 |
exp: exp OP exp | NUM; |
exp: exp OP exp | NUM; |
249 |
]]) |
]]) |
250 |
|
|
251 |
AT_CHECK([bison input.y -o input.c -v], 0, [], []) |
AT_CHECK([bison input.y -o input.c --report=all], 0, [], []) |
252 |
|
|
253 |
# Check the contents of the report. |
# Check the contents of the report. |
254 |
AT_CHECK([cat input.output], [], |
AT_CHECK([cat input.output], [], |
255 |
[[Conflict in state 5 between rule 2 and token OP resolved as shift. |
[[Grammar |
|
|
|
|
|
|
|
Grammar |
|
256 |
|
|
257 |
Number, Line, Rule |
Number, Line, Rule |
258 |
0 4 $axiom -> exp $ |
0 4 $axiom -> exp $ |
279 |
state 0 |
state 0 |
280 |
|
|
281 |
$axiom -> . exp $ (rule 0) |
$axiom -> . exp $ (rule 0) |
282 |
|
exp -> . exp OP exp (rule 1) |
283 |
|
exp -> . NUM (rule 2) |
284 |
|
|
285 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
286 |
|
|
315 |
|
|
316 |
state 4 |
state 4 |
317 |
|
|
318 |
|
exp -> . exp OP exp (rule 1) |
319 |
exp -> exp OP . exp (rule 1) |
exp -> exp OP . exp (rule 1) |
320 |
|
exp -> . NUM (rule 2) |
321 |
|
|
322 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
323 |
|
|
327 |
|
|
328 |
state 5 |
state 5 |
329 |
|
|
330 |
exp -> exp . OP exp (rule 1) |
exp -> exp . OP exp [$] (rule 1) |
331 |
exp -> exp OP exp . (rule 1) |
exp -> exp OP exp . [$] (rule 1) |
332 |
|
|
333 |
OP shift, and go to state 4 |
OP shift, and go to state 4 |
334 |
|
|
335 |
$default reduce using rule 1 (exp) |
$default reduce using rule 1 (exp) |
336 |
|
|
337 |
|
Conflict between rule 2 and token OP resolved as reduce (%right OP). |
338 |
|
|
339 |
|
|
340 |
]]) |
]]) |