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

Diff of /bison/tests/regression.at

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

revision 1.9 by akim, Mon Nov 12 09:32:35 2001 UTC revision 1.10 by akim, Mon Nov 12 09:33:04 2001 UTC
# Line 43  AT_CHECK([bison -v duplicate.y -o duplic Line 43  AT_CHECK([bison -v duplicate.y -o duplic
43  AT_CLEANUP([duplicate.*])  AT_CLEANUP([duplicate.*])
44    
45    
46  ## ----------- ##  ## ------------------------- ##
47  ## Conflicts.  ##  ## Unresolved SR Conflicts.  ##
48  ## ----------- ##  ## ------------------------- ##
49    
50  AT_SETUP([Conflicts])  AT_SETUP([Unresolved SR Conflicts])
51    
52  AT_DATA([input.y],  AT_DATA([input.y],
53  [[%token NUM OP  [[%token NUM OP
# Line 127  state 4 Line 127  state 4
127      $default    reduce using rule 1 (exp)      $default    reduce using rule 1 (exp)
128    
129    
130    
131    state 5
132    
133        $           go to state 6
134    
135    
136    
137    state 6
138    
139        $default    accept
140    ]])
141    
142    AT_CLEANUP(input.c input.output)
143    
144    
145    ## --------------------- ##
146    ## Solved SR Conflicts.  ##
147    ## --------------------- ##
148    
149    AT_SETUP([Solved SR Conflicts])
150    
151    AT_DATA([input.y],
152    [[%token NUM OP
153    %right OP
154    %%
155    exp: exp OP exp | NUM;
156    ]])
157    
158    AT_CHECK([bison input.y -o input.c -v], 0, [], [])
159    
160    # Check the contents of the report.
161    AT_CHECK([cat input.output], [],
162    [[Conflict in state 4 between rule 1 and token OP resolved as shift.
163    
164    Grammar
165    
166    rule 1    exp -> exp OP exp
167    rule 2    exp -> NUM
168    
169    Terminals, with rules where they appear
170    
171    $ (-1)
172    error (256)
173    NUM (257) 2
174    OP (258) 1
175    
176    Nonterminals, with rules where they appear
177    
178    exp (5)
179        on left: 1 2, on right: 1
180    
181    
182    state 0
183    
184        NUM         shift, and go to state 1
185    
186        exp         go to state 2
187    
188    
189    
190    state 1
191    
192        exp  ->  NUM .   (rule 2)
193    
194        $default    reduce using rule 2 (exp)
195    
196    
197    
198    state 2
199    
200        exp  ->  exp . OP exp   (rule 1)
201    
202        $           go to state 5
203        OP          shift, and go to state 3
204    
205    
206    
207    state 3
208    
209        exp  ->  exp OP . exp   (rule 1)
210    
211        NUM         shift, and go to state 1
212    
213        exp         go to state 4
214    
215    
216    
217    state 4
218    
219        exp  ->  exp . OP exp   (rule 1)
220        exp  ->  exp OP exp .   (rule 1)
221    
222        OP          shift, and go to state 3
223    
224        $default    reduce using rule 1 (exp)
225    
226    
227    
228  state 5  state 5
229    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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