Merge branch 'branch-2.5'
[bison/ericb.git] / tests / conflicts.at
blob28a1c82c0fababee47c0e16ad8a1f5ddc361660c
1 # Exercising Bison on conflicts.                         -*- Autotest -*-
3 # Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 AT_BANNER([[Conflicts.]])
21 ## ---------------- ##
22 ## S/R in initial.  ##
23 ## ---------------- ##
25 # I once hacked Bison in such a way that it lost its reductions on the
26 # initial state (because it was confusing it with the last state).  It
27 # took me a while to strip down my failures to this simple case.  So
28 # make sure it finds the s/r conflict below.
30 AT_SETUP([S/R in initial])
32 AT_DATA([[input.y]],
33 [[%expect 1
35 exp: e 'e';
36 e: 'e' | /* Nothing. */;
37 ]])
39 AT_BISON_CHECK([-o input.c input.y], 0, [],
40 [[input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
41 ]])
43 AT_CLEANUP
46 ## ------------------- ##
47 ## %nonassoc and eof.  ##
48 ## ------------------- ##
50 AT_SETUP([%nonassoc and eof])
52 AT_DATA_GRAMMAR([input.y],
55 #include <stdio.h>
56 #include <stdlib.h>
57 #include <string.h>
59 #define YYERROR_VERBOSE 1
60 static void
61 yyerror (const char *msg)
63   fprintf (stderr, "%s\n", msg);
66 /* The current argument. */
67 static const char *input;
69 static int
70 yylex (void)
72   static size_t toknum;
73   if (! (toknum <= strlen (input)))
74     abort ();
75   return input[toknum++];
80 %nonassoc '<' '>'
83 expr: expr '<' expr
84     | expr '>' expr
85     | '0'
86     ;
88 int
89 main (int argc, const char *argv[])
91   input = argc <= 1 ? "" : argv[1];
92   return yyparse ();
94 ]])
96 # Specify the output files to avoid problems on different file systems.
97 AT_BISON_CHECK([-o input.c input.y])
98 AT_COMPILE([input])
100 AT_PARSER_CHECK([./input '0<0'])
101 # FIXME: This is an actual bug, but a new one, in the sense that
102 # no one has ever spotted it!  The messages are *wrong*: there should
103 # be nothing there, it should be expected eof.
104 AT_PARSER_CHECK([./input '0<0<0'], [1], [],
105          [syntax error, unexpected '<', expecting '<' or '>'
108 AT_PARSER_CHECK([./input '0>0'])
109 AT_PARSER_CHECK([./input '0>0>0'], [1], [],
110          [syntax error, unexpected '>', expecting '<' or '>'
113 AT_PARSER_CHECK([./input '0<0>0'], [1], [],
114          [syntax error, unexpected '>', expecting '<' or '>'
117 AT_CLEANUP
121 ## ------------------------- ##
122 ## Unresolved SR Conflicts.  ##
123 ## ------------------------- ##
125 AT_SETUP([Unresolved SR Conflicts])
127 AT_KEYWORDS([report])
129 AT_DATA([input.y],
130 [[%token NUM OP
132 exp: exp OP exp | NUM;
135 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
136 [input.y: conflicts: 1 shift/reduce
139 # Check the contents of the report.
140 AT_CHECK([cat input.output], [],
141 [[State 5 conflicts: 1 shift/reduce
144 Grammar
146     0 $accept: exp $end
148     1 exp: exp OP exp
149     2    | NUM
152 Terminals, with rules where they appear
154 $end (0) 0
155 error (256)
156 NUM (258) 2
157 OP (259) 1
160 Nonterminals, with rules where they appear
162 $accept (5)
163     on left: 0
164 exp (6)
165     on left: 1 2, on right: 0 1
168 state 0
170     0 $accept: . exp $end
171     1 exp: . exp OP exp
172     2    | . NUM
174     NUM  shift, and go to state 1
176     exp  go to state 2
179 state 1
181     2 exp: NUM .
183     $default  reduce using rule 2 (exp)
186 state 2
188     0 $accept: exp . $end
189     1 exp: exp . OP exp
191     $end  shift, and go to state 3
192     OP    shift, and go to state 4
195 state 3
197     0 $accept: exp $end .
199     $default  accept
202 state 4
204     1 exp: . exp OP exp
205     1    | exp OP . exp
206     2    | . NUM
208     NUM  shift, and go to state 1
210     exp  go to state 5
213 state 5
215     1 exp: exp . OP exp
216     1    | exp OP exp .  [$end, OP]
218     OP  shift, and go to state 4
220     OP        [reduce using rule 1 (exp)]
221     $default  reduce using rule 1 (exp)
224 AT_CLEANUP
228 ## ----------------------- ##
229 ## Resolved SR Conflicts.  ##
230 ## ----------------------- ##
232 AT_SETUP([Resolved SR Conflicts])
234 AT_KEYWORDS([report])
236 AT_DATA([input.y],
237 [[%token NUM OP
238 %left OP
240 exp: exp OP exp | NUM;
243 AT_BISON_CHECK([-o input.c --report=all input.y])
245 # Check the contents of the report.
246 AT_CHECK([cat input.output], [],
247 [[Grammar
249     0 $accept: exp $end
251     1 exp: exp OP exp
252     2    | NUM
255 Terminals, with rules where they appear
257 $end (0) 0
258 error (256)
259 NUM (258) 2
260 OP (259) 1
263 Nonterminals, with rules where they appear
265 $accept (5)
266     on left: 0
267 exp (6)
268     on left: 1 2, on right: 0 1
271 state 0
273     0 $accept: . exp $end
274     1 exp: . exp OP exp
275     2    | . NUM
277     NUM  shift, and go to state 1
279     exp  go to state 2
282 state 1
284     2 exp: NUM .
286     $default  reduce using rule 2 (exp)
289 state 2
291     0 $accept: exp . $end
292     1 exp: exp . OP exp
294     $end  shift, and go to state 3
295     OP    shift, and go to state 4
298 state 3
300     0 $accept: exp $end .
302     $default  accept
305 state 4
307     1 exp: . exp OP exp
308     1    | exp OP . exp
309     2    | . NUM
311     NUM  shift, and go to state 1
313     exp  go to state 5
316 state 5
318     1 exp: exp . OP exp
319     1    | exp OP exp .  [$end, OP]
321     $default  reduce using rule 1 (exp)
323     Conflict between rule 1 and token OP resolved as reduce (%left OP).
326 AT_CLEANUP
329 ## ---------------------- ##
330 ## %precedence suffices.  ##
331 ## ---------------------- ##
333 AT_SETUP([%precedence suffices])
335 AT_DATA([input.y],
336 [[%precedence "then"
337 %precedence "else"
339 stmt:
340   "if" cond "then" stmt
341 | "if" cond "then" stmt "else" stmt
342 | "stmt"
345 cond:
346   "exp"
350 AT_BISON_CHECK([-o input.c input.y])
352 AT_CLEANUP
355 ## ------------------------------ ##
356 ## %precedence does not suffice.  ##
357 ## ------------------------------ ##
359 AT_SETUP([%precedence does not suffice])
361 AT_DATA([input.y],
362 [[%precedence "then"
363 %precedence "else"
365 stmt:
366   "if" cond "then" stmt
367 | "if" cond "then" stmt "else" stmt
368 | "stmt"
371 cond:
372   "exp"
373 | cond "then" cond
377 AT_BISON_CHECK([-o input.c input.y], 0, [],
378 [[input.y: conflicts: 1 shift/reduce
379 input.y:12.3-18: warning: rule useless in parser due to conflicts: cond: cond "then" cond
382 AT_CLEANUP
385 ## -------------------------------- ##
386 ## Defaulted Conflicted Reduction.  ##
387 ## -------------------------------- ##
389 # When there are RR conflicts, some rules are disabled.  Usually it is
390 # simply displayed as:
392 #    $end           reduce using rule 3 (num)
393 #    $end           [reduce using rule 4 (id)]
395 # But when `reduce 3' is the default action, we'd produce:
397 #    $end           [reduce using rule 4 (id)]
398 #    $default    reduce using rule 3 (num)
400 # In this precise case (a reduction is masked by the default
401 # reduction), we make the `reduce 3' explicit:
403 #    $end           reduce using rule 3 (num)
404 #    $end           [reduce using rule 4 (id)]
405 #    $default    reduce using rule 3 (num)
407 # Maybe that's not the best display, but then, please propose something
408 # else.
410 AT_SETUP([Defaulted Conflicted Reduction])
411 AT_KEYWORDS([report])
413 AT_DATA([input.y],
414 [[%%
415 exp: num | id;
416 num: '0';
417 id : '0';
421 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
422 [[input.y: conflicts: 1 reduce/reduce
423 input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
426 # Check the contents of the report.
427 AT_CHECK([cat input.output], [],
428 [[Rules useless in parser due to conflicts
430     4 id: '0'
433 State 1 conflicts: 1 reduce/reduce
436 Grammar
438     0 $accept: exp $end
440     1 exp: num
441     2    | id
443     3 num: '0'
445     4 id: '0'
448 Terminals, with rules where they appear
450 $end (0) 0
451 '0' (48) 3 4
452 error (256)
455 Nonterminals, with rules where they appear
457 $accept (4)
458     on left: 0
459 exp (5)
460     on left: 1 2, on right: 0
461 num (6)
462     on left: 3, on right: 1
463 id (7)
464     on left: 4, on right: 2
467 state 0
469     0 $accept: . exp $end
470     1 exp: . num
471     2    | . id
472     3 num: . '0'
473     4 id: . '0'
475     '0'  shift, and go to state 1
477     exp  go to state 2
478     num  go to state 3
479     id   go to state 4
482 state 1
484     3 num: '0' .  [$end]
485     4 id: '0' .  [$end]
487     $end      reduce using rule 3 (num)
488     $end      [reduce using rule 4 (id)]
489     $default  reduce using rule 3 (num)
492 state 2
494     0 $accept: exp . $end
496     $end  shift, and go to state 5
499 state 3
501     1 exp: num .
503     $default  reduce using rule 1 (exp)
506 state 4
508     2 exp: id .
510     $default  reduce using rule 2 (exp)
513 state 5
515     0 $accept: exp $end .
517     $default  accept
520 AT_CLEANUP
525 ## -------------------- ##
526 ## %expect not enough.  ##
527 ## -------------------- ##
529 AT_SETUP([%expect not enough])
531 AT_DATA([input.y],
532 [[%token NUM OP
533 %expect 0
535 exp: exp OP exp | NUM;
538 AT_BISON_CHECK([-o input.c input.y], 1, [],
539 [input.y: conflicts: 1 shift/reduce
540 input.y: expected 0 shift/reduce conflicts
542 AT_CLEANUP
545 ## --------------- ##
546 ## %expect right.  ##
547 ## --------------- ##
549 AT_SETUP([%expect right])
551 AT_DATA([input.y],
552 [[%token NUM OP
553 %expect 1
555 exp: exp OP exp | NUM;
558 AT_BISON_CHECK([-o input.c input.y])
559 AT_CLEANUP
562 ## ------------------ ##
563 ## %expect too much.  ##
564 ## ------------------ ##
566 AT_SETUP([%expect too much])
568 AT_DATA([input.y],
569 [[%token NUM OP
570 %expect 2
572 exp: exp OP exp | NUM;
575 AT_BISON_CHECK([-o input.c input.y], 1, [],
576 [input.y: conflicts: 1 shift/reduce
577 input.y: expected 2 shift/reduce conflicts
579 AT_CLEANUP
582 ## ------------------------------ ##
583 ## %expect with reduce conflicts  ##
584 ## ------------------------------ ##
586 AT_SETUP([%expect with reduce conflicts])
588 AT_DATA([input.y],
589 [[%expect 0
591 program: a 'a' | a a;
592 a: 'a';
595 AT_BISON_CHECK([-o input.c input.y], 1, [],
596 [input.y: conflicts: 1 reduce/reduce
597 input.y: expected 0 reduce/reduce conflicts
599 AT_CLEANUP
602 ## ------------------------------- ##
603 ## %no-default-prec without %prec  ##
604 ## ------------------------------- ##
606 AT_SETUP([%no-default-prec without %prec])
608 AT_DATA([[input.y]],
609 [[%left '+'
610 %left '*'
614 %no-default-prec;
616 e:   e '+' e
617    | e '*' e
618    | '0'
619    ;
622 AT_BISON_CHECK([-o input.c input.y], 0, [],
623 [[input.y: conflicts: 4 shift/reduce
625 AT_CLEANUP
628 ## ---------------------------- ##
629 ## %no-default-prec with %prec  ##
630 ## ---------------------------- ##
632 AT_SETUP([%no-default-prec with %prec])
634 AT_DATA([[input.y]],
635 [[%left '+'
636 %left '*'
640 %no-default-prec;
642 e:   e '+' e %prec '+'
643    | e '*' e %prec '*'
644    | '0'
645    ;
648 AT_BISON_CHECK([-o input.c input.y])
649 AT_CLEANUP
652 ## ---------------- ##
653 ## %default-prec    ##
654 ## ---------------- ##
656 AT_SETUP([%default-prec])
658 AT_DATA([[input.y]],
659 [[%left '+'
660 %left '*'
664 %default-prec;
666 e:   e '+' e
667    | e '*' e
668    | '0'
669    ;
672 AT_BISON_CHECK([-o input.c input.y])
673 AT_CLEANUP
676 ## ---------------------------------------------- ##
677 ## Unreachable States After Conflict Resolution.  ##
678 ## ---------------------------------------------- ##
680 AT_SETUP([[Unreachable States After Conflict Resolution]])
682 # If conflict resolution makes states unreachable, remove those states, report
683 # rules that are then unused, and don't report conflicts in those states.  Test
684 # what happens when a nonterminal becomes useless as a result of state removal
685 # since that causes lalr.o's goto map to be rewritten.
687 AT_DATA([[input.y]],
688 [[%output "input.c"
689 %left 'a'
693 start: resolved_conflict 'a' reported_conflicts 'a' ;
695 /* S/R conflict resolved as reduce, so the state with item
696  * (resolved_conflict: 'a' . unreachable1) and all it transition successors are
697  * unreachable, and the associated production is useless.  */
698 resolved_conflict:
699     'a' unreachable1
700   | %prec 'a'
701   ;
703 /* S/R conflict that need not be reported since it is unreachable because of
704  * the previous conflict resolution.  Nonterminal unreachable1 and all its
705  * productions are useless.  */
706 unreachable1:
707     'a' unreachable2
708   |
709   ;
711 /* Likewise for a R/R conflict and nonterminal unreachable2.  */
712 unreachable2: | ;
714 /* Make sure remaining S/R and R/R conflicts are still reported correctly even
715  * when their states are renumbered due to state removal.  */
716 reported_conflicts:
717     'a'
718   | 'a'
719   |
720   ;
724 AT_BISON_CHECK([[--report=all input.y]], 0, [],
725 [[input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
726 input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
727 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
728 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
729 input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
730 input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
731 input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
732 input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
735 AT_CHECK([[cat input.output]], 0,
736 [[Rules useless in parser due to conflicts
738     2 resolved_conflict: 'a' unreachable1
740     4 unreachable1: 'a' unreachable2
741     5             | /* empty */
743     6 unreachable2: /* empty */
744     7             | /* empty */
746     9 reported_conflicts: 'a'
747    10                   | /* empty */
750 State 4 conflicts: 1 shift/reduce
751 State 5 conflicts: 1 reduce/reduce
754 Grammar
756     0 $accept: start $end
758     1 start: resolved_conflict 'a' reported_conflicts 'a'
760     2 resolved_conflict: 'a' unreachable1
761     3                  | /* empty */
763     4 unreachable1: 'a' unreachable2
764     5             | /* empty */
766     6 unreachable2: /* empty */
767     7             | /* empty */
769     8 reported_conflicts: 'a'
770     9                   | 'a'
771    10                   | /* empty */
774 Terminals, with rules where they appear
776 $end (0) 0
777 'a' (97) 1 2 4 8 9
778 error (256)
781 Nonterminals, with rules where they appear
783 $accept (4)
784     on left: 0
785 start (5)
786     on left: 1, on right: 0
787 resolved_conflict (6)
788     on left: 2 3, on right: 1
789 unreachable1 (7)
790     on left: 4 5, on right: 2
791 unreachable2 (8)
792     on left: 6 7, on right: 4
793 reported_conflicts (9)
794     on left: 8 9 10, on right: 1
797 state 0
799     0 $accept: . start $end
800     1 start: . resolved_conflict 'a' reported_conflicts 'a'
801     2 resolved_conflict: . 'a' unreachable1
802     3                  | .  ['a']
804     $default  reduce using rule 3 (resolved_conflict)
806     start              go to state 1
807     resolved_conflict  go to state 2
809     Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').
812 state 1
814     0 $accept: start . $end
816     $end  shift, and go to state 3
819 state 2
821     1 start: resolved_conflict . 'a' reported_conflicts 'a'
823     'a'  shift, and go to state 4
826 state 3
828     0 $accept: start $end .
830     $default  accept
833 state 4
835     1 start: resolved_conflict 'a' . reported_conflicts 'a'
836     8 reported_conflicts: . 'a'
837     9                   | . 'a'
838    10                   | .  ['a']
840     'a'  shift, and go to state 5
842     'a'  [reduce using rule 10 (reported_conflicts)]
844     reported_conflicts  go to state 6
847 state 5
849     8 reported_conflicts: 'a' .  ['a']
850     9                   | 'a' .  ['a']
852     'a'       reduce using rule 8 (reported_conflicts)
853     'a'       [reduce using rule 9 (reported_conflicts)]
854     $default  reduce using rule 8 (reported_conflicts)
857 state 6
859     1 start: resolved_conflict 'a' reported_conflicts . 'a'
861     'a'  shift, and go to state 7
864 state 7
866     1 start: resolved_conflict 'a' reported_conflicts 'a' .
868     $default  reduce using rule 1 (start)
871 AT_DATA([[input-keep.y]],
872 [[%define lr.keep_unreachable_states
874 AT_CHECK([[cat input.y >> input-keep.y]])
876 AT_BISON_CHECK([[input-keep.y]], 0, [],
877 [[input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
878 input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
879 input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
880 input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
881 input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
884 AT_CLEANUP
887 ## ------------------------------------------------------------ ##
888 ## Solved conflicts report for multiple reductions in a state.  ##
889 ## ------------------------------------------------------------ ##
891 AT_SETUP([[Solved conflicts report for multiple reductions in a state]])
893 # Used to lose earlier solved conflict messages even within a single S/R/R.
895 AT_DATA([[input.y]],
896 [[%left 'a'
897 %right 'b'
898 %right 'c'
899 %right 'd'
901 start:
902     'a'
903   | empty_a 'a'
904   | 'b'
905   | empty_b 'b'
906   | 'c'
907   | empty_c1 'c'
908   | empty_c2 'c'
909   | empty_c3 'c'
910   ;
911 empty_a: %prec 'a' ;
912 empty_b: %prec 'b' ;
913 empty_c1: %prec 'c' ;
914 empty_c2: %prec 'c' ;
915 empty_c3: %prec 'd' ;
917 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
918 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
919 [[state 0
921     0 $accept: . start $end
922     1 start: . 'a'
923     2      | . empty_a 'a'
924     3      | . 'b'
925     4      | . empty_b 'b'
926     5      | . 'c'
927     6      | . empty_c1 'c'
928     7      | . empty_c2 'c'
929     8      | . empty_c3 'c'
930     9 empty_a: .  ['a']
931    10 empty_b: .  []
932    11 empty_c1: .  []
933    12 empty_c2: .  []
934    13 empty_c3: .  ['c']
936     'b'  shift, and go to state 1
938     'c'       reduce using rule 13 (empty_c3)
939     $default  reduce using rule 9 (empty_a)
941     start     go to state 2
942     empty_a   go to state 3
943     empty_b   go to state 4
944     empty_c1  go to state 5
945     empty_c2  go to state 6
946     empty_c3  go to state 7
948     Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
949     Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
950     Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
951     Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
952     Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').
955 state 1
958 AT_CLEANUP
961 ## ------------------------------------------------------------ ##
962 ## %nonassoc error actions for multiple reductions in a state.  ##
963 ## ------------------------------------------------------------ ##
965 # Used to abort when trying to resolve conflicts as %nonassoc error actions for
966 # multiple reductions in a state.
968 # For a %nonassoc error action token, used to print the first remaining
969 # reduction on that token without brackets.
971 AT_SETUP([[%nonassoc error actions for multiple reductions in a state]])
973 AT_DATA([[input.y]],
974 [[%nonassoc 'a' 'b' 'c'
976 start:
977     'a'
978   | empty_a 'a'
979   | 'b'
980   | empty_b 'b'
981   | 'c'
982   | empty_c1 'c'
983   | empty_c2 'c'
984   | empty_c3 'c'
985   ;
986 empty_a: %prec 'a' ;
987 empty_b: %prec 'b' ;
988 empty_c1: %prec 'c' ;
989 empty_c2: %prec 'c' ;
990 empty_c3: %prec 'c' ;
993 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
994 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
995 [[state 0
997     0 $accept: . start $end
998     1 start: . 'a'
999     2      | . empty_a 'a'
1000     3      | . 'b'
1001     4      | . empty_b 'b'
1002     5      | . 'c'
1003     6      | . empty_c1 'c'
1004     7      | . empty_c2 'c'
1005     8      | . empty_c3 'c'
1006     9 empty_a: .  []
1007    10 empty_b: .  []
1008    11 empty_c1: .  []
1009    12 empty_c2: .  ['c']
1010    13 empty_c3: .  ['c']
1012     'a'  error (nonassociative)
1013     'b'  error (nonassociative)
1014     'c'  error (nonassociative)
1016     'c'  [reduce using rule 12 (empty_c2)]
1017     'c'  [reduce using rule 13 (empty_c3)]
1019     start     go to state 1
1020     empty_a   go to state 2
1021     empty_b   go to state 3
1022     empty_c1  go to state 4
1023     empty_c2  go to state 5
1024     empty_c3  go to state 6
1026     Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
1027     Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
1028     Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').
1031 state 1
1033 AT_CLEANUP