1 |
# Exercising Bison on conflicts. -*- Autotest -*- |
# Exercising Bison on conflicts. -*- Autotest -*- |
2 |
# Copyright 2002 Free Software Foundation, Inc. |
# Copyright (C) 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
5 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
19 |
AT_BANNER([[Conflicts.]]) |
AT_BANNER([[Conflicts.]]) |
20 |
|
|
21 |
|
|
22 |
|
## ---------------- ## |
23 |
|
## S/R in initial. ## |
24 |
|
## ---------------- ## |
25 |
|
|
26 |
|
# I once hacked Bison in such a way that it lost its reductions on the |
27 |
|
# initial state (because it was confusing it with the last state). It |
28 |
|
# took me a while to strip down my failures to this simple case. So |
29 |
|
# make sure it finds the s/r conflict below. |
30 |
|
|
31 |
|
AT_SETUP([S/R in initial]) |
32 |
|
|
33 |
|
AT_DATA([[input.y]], |
34 |
|
[[%expect 1 |
35 |
|
%% |
36 |
|
exp: e 'e'; |
37 |
|
e: 'e' | /* Nothing. */; |
38 |
|
]]) |
39 |
|
|
40 |
|
AT_CHECK([bison input.y -o input.c]) |
41 |
|
|
42 |
|
AT_CLEANUP |
43 |
|
|
44 |
## ------------------- ## |
## ------------------- ## |
45 |
## %nonassoc and eof. ## |
## %nonassoc and eof. ## |
46 |
## ------------------- ## |
## ------------------- ## |
165 |
|
|
166 |
state 0 |
state 0 |
167 |
|
|
168 |
|
$axiom -> . exp $ (rule 0) |
169 |
|
|
170 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
171 |
|
|
172 |
exp go to state 2 |
exp go to state 2 |
271 |
|
|
272 |
state 0 |
state 0 |
273 |
|
|
274 |
|
$axiom -> . exp $ (rule 0) |
275 |
|
|
276 |
NUM shift, and go to state 1 |
NUM shift, and go to state 1 |
277 |
|
|
278 |
exp go to state 2 |
exp go to state 2 |