]> git.saurik.com Git - bison.git/blob - tests/conflicts.at
tests: check token numbers.
[bison.git] / tests / conflicts.at
1 # Exercising Bison on conflicts. -*- Autotest -*-
2
3 # Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software
4 # Foundation, Inc.
5
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.
10 #
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.
15 #
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/>.
18
19 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_BISON_CHECK([-o input.c input.y], 0, [],
41 [[input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
42 ]])
43
44 AT_CLEANUP
45
46
47 ## ------------------- ##
48 ## %nonassoc and eof. ##
49 ## ------------------- ##
50
51 AT_SETUP([%nonassoc and eof])
52
53 AT_DATA_GRAMMAR([input.y],
54 [[
55 %{
56 #include <stdio.h>
57 #include <stdlib.h>
58 #include <string.h>
59
60 #define YYERROR_VERBOSE 1
61 static void
62 yyerror (const char *msg)
63 {
64 fprintf (stderr, "%s\n", msg);
65 }
66
67 /* The current argument. */
68 static const char *input;
69
70 static int
71 yylex (void)
72 {
73 static size_t toknum;
74 if (! (toknum <= strlen (input)))
75 abort ();
76 return input[toknum++];
77 }
78
79 %}
80
81 %nonassoc '<' '>'
82
83 %%
84 expr: expr '<' expr
85 | expr '>' expr
86 | '0'
87 ;
88 %%
89 int
90 main (int argc, const char *argv[])
91 {
92 input = argc <= 1 ? "" : argv[1];
93 return yyparse ();
94 }
95 ]])
96
97 # Specify the output files to avoid problems on different file systems.
98 AT_BISON_CHECK([-o input.c input.y])
99 AT_COMPILE([input])
100
101 AT_PARSER_CHECK([./input '0<0'])
102 # FIXME: This is an actual bug, but a new one, in the sense that
103 # no one has ever spotted it! The messages are *wrong*: there should
104 # be nothing there, it should be expected eof.
105 AT_PARSER_CHECK([./input '0<0<0'], [1], [],
106 [syntax error, unexpected '<', expecting '<' or '>'
107 ])
108
109 AT_PARSER_CHECK([./input '0>0'])
110 AT_PARSER_CHECK([./input '0>0>0'], [1], [],
111 [syntax error, unexpected '>', expecting '<' or '>'
112 ])
113
114 AT_PARSER_CHECK([./input '0<0>0'], [1], [],
115 [syntax error, unexpected '>', expecting '<' or '>'
116 ])
117
118 AT_CLEANUP
119
120
121
122 ## ------------------------- ##
123 ## Unresolved SR Conflicts. ##
124 ## ------------------------- ##
125
126 AT_SETUP([Unresolved SR Conflicts])
127
128 AT_KEYWORDS([report])
129
130 AT_DATA([input.y],
131 [[%token NUM OP
132 %%
133 exp: exp OP exp | NUM;
134 ]])
135
136 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
137 [input.y: conflicts: 1 shift/reduce
138 ])
139
140 # Check the contents of the report.
141 AT_CHECK([cat input.output], [],
142 [[State 5 conflicts: 1 shift/reduce
143
144
145 Grammar
146
147 0 $accept: exp $end
148
149 1 exp: exp OP exp
150 2 | NUM
151
152
153 Terminals, with rules where they appear
154
155 $end (0) 0
156 error (256)
157 NUM (258) 2
158 OP (259) 1
159
160
161 Nonterminals, with rules where they appear
162
163 $accept (5)
164 on left: 0
165 exp (6)
166 on left: 1 2, on right: 0 1
167
168
169 state 0
170
171 0 $accept: . exp $end
172 1 exp: . exp OP exp
173 2 | . NUM
174
175 NUM shift, and go to state 1
176
177 exp go to state 2
178
179
180 state 1
181
182 2 exp: NUM .
183
184 $default reduce using rule 2 (exp)
185
186
187 state 2
188
189 0 $accept: exp . $end
190 1 exp: exp . OP exp
191
192 $end shift, and go to state 3
193 OP shift, and go to state 4
194
195
196 state 3
197
198 0 $accept: exp $end .
199
200 $default accept
201
202
203 state 4
204
205 1 exp: . exp OP exp
206 1 | exp OP . exp
207 2 | . NUM
208
209 NUM shift, and go to state 1
210
211 exp go to state 5
212
213
214 state 5
215
216 1 exp: exp . OP exp
217 1 | exp OP exp . [$end, OP]
218
219 OP shift, and go to state 4
220
221 OP [reduce using rule 1 (exp)]
222 $default reduce using rule 1 (exp)
223 ]])
224
225 AT_CLEANUP
226
227
228
229 ## ----------------------- ##
230 ## Resolved SR Conflicts. ##
231 ## ----------------------- ##
232
233 AT_SETUP([Resolved SR Conflicts])
234
235 AT_KEYWORDS([report])
236
237 AT_DATA([input.y],
238 [[%token NUM OP
239 %left OP
240 %%
241 exp: exp OP exp | NUM;
242 ]])
243
244 AT_BISON_CHECK([-o input.c --report=all input.y])
245
246 # Check the contents of the report.
247 AT_CHECK([cat input.output], [],
248 [[Grammar
249
250 0 $accept: exp $end
251
252 1 exp: exp OP exp
253 2 | NUM
254
255
256 Terminals, with rules where they appear
257
258 $end (0) 0
259 error (256)
260 NUM (258) 2
261 OP (259) 1
262
263
264 Nonterminals, with rules where they appear
265
266 $accept (5)
267 on left: 0
268 exp (6)
269 on left: 1 2, on right: 0 1
270
271
272 state 0
273
274 0 $accept: . exp $end
275 1 exp: . exp OP exp
276 2 | . NUM
277
278 NUM shift, and go to state 1
279
280 exp go to state 2
281
282
283 state 1
284
285 2 exp: NUM .
286
287 $default reduce using rule 2 (exp)
288
289
290 state 2
291
292 0 $accept: exp . $end
293 1 exp: exp . OP exp
294
295 $end shift, and go to state 3
296 OP shift, and go to state 4
297
298
299 state 3
300
301 0 $accept: exp $end .
302
303 $default accept
304
305
306 state 4
307
308 1 exp: . exp OP exp
309 1 | exp OP . exp
310 2 | . NUM
311
312 NUM shift, and go to state 1
313
314 exp go to state 5
315
316
317 state 5
318
319 1 exp: exp . OP exp
320 1 | exp OP exp . [$end, OP]
321
322 $default reduce using rule 1 (exp)
323
324 Conflict between rule 1 and token OP resolved as reduce (%left OP).
325 ]])
326
327 AT_CLEANUP
328
329
330 ## -------------------------------- ##
331 ## Defaulted Conflicted Reduction. ##
332 ## -------------------------------- ##
333
334 # When there are RR conflicts, some rules are disabled. Usually it is
335 # simply displayed as:
336 #
337 # $end reduce using rule 3 (num)
338 # $end [reduce using rule 4 (id)]
339 #
340 # But when `reduce 3' is the default action, we'd produce:
341 #
342 # $end [reduce using rule 4 (id)]
343 # $default reduce using rule 3 (num)
344 #
345 # In this precise case (a reduction is masked by the default
346 # reduction), we make the `reduce 3' explicit:
347 #
348 # $end reduce using rule 3 (num)
349 # $end [reduce using rule 4 (id)]
350 # $default reduce using rule 3 (num)
351 #
352 # Maybe that's not the best display, but then, please propose something
353 # else.
354
355 AT_SETUP([Defaulted Conflicted Reduction])
356 AT_KEYWORDS([report])
357
358 AT_DATA([input.y],
359 [[%%
360 exp: num | id;
361 num: '0';
362 id : '0';
363 %%
364 ]])
365
366 AT_BISON_CHECK([-o input.c --report=all input.y], 0, [],
367 [[input.y: conflicts: 1 reduce/reduce
368 input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
369 ]])
370
371 # Check the contents of the report.
372 AT_CHECK([cat input.output], [],
373 [[Rules useless in parser due to conflicts
374
375 4 id: '0'
376
377
378 State 1 conflicts: 1 reduce/reduce
379
380
381 Grammar
382
383 0 $accept: exp $end
384
385 1 exp: num
386 2 | id
387
388 3 num: '0'
389
390 4 id: '0'
391
392
393 Terminals, with rules where they appear
394
395 $end (0) 0
396 '0' (48) 3 4
397 error (256)
398
399
400 Nonterminals, with rules where they appear
401
402 $accept (4)
403 on left: 0
404 exp (5)
405 on left: 1 2, on right: 0
406 num (6)
407 on left: 3, on right: 1
408 id (7)
409 on left: 4, on right: 2
410
411
412 state 0
413
414 0 $accept: . exp $end
415 1 exp: . num
416 2 | . id
417 3 num: . '0'
418 4 id: . '0'
419
420 '0' shift, and go to state 1
421
422 exp go to state 2
423 num go to state 3
424 id go to state 4
425
426
427 state 1
428
429 3 num: '0' . [$end]
430 4 id: '0' . [$end]
431
432 $end reduce using rule 3 (num)
433 $end [reduce using rule 4 (id)]
434 $default reduce using rule 3 (num)
435
436
437 state 2
438
439 0 $accept: exp . $end
440
441 $end shift, and go to state 5
442
443
444 state 3
445
446 1 exp: num .
447
448 $default reduce using rule 1 (exp)
449
450
451 state 4
452
453 2 exp: id .
454
455 $default reduce using rule 2 (exp)
456
457
458 state 5
459
460 0 $accept: exp $end .
461
462 $default accept
463 ]])
464
465 AT_CLEANUP
466
467
468
469
470 ## -------------------- ##
471 ## %expect not enough. ##
472 ## -------------------- ##
473
474 AT_SETUP([%expect not enough])
475
476 AT_DATA([input.y],
477 [[%token NUM OP
478 %expect 0
479 %%
480 exp: exp OP exp | NUM;
481 ]])
482
483 AT_BISON_CHECK([-o input.c input.y], 1, [],
484 [input.y: conflicts: 1 shift/reduce
485 input.y: expected 0 shift/reduce conflicts
486 ])
487 AT_CLEANUP
488
489
490 ## --------------- ##
491 ## %expect right. ##
492 ## --------------- ##
493
494 AT_SETUP([%expect right])
495
496 AT_DATA([input.y],
497 [[%token NUM OP
498 %expect 1
499 %%
500 exp: exp OP exp | NUM;
501 ]])
502
503 AT_BISON_CHECK([-o input.c input.y])
504 AT_CLEANUP
505
506
507 ## ------------------ ##
508 ## %expect too much. ##
509 ## ------------------ ##
510
511 AT_SETUP([%expect too much])
512
513 AT_DATA([input.y],
514 [[%token NUM OP
515 %expect 2
516 %%
517 exp: exp OP exp | NUM;
518 ]])
519
520 AT_BISON_CHECK([-o input.c input.y], 1, [],
521 [input.y: conflicts: 1 shift/reduce
522 input.y: expected 2 shift/reduce conflicts
523 ])
524 AT_CLEANUP
525
526
527 ## ------------------------------ ##
528 ## %expect with reduce conflicts ##
529 ## ------------------------------ ##
530
531 AT_SETUP([%expect with reduce conflicts])
532
533 AT_DATA([input.y],
534 [[%expect 0
535 %%
536 program: a 'a' | a a;
537 a: 'a';
538 ]])
539
540 AT_BISON_CHECK([-o input.c input.y], 1, [],
541 [input.y: conflicts: 1 reduce/reduce
542 input.y: expected 0 reduce/reduce conflicts
543 ])
544 AT_CLEANUP
545
546
547 ## ------------------------------- ##
548 ## %no-default-prec without %prec ##
549 ## ------------------------------- ##
550
551 AT_SETUP([%no-default-prec without %prec])
552
553 AT_DATA([[input.y]],
554 [[%left '+'
555 %left '*'
556
557 %%
558
559 %no-default-prec;
560
561 e: e '+' e
562 | e '*' e
563 | '0'
564 ;
565 ]])
566
567 AT_BISON_CHECK([-o input.c input.y], 0, [],
568 [[input.y: conflicts: 4 shift/reduce
569 ]])
570 AT_CLEANUP
571
572
573 ## ---------------------------- ##
574 ## %no-default-prec with %prec ##
575 ## ---------------------------- ##
576
577 AT_SETUP([%no-default-prec with %prec])
578
579 AT_DATA([[input.y]],
580 [[%left '+'
581 %left '*'
582
583 %%
584
585 %no-default-prec;
586
587 e: e '+' e %prec '+'
588 | e '*' e %prec '*'
589 | '0'
590 ;
591 ]])
592
593 AT_BISON_CHECK([-o input.c input.y])
594 AT_CLEANUP
595
596
597 ## ---------------- ##
598 ## %default-prec ##
599 ## ---------------- ##
600
601 AT_SETUP([%default-prec])
602
603 AT_DATA([[input.y]],
604 [[%left '+'
605 %left '*'
606
607 %%
608
609 %default-prec;
610
611 e: e '+' e
612 | e '*' e
613 | '0'
614 ;
615 ]])
616
617 AT_BISON_CHECK([-o input.c input.y])
618 AT_CLEANUP
619
620
621 ## ---------------------------------------------- ##
622 ## Unreachable States After Conflict Resolution. ##
623 ## ---------------------------------------------- ##
624
625 AT_SETUP([[Unreachable States After Conflict Resolution]])
626
627 # If conflict resolution makes states unreachable, remove those states, report
628 # rules that are then unused, and don't report conflicts in those states. Test
629 # what happens when a nonterminal becomes useless as a result of state removal
630 # since that causes lalr.o's goto map to be rewritten.
631
632 AT_DATA([[input.y]],
633 [[%output "input.c"
634 %left 'a'
635
636 %%
637
638 start: resolved_conflict 'a' reported_conflicts 'a' ;
639
640 /* S/R conflict resolved as reduce, so the state with item
641 * (resolved_conflict: 'a' . unreachable1) and all it transition successors are
642 * unreachable, and the associated production is useless. */
643 resolved_conflict:
644 'a' unreachable1
645 | %prec 'a'
646 ;
647
648 /* S/R conflict that need not be reported since it is unreachable because of
649 * the previous conflict resolution. Nonterminal unreachable1 and all its
650 * productions are useless. */
651 unreachable1:
652 'a' unreachable2
653 |
654 ;
655
656 /* Likewise for a R/R conflict and nonterminal unreachable2. */
657 unreachable2: | ;
658
659 /* Make sure remaining S/R and R/R conflicts are still reported correctly even
660 * when their states are renumbered due to state removal. */
661 reported_conflicts:
662 'a'
663 | 'a'
664 |
665 ;
666
667 ]])
668
669 AT_BISON_CHECK([[--report=all input.y]], 0, [],
670 [[input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
671 input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
672 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
673 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
674 input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
675 input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
676 input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
677 input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
678 ]])
679
680 AT_CHECK([[cat input.output]], 0,
681 [[Rules useless in parser due to conflicts
682
683 2 resolved_conflict: 'a' unreachable1
684
685 4 unreachable1: 'a' unreachable2
686 5 | /* empty */
687
688 6 unreachable2: /* empty */
689 7 | /* empty */
690
691 9 reported_conflicts: 'a'
692 10 | /* empty */
693
694
695 State 4 conflicts: 1 shift/reduce
696 State 5 conflicts: 1 reduce/reduce
697
698
699 Grammar
700
701 0 $accept: start $end
702
703 1 start: resolved_conflict 'a' reported_conflicts 'a'
704
705 2 resolved_conflict: 'a' unreachable1
706 3 | /* empty */
707
708 4 unreachable1: 'a' unreachable2
709 5 | /* empty */
710
711 6 unreachable2: /* empty */
712 7 | /* empty */
713
714 8 reported_conflicts: 'a'
715 9 | 'a'
716 10 | /* empty */
717
718
719 Terminals, with rules where they appear
720
721 $end (0) 0
722 'a' (97) 1 2 4 8 9
723 error (256)
724
725
726 Nonterminals, with rules where they appear
727
728 $accept (4)
729 on left: 0
730 start (5)
731 on left: 1, on right: 0
732 resolved_conflict (6)
733 on left: 2 3, on right: 1
734 unreachable1 (7)
735 on left: 4 5, on right: 2
736 unreachable2 (8)
737 on left: 6 7, on right: 4
738 reported_conflicts (9)
739 on left: 8 9 10, on right: 1
740
741
742 state 0
743
744 0 $accept: . start $end
745 1 start: . resolved_conflict 'a' reported_conflicts 'a'
746 2 resolved_conflict: . 'a' unreachable1
747 3 | . ['a']
748
749 $default reduce using rule 3 (resolved_conflict)
750
751 start go to state 1
752 resolved_conflict go to state 2
753
754 Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').
755
756
757 state 1
758
759 0 $accept: start . $end
760
761 $end shift, and go to state 3
762
763
764 state 2
765
766 1 start: resolved_conflict . 'a' reported_conflicts 'a'
767
768 'a' shift, and go to state 4
769
770
771 state 3
772
773 0 $accept: start $end .
774
775 $default accept
776
777
778 state 4
779
780 1 start: resolved_conflict 'a' . reported_conflicts 'a'
781 8 reported_conflicts: . 'a'
782 9 | . 'a'
783 10 | . ['a']
784
785 'a' shift, and go to state 5
786
787 'a' [reduce using rule 10 (reported_conflicts)]
788
789 reported_conflicts go to state 6
790
791
792 state 5
793
794 8 reported_conflicts: 'a' . ['a']
795 9 | 'a' . ['a']
796
797 'a' reduce using rule 8 (reported_conflicts)
798 'a' [reduce using rule 9 (reported_conflicts)]
799 $default reduce using rule 8 (reported_conflicts)
800
801
802 state 6
803
804 1 start: resolved_conflict 'a' reported_conflicts . 'a'
805
806 'a' shift, and go to state 7
807
808
809 state 7
810
811 1 start: resolved_conflict 'a' reported_conflicts 'a' .
812
813 $default reduce using rule 1 (start)
814 ]])
815
816 AT_DATA([[input-keep.y]],
817 [[%define lr.keep-unreachable-states
818 ]])
819 AT_CHECK([[cat input.y >> input-keep.y]])
820
821 AT_BISON_CHECK([[input-keep.y]], 0, [],
822 [[input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
823 input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
824 input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
825 input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
826 input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
827 ]])
828
829 AT_CLEANUP
830
831
832 ## ------------------------------------------------------------ ##
833 ## Solved conflicts report for multiple reductions in a state. ##
834 ## ------------------------------------------------------------ ##
835
836 AT_SETUP([[Solved conflicts report for multiple reductions in a state]])
837
838 # Used to lose earlier solved conflict messages even within a single S/R/R.
839
840 AT_DATA([[input.y]],
841 [[%left 'a'
842 %right 'b'
843 %right 'c'
844 %right 'd'
845 %%
846 start:
847 'a'
848 | empty_a 'a'
849 | 'b'
850 | empty_b 'b'
851 | 'c'
852 | empty_c1 'c'
853 | empty_c2 'c'
854 | empty_c3 'c'
855 ;
856 empty_a: %prec 'a' ;
857 empty_b: %prec 'b' ;
858 empty_c1: %prec 'c' ;
859 empty_c2: %prec 'c' ;
860 empty_c3: %prec 'd' ;
861 ]])
862 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
863 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
864 [[state 0
865
866 0 $accept: . start $end
867 1 start: . 'a'
868 2 | . empty_a 'a'
869 3 | . 'b'
870 4 | . empty_b 'b'
871 5 | . 'c'
872 6 | . empty_c1 'c'
873 7 | . empty_c2 'c'
874 8 | . empty_c3 'c'
875 9 empty_a: . ['a']
876 10 empty_b: . []
877 11 empty_c1: . []
878 12 empty_c2: . []
879 13 empty_c3: . ['c']
880
881 'b' shift, and go to state 1
882
883 'c' reduce using rule 13 (empty_c3)
884 $default reduce using rule 9 (empty_a)
885
886 start go to state 2
887 empty_a go to state 3
888 empty_b go to state 4
889 empty_c1 go to state 5
890 empty_c2 go to state 6
891 empty_c3 go to state 7
892
893 Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
894 Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
895 Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
896 Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
897 Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').
898
899
900 state 1
901 ]])
902
903 AT_CLEANUP
904
905
906 ## ------------------------------------------------------------ ##
907 ## %nonassoc error actions for multiple reductions in a state. ##
908 ## ------------------------------------------------------------ ##
909
910 # Used to abort when trying to resolve conflicts as %nonassoc error actions for
911 # multiple reductions in a state.
912
913 # For a %nonassoc error action token, used to print the first remaining
914 # reduction on that token without brackets.
915
916 AT_SETUP([[%nonassoc error actions for multiple reductions in a state]])
917
918 AT_DATA([[input.y]],
919 [[%nonassoc 'a' 'b' 'c'
920 %%
921 start:
922 'a'
923 | empty_a 'a'
924 | 'b'
925 | empty_b 'b'
926 | 'c'
927 | empty_c1 'c'
928 | empty_c2 'c'
929 | empty_c3 'c'
930 ;
931 empty_a: %prec 'a' ;
932 empty_b: %prec 'b' ;
933 empty_c1: %prec 'c' ;
934 empty_c2: %prec 'c' ;
935 empty_c3: %prec 'c' ;
936 ]])
937
938 AT_BISON_CHECK([[--report=all -o input.c input.y]], 0, [], [ignore])
939 AT_CHECK([[cat input.output | sed -n '/^state 0$/,/^state 1$/p']], 0,
940 [[state 0
941
942 0 $accept: . start $end
943 1 start: . 'a'
944 2 | . empty_a 'a'
945 3 | . 'b'
946 4 | . empty_b 'b'
947 5 | . 'c'
948 6 | . empty_c1 'c'
949 7 | . empty_c2 'c'
950 8 | . empty_c3 'c'
951 9 empty_a: . []
952 10 empty_b: . []
953 11 empty_c1: . []
954 12 empty_c2: . ['c']
955 13 empty_c3: . ['c']
956
957 'a' error (nonassociative)
958 'b' error (nonassociative)
959 'c' error (nonassociative)
960
961 'c' [reduce using rule 12 (empty_c2)]
962 'c' [reduce using rule 13 (empty_c3)]
963
964 start go to state 1
965 empty_a go to state 2
966 empty_b go to state 3
967 empty_c1 go to state 4
968 empty_c2 go to state 5
969 empty_c3 go to state 6
970
971 Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
972 Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
973 Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').
974
975
976 state 1
977 ]])
978 AT_CLEANUP