1 # Exercising Bison on conflicts. -*- Autotest -*-
3 # Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009, 2010 Free
4 # Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 AT_BANNER([[Conflicts.]])
22 ## ---------------- ##
24 ## ---------------- ##
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.
31 AT_SETUP([S/R in initial])
37 e: 'e' | /* Nothing. */;
40 AT_BISON_CHECK([-o input.c input.y], 0, [],
41 [[input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
47 ## ------------------- ##
48 ## %nonassoc and eof. ##
49 ## ------------------- ##
51 AT_SETUP([%nonassoc and eof])
53 AT_DATA_GRAMMAR([input.y],
60 #define YYERROR_VERBOSE 1
62 yyerror (const char *msg)
64 fprintf (stderr, "%s\n", msg);
67 /* The current argument. */
68 static const char *input;
74 if (! (toknum <= strlen (input)))
76 return input[toknum++];
90 main (int argc, const char *argv[])
92 input = argc <= 1 ? "" : argv[1];
97 # Specify the output files to avoid problems on different file systems.
98 AT_BISON_CHECK([-o input.c input.y])
101 AT_PARSER_CHECK([./input '0<0'])
102 AT_PARSER_CHECK([./input '0<0<0'], [1], [],
103 [syntax error, unexpected '<'
106 AT_PARSER_CHECK([./input '0>0'])
107 AT_PARSER_CHECK([./input '0>0>0'], [1], [],
108 [syntax error, unexpected '>'
111 AT_PARSER_CHECK([./input '0<0>0'], [1], [],
112 [syntax error, unexpected '>'
115 # We must disable default reductions in inconsistent states in order to
116 # have an explicit list of all expected tokens. (However, unless we use
117 # canonical LR, lookahead sets are merged for different left contexts,
118 # so it is still possible to have extra incorrect tokens in the expected
119 # list. That just doesn't happen to be a problem for this test case.)
121 AT_BISON_CHECK([-Dlr.default-reductions=consistent -o input.c input.y])
124 AT_PARSER_CHECK([./input '0<0'])
125 AT_PARSER_CHECK([./input '0<0<0'], [1], [],
126 [syntax error, unexpected '<', expecting $end
129 AT_PARSER_CHECK([./input '0>0'])
130 AT_PARSER_CHECK([./input '0>0>0'], [1], [],
131 [syntax error, unexpected '>', expecting $end
134 AT_PARSER_CHECK([./input '0<0>0'], [1], [],
135 [syntax error, unexpected '>', expecting $end
142 ## -------------------------------------- ##
143 ## %error-verbose and consistent errors. ##
144 ## -------------------------------------- ##
146 AT_SETUP([[%error-verbose and consistent errors]])
148 m4_pushdef([AT_CONSISTENT_ERRORS_CHECK], [
150 AT_BISON_OPTION_PUSHDEFS([$1])
152 m4_pushdef([AT_YYLEX_PROTOTYPE],
153 [AT_SKEL_CC_IF([[int yylex (yy::parser::semantic_type *lvalp)]],
154 [[int yylex (YYSTYPE *lvalp)]])])
156 AT_SKEL_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
160 import java.io.IOException;
163 %code {]AT_SKEL_CC_IF([[
164 #include <string>]], [[
167 void yyerror (char const *msg);]])[
168 ]AT_YYLEX_PROTOTYPE[;
172 ]AT_SKEL_CC_IF([[%defines]], [[%define api.pure]])])[
182 ]AT_SKEL_JAVA_IF([[%code lexer {]], [[%%]])[
186 `--------*/]AT_SKEL_JAVA_IF([[
188 public String input = "]$3[";
189 public int index = 0;
192 if (index < input.length ())
193 return input.charAt (index++);
197 public Object getLVal ()
199 return new Integer(1);
204 static char const *input = "]$3[";
211 `----------*/]AT_SKEL_JAVA_IF([[
213 public void yyerror (String msg)
215 System.err.println (msg);
220 %%]], [AT_SKEL_CC_IF([[
223 yy::parser::error (const yy::location &, std::string const &msg)
225 std::cerr << msg << std::endl;
229 yyerror (char const *msg)
231 fprintf (stderr, "%s\n", msg);
236 `-------*/]AT_SKEL_JAVA_IF([[
240 public static void main (String args[]) throws IOException
242 YYParser p = new YYParser ();
245 }]], [AT_SKEL_CC_IF([[
251 return parser.parse ();
261 AT_FULL_COMPILE([[input]])
263 m4_pushdef([AT_EXPECTING], [m4_if($5, [ab], [[, expecting 'a' or 'b']],
264 $5, [a], [[, expecting 'a']],
265 $5, [b], [[, expecting 'b']])])
267 AT_SKEL_JAVA_IF([AT_JAVA_PARSER_CHECK([[input]], [[0]]],
268 [AT_PARSER_CHECK([[./input]], [[1]]]),
270 [[syntax error, unexpected ]$4[]AT_EXPECTING[
273 m4_popdef([AT_EXPECTING])
274 m4_popdef([AT_YYLEX_PROTOTYPE])
275 AT_BISON_OPTION_POPDEFS
279 m4_pushdef([AT_PREVIOUS_STATE_GRAMMAR],
282 start: consistent-error-on-a-a 'a' ;
284 consistent-error-on-a-a:
285 'a' default-reduction
286 | 'a' default-reduction 'a'
290 default-reduction: /*empty*/ ;
293 // Provide another context in which all rules are useful so that this
294 // test case looks a little more realistic.
295 start: 'b' consistent-error-on-a-a 'c' ;
298 m4_pushdef([AT_PREVIOUS_STATE_INPUT], [[a]])
300 # Unfortunately, no expected tokens are reported even though 'b' can be
301 # accepted. Nevertheless, the main point of this test is to make sure
302 # that at least the unexpected token is reported. In a previous version
303 # of Bison, it wasn't reported because the error is detected in a
304 # consistent state with an error action, and that case always triggered
305 # the simple "syntax error" message.
307 # The point isn't to test IELR here, but state merging happens to
308 # complicate this example.
309 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr]],
310 [AT_PREVIOUS_STATE_GRAMMAR],
311 [AT_PREVIOUS_STATE_INPUT],
313 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
315 [AT_PREVIOUS_STATE_GRAMMAR],
316 [AT_PREVIOUS_STATE_INPUT],
318 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
320 [AT_PREVIOUS_STATE_GRAMMAR],
321 [AT_PREVIOUS_STATE_INPUT],
323 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
325 [AT_PREVIOUS_STATE_GRAMMAR],
326 [AT_PREVIOUS_STATE_INPUT],
327 [[end of input]], [[none]])
329 # Even canonical LR doesn't foresee the error for 'a'!
330 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
331 %define lr.default-reductions consistent]],
332 [AT_PREVIOUS_STATE_GRAMMAR],
333 [AT_PREVIOUS_STATE_INPUT],
335 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
336 %define lr.default-reductions accepting]],
337 [AT_PREVIOUS_STATE_GRAMMAR],
338 [AT_PREVIOUS_STATE_INPUT],
340 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type canonical-lr]],
341 [AT_PREVIOUS_STATE_GRAMMAR],
342 [AT_PREVIOUS_STATE_INPUT],
345 m4_popdef([AT_PREVIOUS_STATE_GRAMMAR])
346 m4_popdef([AT_PREVIOUS_STATE_INPUT])
348 m4_pushdef([AT_USER_ACTION_GRAMMAR],
351 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
352 // incorrectly for the 'b' set in the semantic action below. All 'a'
353 // tokens are returned by yylex, which sets $$ = 1.
356 fprintf (stderr, "Wrong destructor.\n");
359 // Rather than depend on an inconsistent state to induce reading a
360 // lookahead as in the previous grammar, just assign the lookahead in a
361 // semantic action. That lookahead isn't needed before either error
362 // action is encountered. In a previous version of Bison, this was a
363 // problem as it meant yychar was not translated into yytoken before
364 // either error action. The second error action thus invoked a
365 // destructor that it selected according to the incorrect yytoken. The
366 // first error action would have reported an incorrect unexpected token
367 // except that, due to the bug described in the previous grammar, the
368 // unexpected token was not reported at all.
369 start: error-reduce consistent-error 'a' { USE ($][3); } ;
372 'a' 'a' consistent-reduction consistent-error 'a'
373 { USE (($][1, $][2, $][5)); }
378 consistent-reduction: /*empty*/ {
379 assert (yychar == YYEMPTY);
386 | /*empty*/ %prec 'a'
389 // Provide another context in which all rules are useful so that this
390 // test case looks a little more realistic.
391 start: 'b' consistent-error 'b' ;
393 m4_pushdef([AT_USER_ACTION_INPUT], [[aa]])
395 AT_CONSISTENT_ERRORS_CHECK([[]],
396 [AT_USER_ACTION_GRAMMAR],
397 [AT_USER_ACTION_INPUT],
399 AT_CONSISTENT_ERRORS_CHECK([[%glr-parser]],
400 [AT_USER_ACTION_GRAMMAR],
401 [AT_USER_ACTION_INPUT],
403 # No C++ or Java test because yychar cannot be manipulated by users.
405 AT_CONSISTENT_ERRORS_CHECK([[%define lr.default-reductions consistent]],
406 [AT_USER_ACTION_GRAMMAR],
407 [AT_USER_ACTION_INPUT],
410 # Canonical LR doesn't foresee the error for 'a'!
411 AT_CONSISTENT_ERRORS_CHECK([[%define lr.default-reductions accepting]],
412 [AT_USER_ACTION_GRAMMAR],
413 [AT_USER_ACTION_INPUT],
415 AT_CONSISTENT_ERRORS_CHECK([[%define lr.type canonical-lr]],
416 [AT_USER_ACTION_GRAMMAR],
417 [AT_USER_ACTION_INPUT],
420 m4_popdef([AT_USER_ACTION_GRAMMAR])
421 m4_popdef([AT_USER_ACTION_INPUT])
423 m4_popdef([AT_CONSISTENT_ERRORS_CHECK])
429 ## ------------------------- ##
430 ## Unresolved SR Conflicts. ##
431 ## ------------------------- ##
433 AT_SETUP([Unresolved SR Conflicts])
435 AT_KEYWORDS([report])
440 exp: exp OP exp | NUM;
443 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
444 [input.y: conflicts: 1 shift/reduce
447 # Check the contents of the report.
448 AT_CHECK([cat input.output], [],
449 [[State 5 conflicts: 1 shift/reduce
460 Terminals, with rules where they appear
468 Nonterminals, with rules where they appear
473 on left: 1 2, on right: 0 1
478 0 $accept: . exp $end
482 NUM shift, and go to state 1
491 $default reduce using rule 2 (exp)
496 0 $accept: exp . $end
499 $end shift, and go to state 3
500 OP shift, and go to state 4
505 0 $accept: exp $end .
516 NUM shift, and go to state 1
524 1 | exp OP exp . [$end, OP]
526 OP shift, and go to state 4
528 OP [reduce using rule 1 (exp)]
529 $default reduce using rule 1 (exp)
536 ## ----------------------- ##
537 ## Resolved SR Conflicts. ##
538 ## ----------------------- ##
540 AT_SETUP([Resolved SR Conflicts])
542 AT_KEYWORDS([report])
548 exp: exp OP exp | NUM;
551 AT_BISON_CHECK([-o input.c --report=all input.y])
553 # Check the contents of the report.
554 AT_CHECK([cat input.output], [],
563 Terminals, with rules where they appear
571 Nonterminals, with rules where they appear
576 on left: 1 2, on right: 0 1
581 0 $accept: . exp $end
585 NUM shift, and go to state 1
594 $default reduce using rule 2 (exp)
599 0 $accept: exp . $end
602 $end shift, and go to state 3
603 OP shift, and go to state 4
608 0 $accept: exp $end .
619 NUM shift, and go to state 1
627 1 | exp OP exp . [$end, OP]
629 $default reduce using rule 1 (exp)
631 Conflict between rule 1 and token OP resolved as reduce (%left OP).
637 ## -------------------------------- ##
638 ## Defaulted Conflicted Reduction. ##
639 ## -------------------------------- ##
641 # When there are RR conflicts, some rules are disabled. Usually it is
642 # simply displayed as:
644 # $end reduce using rule 3 (num)
645 # $end [reduce using rule 4 (id)]
647 # But when `reduce 3' is the default action, we'd produce:
649 # $end [reduce using rule 4 (id)]
650 # $default reduce using rule 3 (num)
652 # In this precise case (a reduction is masked by the default
653 # reduction), we make the `reduce 3' explicit:
655 # $end reduce using rule 3 (num)
656 # $end [reduce using rule 4 (id)]
657 # $default reduce using rule 3 (num)
659 # Maybe that's not the best display, but then, please propose something
662 AT_SETUP([Defaulted Conflicted Reduction])
663 AT_KEYWORDS([report])
673 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
674 [[input.y: conflicts: 1 reduce/reduce
675 input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
678 # Check the contents of the report.
679 AT_CHECK([cat input.output], [],
680 [[Rules useless in parser due to conflicts
685 State 1 conflicts: 1 reduce/reduce
700 Terminals, with rules where they appear
707 Nonterminals, with rules where they appear
712 on left: 1 2, on right: 0
714 on left: 3, on right: 1
716 on left: 4, on right: 2
721 0 $accept: . exp $end
727 '0' shift, and go to state 1
739 $end reduce using rule 3 (num)
740 $end [reduce using rule 4 (id)]
741 $default reduce using rule 3 (num)
746 0 $accept: exp . $end
748 $end shift, and go to state 5
755 $default reduce using rule 1 (exp)
762 $default reduce using rule 2 (exp)
767 0 $accept: exp $end .
777 ## -------------------- ##
778 ## %expect not enough. ##
779 ## -------------------- ##
781 AT_SETUP([%expect not enough])
787 exp: exp OP exp | NUM;
790 AT_BISON_CHECK([-o input.c input.y], 1, [],
791 [input.y: conflicts: 1 shift/reduce
792 input.y: expected 0 shift/reduce conflicts
797 ## --------------- ##
799 ## --------------- ##
801 AT_SETUP([%expect right])
807 exp: exp OP exp | NUM;
810 AT_BISON_CHECK([-o input.c input.y])
814 ## ------------------ ##
815 ## %expect too much. ##
816 ## ------------------ ##
818 AT_SETUP([%expect too much])
824 exp: exp OP exp | NUM;
827 AT_BISON_CHECK([-o input.c input.y], 1, [],
828 [input.y: conflicts: 1 shift/reduce
829 input.y: expected 2 shift/reduce conflicts
834 ## ------------------------------- ##
835 ## %expect with reduce conflicts. ##
836 ## ------------------------------- ##
838 AT_SETUP([%expect with reduce conflicts])
843 program: a 'a' | a a;
847 AT_BISON_CHECK([-o input.c input.y], 1, [],
848 [input.y: conflicts: 1 reduce/reduce
849 input.y: expected 0 reduce/reduce conflicts
854 ## ------------------------- ##
855 ## %prec with user strings. ##
856 ## ------------------------- ##
858 AT_SETUP([%prec with user string])
867 AT_BISON_CHECK([-o input.c input.y])
871 ## -------------------------------- ##
872 ## %no-default-prec without %prec. ##
873 ## -------------------------------- ##
875 AT_SETUP([%no-default-prec without %prec])
891 AT_BISON_CHECK([-o input.c input.y], 0, [],
892 [[input.y: conflicts: 4 shift/reduce
897 ## ----------------------------- ##
898 ## %no-default-prec with %prec. ##
899 ## ----------------------------- ##
901 AT_SETUP([%no-default-prec with %prec])
917 AT_BISON_CHECK([-o input.c input.y])
921 ## --------------- ##
923 ## --------------- ##
925 AT_SETUP([%default-prec])
941 AT_BISON_CHECK([-o input.c input.y])
945 ## ---------------------------------------------- ##
946 ## Unreachable States After Conflict Resolution. ##
947 ## ---------------------------------------------- ##
949 AT_SETUP([[Unreachable States After Conflict Resolution]])
951 # If conflict resolution makes states unreachable, remove those states, report
952 # rules that are then unused, and don't report conflicts in those states. Test
953 # what happens when a nonterminal becomes useless as a result of state removal
954 # since that causes lalr.o's goto map to be rewritten.
962 start: resolved_conflict 'a' reported_conflicts 'a' ;
964 /* S/R conflict resolved as reduce, so the state with item
965 * (resolved_conflict: 'a' . unreachable1) and all it transition successors are
966 * unreachable, and the associated production is useless. */
972 /* S/R conflict that need not be reported since it is unreachable because of
973 * the previous conflict resolution. Nonterminal unreachable1 and all its
974 * productions are useless. */
980 /* Likewise for a R/R conflict and nonterminal unreachable2. */
983 /* Make sure remaining S/R and R/R conflicts are still reported correctly even
984 * when their states are renumbered due to state removal. */
993 AT_BISON_CHECK([[--report=all input.y]], 0, [],
994 [[input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
995 input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
996 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
997 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
998 input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
999 input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
1000 input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
1001 input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
1004 AT_CHECK([[cat input.output]], 0,
1005 [[Rules useless in parser due to conflicts
1007 2 resolved_conflict: 'a' unreachable1
1009 4 unreachable1: 'a' unreachable2
1012 6 unreachable2: /* empty */
1015 9 reported_conflicts: 'a'
1019 State 4 conflicts: 1 shift/reduce
1020 State 5 conflicts: 1 reduce/reduce
1025 0 $accept: start $end
1027 1 start: resolved_conflict 'a' reported_conflicts 'a'
1029 2 resolved_conflict: 'a' unreachable1
1032 4 unreachable1: 'a' unreachable2
1035 6 unreachable2: /* empty */
1038 8 reported_conflicts: 'a'
1043 Terminals, with rules where they appear
1050 Nonterminals, with rules where they appear
1055 on left: 1, on right: 0
1056 resolved_conflict (6)
1057 on left: 2 3, on right: 1
1059 on left: 4 5, on right: 2
1061 on left: 6 7, on right: 4
1062 reported_conflicts (9)
1063 on left: 8 9 10, on right: 1
1068 0 $accept: . start $end
1069 1 start: . resolved_conflict 'a' reported_conflicts 'a'
1070 2 resolved_conflict: . 'a' unreachable1
1073 $default reduce using rule 3 (resolved_conflict)
1076 resolved_conflict go to state 2
1078 Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').
1083 0 $accept: start . $end
1085 $end shift, and go to state 3
1090 1 start: resolved_conflict . 'a' reported_conflicts 'a'
1092 'a' shift, and go to state 4
1097 0 $accept: start $end .
1104 1 start: resolved_conflict 'a' . reported_conflicts 'a'
1105 8 reported_conflicts: . 'a'
1109 'a' shift, and go to state 5
1111 'a' [reduce using rule 10 (reported_conflicts)]
1113 reported_conflicts go to state 6
1118 8 reported_conflicts: 'a' . ['a']
1121 'a' reduce using rule 8 (reported_conflicts)
1122 'a' [reduce using rule 9 (reported_conflicts)]
1123 $default reduce using rule 8 (reported_conflicts)
1128 1 start: resolved_conflict 'a' reported_conflicts . 'a'
1130 'a' shift, and go to state 7
1135 1 start: resolved_conflict 'a' reported_conflicts 'a' .
1137 $default reduce using rule 1 (start)
1140 AT_DATA([[input-keep.y]],
1141 [[%define lr.keep-unreachable-states
1143 AT_CHECK([[cat input.y >> input-keep.y]])
1145 AT_BISON_CHECK([[input-keep.y]], 0, [],
1146 [[input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
1147 input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
1148 input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
1149 input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
1150 input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
1156 ## ------------------------------------------------------------ ##
1157 ## Solved conflicts report for multiple reductions in a state. ##
1158 ## ------------------------------------------------------------ ##
1160 AT_SETUP([[Solved conflicts report for multiple reductions in a state]])
1162 # Used to lose earlier solved conflict messages even within a single S/R/R.
1164 AT_DATA([[input.y]],
1180 empty_a: %prec 'a' ;
1181 empty_b: %prec 'b' ;
1182 empty_c1: %prec 'c' ;
1183 empty_c2: %prec 'c' ;
1184 empty_c3: %prec 'd' ;
1186 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
1187 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
1190 0 $accept: . start $end
1203 13 empty_c3: . ['c']
1205 'b' shift, and go to state 1
1207 'c' reduce using rule 13 (empty_c3)
1208 $default reduce using rule 9 (empty_a)
1211 empty_a go to state 3
1212 empty_b go to state 4
1213 empty_c1 go to state 5
1214 empty_c2 go to state 6
1215 empty_c3 go to state 7
1217 Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
1218 Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
1219 Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
1220 Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
1221 Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').
1230 ## ------------------------------------------------------------ ##
1231 ## %nonassoc error actions for multiple reductions in a state. ##
1232 ## ------------------------------------------------------------ ##
1234 # Used to abort when trying to resolve conflicts as %nonassoc error actions for
1235 # multiple reductions in a state.
1237 # For a %nonassoc error action token, used to print the first remaining
1238 # reduction on that token without brackets.
1240 AT_SETUP([[%nonassoc error actions for multiple reductions in a state]])
1242 AT_DATA([[input.y]],
1243 [[%nonassoc 'a' 'b' 'c'
1255 empty_a: %prec 'a' ;
1256 empty_b: %prec 'b' ;
1257 empty_c1: %prec 'c' ;
1258 empty_c2: %prec 'c' ;
1259 empty_c3: %prec 'c' ;
1262 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
1263 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
1266 0 $accept: . start $end
1278 12 empty_c2: . ['c']
1279 13 empty_c3: . ['c']
1281 'a' error (nonassociative)
1282 'b' error (nonassociative)
1283 'c' error (nonassociative)
1285 'c' [reduce using rule 12 (empty_c2)]
1286 'c' [reduce using rule 13 (empty_c3)]
1289 empty_a go to state 2
1290 empty_b go to state 3
1291 empty_c1 go to state 4
1292 empty_c2 go to state 5
1293 empty_c3 go to state 6
1295 Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
1296 Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
1297 Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').