/[bison]/bison/tests/conflicts.at
ViewVC logotype

Diff of /bison/tests/conflicts.at

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by akim, Tue Apr 23 09:06:42 2002 UTC revision 1.5 by akim, Sun May 26 20:25:52 2002 UTC
# Line 136  AT_DATA([input.y], Line 136  AT_DATA([input.y],
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    
# Line 172  exp (6) Line 172  exp (6)
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    
# Line 206  state 3 Line 208  state 3
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    
# Line 216  state 4 Line 220  state 4
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    
# Line 244  AT_DATA([input.y], Line 248  AT_DATA([input.y],
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 $
# Line 278  exp (6) Line 279  exp (6)
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    
# Line 312  state 3 Line 315  state 3
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    
# Line 322  state 4 Line 327  state 4
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  ]])  ]])

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26