1 # Bison Reports. -*- Autotest -*-
3 # Copyright (C) 2018-2020 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([[Test reports.]])
28 AT_BISON_OPTION_PUSHDEFS
36 %token <std::string> IDENTIFIER "identifier"
37 %type <std::string> id
38 %token <int> NUMBER "number"
43 unit: assignments exp { driver.result = $2; };
47 | assignments assignment {};
50 id ":=" exp { driver.variables[$id] = $exp; };
56 "incr" exp <int>{ $$ = 1; } <int>{ $$ = 10; } exp { $$ = $2 + $3 + $4 + $5; }
57 | "(" exp ")" { std::swap ($$, $2); }
58 | "identifier" { $$ = driver.variables[$1]; }
59 | "number" { std::swap ($$, $1); };
62 AT_BISON_CHECK([-o input.cc -v --graph=input.gv --xml input.yy])
64 # Check the contents of the report.
65 AT_CHECK([cat input.output], [],
68 0 $accept: unit "end of file"
70 1 unit: assignments exp
73 3 | assignments assignment
75 4 assignment: id ":=" exp
83 8 exp: "incr" exp @1 @2 exp
89 Terminals, with rules where they appear
95 "identifier" <std::string> (260) 5 10
96 "number" <int> (261) 11
101 Nonterminals, with rules where they appear
114 id <std::string> (13)
130 0 $accept: . unit "end of file"
132 $default reduce using rule 2 (assignments)
135 assignments go to state 2
140 0 $accept: unit . "end of file"
142 "end of file" shift, and go to state 3
147 1 unit: assignments . exp
148 3 assignments: assignments . assignment
150 "incr" shift, and go to state 4
151 "identifier" shift, and go to state 5
152 "number" shift, and go to state 6
153 "(" shift, and go to state 7
155 assignment go to state 8
162 0 $accept: unit "end of file" .
169 8 exp: "incr" . exp @1 @2 exp
171 "incr" shift, and go to state 4
172 "identifier" shift, and go to state 11
173 "number" shift, and go to state 6
174 "(" shift, and go to state 7
182 10 exp: "identifier" .
184 "end of file" reduce using rule 10 (exp)
185 $default reduce using rule 5 (id)
192 $default reduce using rule 11 (exp)
199 "incr" shift, and go to state 4
200 "identifier" shift, and go to state 11
201 "number" shift, and go to state 6
202 "(" shift, and go to state 7
209 3 assignments: assignments assignment .
211 $default reduce using rule 3 (assignments)
216 4 assignment: id . ":=" exp
218 ":=" shift, and go to state 14
223 1 unit: assignments exp .
225 $default reduce using rule 1 (unit)
230 10 exp: "identifier" .
232 $default reduce using rule 10 (exp)
237 8 exp: "incr" exp . @1 @2 exp
239 $default reduce using rule 6 (@1)
248 ")" shift, and go to state 16
253 4 assignment: id ":=" . exp
255 "incr" shift, and go to state 4
256 "identifier" shift, and go to state 11
257 "number" shift, and go to state 6
258 "(" shift, and go to state 7
265 8 exp: "incr" exp @1 . @2 exp
267 $default reduce using rule 7 (@2)
276 $default reduce using rule 9 (exp)
281 4 assignment: id ":=" exp .
283 $default reduce using rule 4 (assignment)
288 8 exp: "incr" exp @1 @2 . exp
290 "incr" shift, and go to state 4
291 "identifier" shift, and go to state 11
292 "number" shift, and go to state 6
293 "(" shift, and go to state 7
300 8 exp: "incr" exp @1 @2 exp .
302 $default reduce using rule 8 (exp)
306 # Now generate verbose reports.
307 AT_BISON_CHECK([-o input.cc -rall --graph=input.gv --xml input.yy])
309 # Check the contents of the report.
310 AT_CHECK([cat input.output], [],
313 0 $accept: unit "end of file"
315 1 unit: assignments exp
317 2 assignments: %empty
318 3 | assignments assignment
320 4 assignment: id ":=" exp
328 8 exp: "incr" exp @1 @2 exp
334 Terminals, with rules where they appear
340 "identifier" <std::string> (260) 5 10
341 "number" <int> (261) 11
346 Nonterminals, with rules where they appear
359 id <std::string> (13)
375 0 $accept: . unit "end of file"
376 1 unit: . assignments exp
377 2 assignments: . %empty
378 3 | . assignments assignment
380 $default reduce using rule 2 (assignments)
383 assignments go to state 2
388 0 $accept: unit . "end of file"
390 "end of file" shift, and go to state 3
395 1 unit: assignments . exp
396 3 assignments: assignments . assignment
397 4 assignment: . id ":=" exp
399 8 exp: . "incr" exp @1 @2 exp
404 "incr" shift, and go to state 4
405 "identifier" shift, and go to state 5
406 "number" shift, and go to state 6
407 "(" shift, and go to state 7
409 assignment go to state 8
416 0 $accept: unit "end of file" .
423 8 exp: . "incr" exp @1 @2 exp
424 8 | "incr" . exp @1 @2 exp
429 "incr" shift, and go to state 4
430 "identifier" shift, and go to state 11
431 "number" shift, and go to state 6
432 "(" shift, and go to state 7
439 5 id: "identifier" . [":="]
440 10 exp: "identifier" . ["end of file"]
442 "end of file" reduce using rule 10 (exp)
443 $default reduce using rule 5 (id)
450 $default reduce using rule 11 (exp)
455 8 exp: . "incr" exp @1 @2 exp
461 "incr" shift, and go to state 4
462 "identifier" shift, and go to state 11
463 "number" shift, and go to state 6
464 "(" shift, and go to state 7
471 3 assignments: assignments assignment .
473 $default reduce using rule 3 (assignments)
478 4 assignment: id . ":=" exp
480 ":=" shift, and go to state 14
485 1 unit: assignments exp .
487 $default reduce using rule 1 (unit)
492 10 exp: "identifier" .
494 $default reduce using rule 10 (exp)
500 8 exp: "incr" exp . @1 @2 exp
502 $default reduce using rule 6 (@1)
511 ")" shift, and go to state 16
516 4 assignment: id ":=" . exp
517 8 exp: . "incr" exp @1 @2 exp
522 "incr" shift, and go to state 4
523 "identifier" shift, and go to state 11
524 "number" shift, and go to state 6
525 "(" shift, and go to state 7
533 8 exp: "incr" exp @1 . @2 exp
535 $default reduce using rule 7 (@2)
544 $default reduce using rule 9 (exp)
549 4 assignment: id ":=" exp .
551 $default reduce using rule 4 (assignment)
556 8 exp: . "incr" exp @1 @2 exp
557 8 | "incr" exp @1 @2 . exp
562 "incr" shift, and go to state 4
563 "identifier" shift, and go to state 11
564 "number" shift, and go to state 6
565 "(" shift, and go to state 7
572 8 exp: "incr" exp @1 @2 exp .
574 $default reduce using rule 8 (exp)
579 AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
580 [[// Generated by GNU Bison VERSION.
581 // Report bugs to <bug-bison@gnu.org>.
582 // Home page: <https://www.gnu.org/software/bison/>.
586 node [fontname = courier, shape = box, colorscheme = paired6]
587 edge [fontname = courier]
589 0 [label="State 0\n\l 0 $accept: • unit \"end of file\"\l 1 unit: • assignments exp\l 2 assignments: • %empty\l 3 | • assignments assignment\l"]
590 0 -> 1 [style=dashed label="unit"]
591 0 -> 2 [style=dashed label="assignments"]
592 0 -> "0R2" [style=solid]
593 "0R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
594 1 [label="State 1\n\l 0 $accept: unit • \"end of file\"\l"]
595 1 -> 3 [style=solid label="\"end of file\""]
596 2 [label="State 2\n\l 1 unit: assignments • exp\l 3 assignments: assignments • assignment\l 4 assignment: • id \":=\" exp\l 5 id: • \"identifier\"\l 8 exp: • \"incr\" exp @1 @2 exp\l 9 | • \"(\" exp \")\"\l 10 | • \"identifier\"\l 11 | • \"number\"\l"]
597 2 -> 4 [style=solid label="\"incr\""]
598 2 -> 5 [style=solid label="\"identifier\""]
599 2 -> 6 [style=solid label="\"number\""]
600 2 -> 7 [style=solid label="\"(\""]
601 2 -> 8 [style=dashed label="assignment"]
602 2 -> 9 [style=dashed label="id"]
603 2 -> 10 [style=dashed label="exp"]
604 3 [label="State 3\n\l 0 $accept: unit \"end of file\" •\l"]
605 3 -> "3R0" [style=solid]
606 "3R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
607 4 [label="State 4\n\l 8 exp: • \"incr\" exp @1 @2 exp\l 8 | \"incr\" • exp @1 @2 exp\l 9 | • \"(\" exp \")\"\l 10 | • \"identifier\"\l 11 | • \"number\"\l"]
608 4 -> 4 [style=solid label="\"incr\""]
609 4 -> 11 [style=solid label="\"identifier\""]
610 4 -> 6 [style=solid label="\"number\""]
611 4 -> 7 [style=solid label="\"(\""]
612 4 -> 12 [style=dashed label="exp"]
613 5 [label="State 5\n\l 5 id: \"identifier\" • [\":=\"]\l 10 exp: \"identifier\" • [\"end of file\"]\l"]
614 5 -> "5R5" [style=solid]
615 "5R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
616 5 -> "5R10" [label="[\"end of file\"]", style=solid]
617 "5R10" [label="R10", fillcolor=3, shape=diamond, style=filled]
618 6 [label="State 6\n\l 11 exp: \"number\" •\l"]
619 6 -> "6R11" [style=solid]
620 "6R11" [label="R11", fillcolor=3, shape=diamond, style=filled]
621 7 [label="State 7\n\l 8 exp: • \"incr\" exp @1 @2 exp\l 9 | • \"(\" exp \")\"\l 9 | \"(\" • exp \")\"\l 10 | • \"identifier\"\l 11 | • \"number\"\l"]
622 7 -> 4 [style=solid label="\"incr\""]
623 7 -> 11 [style=solid label="\"identifier\""]
624 7 -> 6 [style=solid label="\"number\""]
625 7 -> 7 [style=solid label="\"(\""]
626 7 -> 13 [style=dashed label="exp"]
627 8 [label="State 8\n\l 3 assignments: assignments assignment •\l"]
628 8 -> "8R3" [style=solid]
629 "8R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
630 9 [label="State 9\n\l 4 assignment: id • \":=\" exp\l"]
631 9 -> 14 [style=solid label="\":=\""]
632 10 [label="State 10\n\l 1 unit: assignments exp •\l"]
633 10 -> "10R1" [style=solid]
634 "10R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
635 11 [label="State 11\n\l 10 exp: \"identifier\" •\l"]
636 11 -> "11R10" [style=solid]
637 "11R10" [label="R10", fillcolor=3, shape=diamond, style=filled]
638 12 [label="State 12\n\l 6 @1: • %empty\l 8 exp: \"incr\" exp • @1 @2 exp\l"]
639 12 -> 15 [style=dashed label="@1"]
640 12 -> "12R6" [style=solid]
641 "12R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
642 13 [label="State 13\n\l 9 exp: \"(\" exp • \")\"\l"]
643 13 -> 16 [style=solid label="\")\""]
644 14 [label="State 14\n\l 4 assignment: id \":=\" • exp\l 8 exp: • \"incr\" exp @1 @2 exp\l 9 | • \"(\" exp \")\"\l 10 | • \"identifier\"\l 11 | • \"number\"\l"]
645 14 -> 4 [style=solid label="\"incr\""]
646 14 -> 11 [style=solid label="\"identifier\""]
647 14 -> 6 [style=solid label="\"number\""]
648 14 -> 7 [style=solid label="\"(\""]
649 14 -> 17 [style=dashed label="exp"]
650 15 [label="State 15\n\l 7 @2: • %empty\l 8 exp: \"incr\" exp @1 • @2 exp\l"]
651 15 -> 18 [style=dashed label="@2"]
652 15 -> "15R7" [style=solid]
653 "15R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
654 16 [label="State 16\n\l 9 exp: \"(\" exp \")\" •\l"]
655 16 -> "16R9" [style=solid]
656 "16R9" [label="R9", fillcolor=3, shape=diamond, style=filled]
657 17 [label="State 17\n\l 4 assignment: id \":=\" exp •\l"]
658 17 -> "17R4" [style=solid]
659 "17R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
660 18 [label="State 18\n\l 8 exp: • \"incr\" exp @1 @2 exp\l 8 | \"incr\" exp @1 @2 • exp\l 9 | • \"(\" exp \")\"\l 10 | • \"identifier\"\l 11 | • \"number\"\l"]
661 18 -> 4 [style=solid label="\"incr\""]
662 18 -> 11 [style=solid label="\"identifier\""]
663 18 -> 6 [style=solid label="\"number\""]
664 18 -> 7 [style=solid label="\"(\""]
665 18 -> 19 [style=dashed label="exp"]
666 19 [label="State 19\n\l 8 exp: \"incr\" exp @1 @2 exp •\l"]
667 19 -> "19R8" [style=solid]
668 "19R8" [label="R8", fillcolor=3, shape=diamond, style=filled]
673 AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
674 [[<?xml version="1.0"?>
676 <bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
678 <filename>input.yy</filename>
682 <rule number="0" usefulness="useful">
685 <symbol>unit</symbol>
686 <symbol>"end of file"</symbol>
689 <rule number="1" usefulness="useful">
692 <symbol>assignments</symbol>
696 <rule number="2" usefulness="useful">
697 <lhs>assignments</lhs>
702 <rule number="3" usefulness="useful">
703 <lhs>assignments</lhs>
705 <symbol>assignments</symbol>
706 <symbol>assignment</symbol>
709 <rule number="4" usefulness="useful">
710 <lhs>assignment</lhs>
713 <symbol>":="</symbol>
717 <rule number="5" usefulness="useful">
720 <symbol>"identifier"</symbol>
723 <rule number="6" usefulness="useful">
729 <rule number="7" usefulness="useful">
735 <rule number="8" usefulness="useful">
738 <symbol>"incr"</symbol>
745 <rule number="9" usefulness="useful">
748 <symbol>"("</symbol>
750 <symbol>")"</symbol>
753 <rule number="10" usefulness="useful">
756 <symbol>"identifier"</symbol>
759 <rule number="11" usefulness="useful">
762 <symbol>"number"</symbol>
767 <terminal symbol-number="0" token-number="0" name=""end of file"" type="" usefulness="useful"/>
768 <terminal symbol-number="1" token-number="256" name="error" type="" usefulness="useful"/>
769 <terminal symbol-number="3" token-number="258" name="":="" type="" usefulness="useful"/>
770 <terminal symbol-number="4" token-number="259" name=""incr"" type="" usefulness="useful"/>
771 <terminal symbol-number="5" token-number="260" name=""identifier"" type="std::string" usefulness="useful"/>
772 <terminal symbol-number="6" token-number="261" name=""number"" type="int" usefulness="useful"/>
773 <terminal symbol-number="7" token-number="262" name=""("" type="" usefulness="useful"/>
774 <terminal symbol-number="8" token-number="263" name="")"" type="" usefulness="useful"/>
777 <nonterminal symbol-number="9" name="$accept" type="" usefulness="useful"/>
778 <nonterminal symbol-number="10" name="unit" type="" usefulness="useful"/>
779 <nonterminal symbol-number="11" name="assignments" type="" usefulness="useful"/>
780 <nonterminal symbol-number="12" name="assignment" type="" usefulness="useful"/>
781 <nonterminal symbol-number="13" name="id" type="std::string" usefulness="useful"/>
782 <nonterminal symbol-number="14" name="exp" type="int" usefulness="useful"/>
783 <nonterminal symbol-number="15" name="@1" type="int" usefulness="useful"/>
784 <nonterminal symbol-number="16" name="@2" type="int" usefulness="useful"/>
792 <item rule-number="0" dot="0"/>
793 <item rule-number="1" dot="0"/>
794 <item rule-number="2" dot="0"/>
795 <item rule-number="3" dot="0"/>
799 <transition type="goto" symbol="unit" state="1"/>
800 <transition type="goto" symbol="assignments" state="2"/>
804 <reduction symbol="$default" rule="2" enabled="true"/>
812 <item rule-number="0" dot="1"/>
816 <transition type="shift" symbol=""end of file"" state="3"/>
826 <item rule-number="1" dot="1"/>
827 <item rule-number="3" dot="1"/>
828 <item rule-number="4" dot="0"/>
829 <item rule-number="5" dot="0"/>
830 <item rule-number="8" dot="0"/>
831 <item rule-number="9" dot="0"/>
832 <item rule-number="10" dot="0"/>
833 <item rule-number="11" dot="0"/>
837 <transition type="shift" symbol=""incr"" state="4"/>
838 <transition type="shift" symbol=""identifier"" state="5"/>
839 <transition type="shift" symbol=""number"" state="6"/>
840 <transition type="shift" symbol=""("" state="7"/>
841 <transition type="goto" symbol="assignment" state="8"/>
842 <transition type="goto" symbol="id" state="9"/>
843 <transition type="goto" symbol="exp" state="10"/>
853 <item rule-number="0" dot="2"/>
859 <reduction symbol="$default" rule="accept" enabled="true"/>
867 <item rule-number="8" dot="0"/>
868 <item rule-number="8" dot="1"/>
869 <item rule-number="9" dot="0"/>
870 <item rule-number="10" dot="0"/>
871 <item rule-number="11" dot="0"/>
875 <transition type="shift" symbol=""incr"" state="4"/>
876 <transition type="shift" symbol=""identifier"" state="11"/>
877 <transition type="shift" symbol=""number"" state="6"/>
878 <transition type="shift" symbol=""("" state="7"/>
879 <transition type="goto" symbol="exp" state="12"/>
889 <item rule-number="5" dot="1">
891 <symbol>":="</symbol>
894 <item rule-number="10" dot="1">
896 <symbol>"end of file"</symbol>
904 <reduction symbol=""end of file"" rule="10" enabled="true"/>
905 <reduction symbol="$default" rule="5" enabled="true"/>
913 <item rule-number="11" dot="1"/>
919 <reduction symbol="$default" rule="11" enabled="true"/>
927 <item rule-number="8" dot="0"/>
928 <item rule-number="9" dot="0"/>
929 <item rule-number="9" dot="1"/>
930 <item rule-number="10" dot="0"/>
931 <item rule-number="11" dot="0"/>
935 <transition type="shift" symbol=""incr"" state="4"/>
936 <transition type="shift" symbol=""identifier"" state="11"/>
937 <transition type="shift" symbol=""number"" state="6"/>
938 <transition type="shift" symbol=""("" state="7"/>
939 <transition type="goto" symbol="exp" state="13"/>
949 <item rule-number="3" dot="2"/>
955 <reduction symbol="$default" rule="3" enabled="true"/>
963 <item rule-number="4" dot="1"/>
967 <transition type="shift" symbol="":="" state="14"/>
977 <item rule-number="1" dot="2"/>
983 <reduction symbol="$default" rule="1" enabled="true"/>
991 <item rule-number="10" dot="1"/>
997 <reduction symbol="$default" rule="10" enabled="true"/>
1005 <item rule-number="6" dot="0"/>
1006 <item rule-number="8" dot="2"/>
1010 <transition type="goto" symbol="@1" state="15"/>
1014 <reduction symbol="$default" rule="6" enabled="true"/>
1022 <item rule-number="9" dot="2"/>
1026 <transition type="shift" symbol="")"" state="16"/>
1036 <item rule-number="4" dot="2"/>
1037 <item rule-number="8" dot="0"/>
1038 <item rule-number="9" dot="0"/>
1039 <item rule-number="10" dot="0"/>
1040 <item rule-number="11" dot="0"/>
1044 <transition type="shift" symbol=""incr"" state="4"/>
1045 <transition type="shift" symbol=""identifier"" state="11"/>
1046 <transition type="shift" symbol=""number"" state="6"/>
1047 <transition type="shift" symbol=""("" state="7"/>
1048 <transition type="goto" symbol="exp" state="17"/>
1058 <item rule-number="7" dot="0"/>
1059 <item rule-number="8" dot="3"/>
1063 <transition type="goto" symbol="@2" state="18"/>
1067 <reduction symbol="$default" rule="7" enabled="true"/>
1075 <item rule-number="9" dot="3"/>
1081 <reduction symbol="$default" rule="9" enabled="true"/>
1089 <item rule-number="4" dot="3"/>
1095 <reduction symbol="$default" rule="4" enabled="true"/>
1103 <item rule-number="8" dot="0"/>
1104 <item rule-number="8" dot="4"/>
1105 <item rule-number="9" dot="0"/>
1106 <item rule-number="10" dot="0"/>
1107 <item rule-number="11" dot="0"/>
1111 <transition type="shift" symbol=""incr"" state="4"/>
1112 <transition type="shift" symbol=""identifier"" state="11"/>
1113 <transition type="shift" symbol=""number"" state="6"/>
1114 <transition type="shift" symbol=""("" state="7"/>
1115 <transition type="goto" symbol="exp" state="19"/>
1125 <item rule-number="8" dot="5"/>
1131 <reduction symbol="$default" rule="8" enabled="true"/>
1140 # Check HTML output.
1141 if test x"$XSLTPROC" != x""; then
1142 AT_CHECK([[$XSLTPROC \
1143 `]]AT_SET_ENV[[ bison --print-datadir`/xslt/xml2xhtml.xsl \
1145 sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/' \
1148 AT_CHECK([cat input.html], [],
1149 [[<?xml version="1.0" encoding="UTF-8"?>
1150 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1151 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="http://www.gnu.org/software/bison/">
1153 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
1154 <title>input.yy - GNU Bison XML Automaton Report</title>
1155 <style type="text/css">
1157 font-family: "Nimbus Sans L", Arial, sans-serif;
1162 text-decoration: none;
1166 text-decoration: none;
1172 text-decoration: underline;
1178 font-family: monospace;
1182 list-style-type: decimal;
1185 list-style-type: lower-alpha;
1196 <body><h1>GNU Bison XML Automaton Report</h1><p>
1197 input grammar: <span class="i">input.yy</span></p>
1199 <h3>Table of Contents</h3><ul id="menu"><li><a href="#reductions">Reductions</a><ul class="lower-alpha"><li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li><li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li><li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li></ul></li><li><a href="#conflicts">Conflicts</a></li><li><a href="#grammar">Grammar</a><ul class="lower-alpha"><li><a href="#grammar">Itemset</a></li><li><a href="#terminals">Terminal symbols</a></li><li><a href="#nonterminals">Nonterminal symbols</a></li></ul></li><li><a href="#automaton">Automaton</a></li></ul><h2><a name="reductions" id="reductions"></a> Reductions</h2><h3><a name="nonterminals_useless_in_grammar" id="nonterminals_useless_in_grammar"></a> Nonterminals useless in grammar</h3>
1201 <h3><a name="terminals_unused_in_grammar" id="terminals_unused_in_grammar"></a> Terminals unused in grammar</h3>
1203 <h3><a name="rules_useless_in_grammar" id="rules_useless_in_grammar"></a> Rules useless in grammar</h3>
1204 <h2><a name="conflicts" id="conflicts"></a> Conflicts</h2>
1206 <h2><a name="grammar" id="grammar"></a> Grammar</h2>
1208 <a name="rule_0" id="rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">unit</span> <b>"end of file"</b>
1210 <a name="rule_1" id="rule_1"> 1</a> <span class="i">unit</span> → <span class="i">assignments</span> <span class="i">exp</span>
1212 <a name="rule_2" id="rule_2"> 2</a> <span class="i">assignments</span> → %empty
1213 <a name="rule_3" id="rule_3"> 3</a> | <span class="i">assignments</span> <span class="i">assignment</span>
1215 <a name="rule_4" id="rule_4"> 4</a> <span class="i">assignment</span> → <span class="i">id</span> <b>":="</b> <span class="i">exp</span>
1217 <a name="rule_5" id="rule_5"> 5</a> <span class="i">id</span> → <b>"identifier"</b>
1219 <a name="rule_6" id="rule_6"> 6</a> <span class="i">@1</span> → %empty
1221 <a name="rule_7" id="rule_7"> 7</a> <span class="i">@2</span> → %empty
1223 <a name="rule_8" id="rule_8"> 8</a> <span class="i">exp</span> → <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1224 <a name="rule_9" id="rule_9"> 9</a> | <b>"("</b> <span class="i">exp</span> <b>")"</b>
1225 <a name="rule_10" id="rule_10"> 10</a> | <b>"identifier"</b>
1226 <a name="rule_11" id="rule_11"> 11</a> | <b>"number"</b>
1229 <h3><a name="terminals" id="terminals"></a> Terminals, with rules where they appear</h3>
1232 <li><b>"end of file"</b> (0) <a href="#rule_0">0</a></li>
1233 <li><b>error</b> (256)</li>
1234 <li><b>":="</b> (258) <a href="#rule_4">4</a></li>
1235 <li><b>"incr"</b> (259) <a href="#rule_8">8</a></li>
1236 <li><b>"identifier"</b> <std::string> (260) <a href="#rule_5">5</a> <a href="#rule_10">10</a></li>
1237 <li><b>"number"</b> <int> (261) <a href="#rule_11">11</a></li>
1238 <li><b>"("</b> (262) <a href="#rule_9">9</a></li>
1239 <li><b>")"</b> (263) <a href="#rule_9">9</a></li>
1242 <h3><a name="nonterminals" id="nonterminals"></a> Nonterminals, with rules where they appear</h3>
1245 <li><b>$accept</b> (9)
1247 <li>on left: <a href="#rule_0">0</a></li>
1250 <li><b>unit</b> (10)
1252 <li>on left: <a href="#rule_1">1</a></li>
1253 <li>on right: <a href="#rule_0">0</a></li>
1256 <li><b>assignments</b> (11)
1258 <li>on left: <a href="#rule_2">2</a> <a href="#rule_3">3</a></li>
1259 <li>on right: <a href="#rule_1">1</a> <a href="#rule_3">3</a></li>
1262 <li><b>assignment</b> (12)
1264 <li>on left: <a href="#rule_4">4</a></li>
1265 <li>on right: <a href="#rule_3">3</a></li>
1268 <li><b>id</b> <std::string> (13)
1270 <li>on left: <a href="#rule_5">5</a></li>
1271 <li>on right: <a href="#rule_4">4</a></li>
1274 <li><b>exp</b> <int> (14)
1276 <li>on left: <a href="#rule_8">8</a> <a href="#rule_9">9</a> <a href="#rule_10">10</a> <a href="#rule_11">11</a></li>
1277 <li>on right: <a href="#rule_1">1</a> <a href="#rule_4">4</a> <a href="#rule_8">8</a> <a href="#rule_9">9</a></li>
1280 <li><b>@1</b> <int> (15)
1282 <li>on left: <a href="#rule_6">6</a></li>
1283 <li>on right: <a href="#rule_8">8</a></li>
1286 <li><b>@2</b> <int> (16)
1288 <li>on left: <a href="#rule_7">7</a></li>
1289 <li>on right: <a href="#rule_8">8</a></li>
1292 </ul><h2><a name="automaton" id="automaton"></a> Automaton</h2>
1294 <h3><a name="state_0" id="state_0"></a>State 0</h3>
1296 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="dot">•</span> <span class="i">unit</span> <b>"end of file"</b>
1297 <a href="#rule_1"> 1</a> <span class="i">unit</span> → <span class="dot">•</span> <span class="i">assignments</span> <span class="i">exp</span>
1298 <a href="#rule_2"> 2</a> <span class="i">assignments</span> → <span class="dot">•</span> %empty
1299 <a href="#rule_3"> 3</a> | <span class="dot">•</span> <span class="i">assignments</span> <span class="i">assignment</span>
1301 $default <a href="#rule_2">reduce using rule 2</a> (assignments)
1303 unit <a href="#state_1">go to state 1</a>
1304 assignments <a href="#state_2">go to state 2</a>
1307 <h3><a name="state_1" id="state_1"></a>State 1</h3>
1309 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">unit</span> <span class="dot">•</span> <b>"end of file"</b>
1311 "end of file" <a href="#state_3">shift, and go to state 3</a>
1314 <h3><a name="state_2" id="state_2"></a>State 2</h3>
1316 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">unit</span> → <span class="i">assignments</span> <span class="dot">•</span> <span class="i">exp</span>
1317 <a href="#rule_3"> 3</a> <span class="i">assignments</span> → <span class="i">assignments</span> <span class="dot">•</span> <span class="i">assignment</span>
1318 <a href="#rule_4"> 4</a> <span class="i">assignment</span> → <span class="dot">•</span> <span class="i">id</span> <b>":="</b> <span class="i">exp</span>
1319 <a href="#rule_5"> 5</a> <span class="i">id</span> → <span class="dot">•</span> <b>"identifier"</b>
1320 <a href="#rule_8"> 8</a> <span class="i">exp</span> → <span class="dot">•</span> <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1321 <a href="#rule_9"> 9</a> | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
1322 <a href="#rule_10"> 10</a> | <span class="dot">•</span> <b>"identifier"</b>
1323 <a href="#rule_11"> 11</a> | <span class="dot">•</span> <b>"number"</b>
1325 "incr" <a href="#state_4">shift, and go to state 4</a>
1326 "identifier" <a href="#state_5">shift, and go to state 5</a>
1327 "number" <a href="#state_6">shift, and go to state 6</a>
1328 "(" <a href="#state_7">shift, and go to state 7</a>
1330 assignment <a href="#state_8">go to state 8</a>
1331 id <a href="#state_9">go to state 9</a>
1332 exp <a href="#state_10">go to state 10</a>
1335 <h3><a name="state_3" id="state_3"></a>State 3</h3>
1337 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">unit</span> <b>"end of file"</b> <span class="dot">•</span>
1342 <h3><a name="state_4" id="state_4"></a>State 4</h3>
1344 <p class="pre"> <a href="#rule_8"> 8</a> <span class="i">exp</span> → <span class="dot">•</span> <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1345 <a href="#rule_8"> 8</a> | <b>"incr"</b> <span class="dot">•</span> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1346 <a href="#rule_9"> 9</a> | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
1347 <a href="#rule_10"> 10</a> | <span class="dot">•</span> <b>"identifier"</b>
1348 <a href="#rule_11"> 11</a> | <span class="dot">•</span> <b>"number"</b>
1350 "incr" <a href="#state_4">shift, and go to state 4</a>
1351 "identifier" <a href="#state_11">shift, and go to state 11</a>
1352 "number" <a href="#state_6">shift, and go to state 6</a>
1353 "(" <a href="#state_7">shift, and go to state 7</a>
1355 exp <a href="#state_12">go to state 12</a>
1358 <h3><a name="state_5" id="state_5"></a>State 5</h3>
1360 <p class="pre"> <a href="#rule_5"> 5</a> <span class="i">id</span> → <b>"identifier"</b> <span class="dot">•</span> [":="]
1361 <a href="#rule_10"> 10</a> <span class="i">exp</span> → <b>"identifier"</b> <span class="dot">•</span> ["end of file"]
1363 "end of file" <a href="#rule_10">reduce using rule 10</a> (exp)
1364 $default <a href="#rule_5">reduce using rule 5</a> (id)
1367 <h3><a name="state_6" id="state_6"></a>State 6</h3>
1369 <p class="pre"> <a href="#rule_11"> 11</a> <span class="i">exp</span> → <b>"number"</b> <span class="dot">•</span>
1371 $default <a href="#rule_11">reduce using rule 11</a> (exp)
1374 <h3><a name="state_7" id="state_7"></a>State 7</h3>
1376 <p class="pre"> <a href="#rule_8"> 8</a> <span class="i">exp</span> → <span class="dot">•</span> <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1377 <a href="#rule_9"> 9</a> | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
1378 <a href="#rule_9"> 9</a> | <b>"("</b> <span class="dot">•</span> <span class="i">exp</span> <b>")"</b>
1379 <a href="#rule_10"> 10</a> | <span class="dot">•</span> <b>"identifier"</b>
1380 <a href="#rule_11"> 11</a> | <span class="dot">•</span> <b>"number"</b>
1382 "incr" <a href="#state_4">shift, and go to state 4</a>
1383 "identifier" <a href="#state_11">shift, and go to state 11</a>
1384 "number" <a href="#state_6">shift, and go to state 6</a>
1385 "(" <a href="#state_7">shift, and go to state 7</a>
1387 exp <a href="#state_13">go to state 13</a>
1390 <h3><a name="state_8" id="state_8"></a>State 8</h3>
1392 <p class="pre"> <a href="#rule_3"> 3</a> <span class="i">assignments</span> → <span class="i">assignments</span> <span class="i">assignment</span> <span class="dot">•</span>
1394 $default <a href="#rule_3">reduce using rule 3</a> (assignments)
1397 <h3><a name="state_9" id="state_9"></a>State 9</h3>
1399 <p class="pre"> <a href="#rule_4"> 4</a> <span class="i">assignment</span> → <span class="i">id</span> <span class="dot">•</span> <b>":="</b> <span class="i">exp</span>
1401 ":=" <a href="#state_14">shift, and go to state 14</a>
1404 <h3><a name="state_10" id="state_10"></a>State 10</h3>
1406 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">unit</span> → <span class="i">assignments</span> <span class="i">exp</span> <span class="dot">•</span>
1408 $default <a href="#rule_1">reduce using rule 1</a> (unit)
1411 <h3><a name="state_11" id="state_11"></a>State 11</h3>
1413 <p class="pre"> <a href="#rule_10"> 10</a> <span class="i">exp</span> → <b>"identifier"</b> <span class="dot">•</span>
1415 $default <a href="#rule_10">reduce using rule 10</a> (exp)
1418 <h3><a name="state_12" id="state_12"></a>State 12</h3>
1420 <p class="pre"> <a href="#rule_6"> 6</a> <span class="i">@1</span> → <span class="dot">•</span> %empty
1421 <a href="#rule_8"> 8</a> <span class="i">exp</span> → <b>"incr"</b> <span class="i">exp</span> <span class="dot">•</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1423 $default <a href="#rule_6">reduce using rule 6</a> (@1)
1425 @1 <a href="#state_15">go to state 15</a>
1428 <h3><a name="state_13" id="state_13"></a>State 13</h3>
1430 <p class="pre"> <a href="#rule_9"> 9</a> <span class="i">exp</span> → <b>"("</b> <span class="i">exp</span> <span class="dot">•</span> <b>")"</b>
1432 ")" <a href="#state_16">shift, and go to state 16</a>
1435 <h3><a name="state_14" id="state_14"></a>State 14</h3>
1437 <p class="pre"> <a href="#rule_4"> 4</a> <span class="i">assignment</span> → <span class="i">id</span> <b>":="</b> <span class="dot">•</span> <span class="i">exp</span>
1438 <a href="#rule_8"> 8</a> <span class="i">exp</span> → <span class="dot">•</span> <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1439 <a href="#rule_9"> 9</a> | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
1440 <a href="#rule_10"> 10</a> | <span class="dot">•</span> <b>"identifier"</b>
1441 <a href="#rule_11"> 11</a> | <span class="dot">•</span> <b>"number"</b>
1443 "incr" <a href="#state_4">shift, and go to state 4</a>
1444 "identifier" <a href="#state_11">shift, and go to state 11</a>
1445 "number" <a href="#state_6">shift, and go to state 6</a>
1446 "(" <a href="#state_7">shift, and go to state 7</a>
1448 exp <a href="#state_17">go to state 17</a>
1451 <h3><a name="state_15" id="state_15"></a>State 15</h3>
1453 <p class="pre"> <a href="#rule_7"> 7</a> <span class="i">@2</span> → <span class="dot">•</span> %empty
1454 <a href="#rule_8"> 8</a> <span class="i">exp</span> → <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="dot">•</span> <span class="i">@2</span> <span class="i">exp</span>
1456 $default <a href="#rule_7">reduce using rule 7</a> (@2)
1458 @2 <a href="#state_18">go to state 18</a>
1461 <h3><a name="state_16" id="state_16"></a>State 16</h3>
1463 <p class="pre"> <a href="#rule_9"> 9</a> <span class="i">exp</span> → <b>"("</b> <span class="i">exp</span> <b>")"</b> <span class="dot">•</span>
1465 $default <a href="#rule_9">reduce using rule 9</a> (exp)
1468 <h3><a name="state_17" id="state_17"></a>State 17</h3>
1470 <p class="pre"> <a href="#rule_4"> 4</a> <span class="i">assignment</span> → <span class="i">id</span> <b>":="</b> <span class="i">exp</span> <span class="dot">•</span>
1472 $default <a href="#rule_4">reduce using rule 4</a> (assignment)
1475 <h3><a name="state_18" id="state_18"></a>State 18</h3>
1477 <p class="pre"> <a href="#rule_8"> 8</a> <span class="i">exp</span> → <span class="dot">•</span> <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span>
1478 <a href="#rule_8"> 8</a> | <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="dot">•</span> <span class="i">exp</span>
1479 <a href="#rule_9"> 9</a> | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
1480 <a href="#rule_10"> 10</a> | <span class="dot">•</span> <b>"identifier"</b>
1481 <a href="#rule_11"> 11</a> | <span class="dot">•</span> <b>"number"</b>
1483 "incr" <a href="#state_4">shift, and go to state 4</a>
1484 "identifier" <a href="#state_11">shift, and go to state 11</a>
1485 "number" <a href="#state_6">shift, and go to state 6</a>
1486 "(" <a href="#state_7">shift, and go to state 7</a>
1488 exp <a href="#state_19">go to state 19</a>
1491 <h3><a name="state_19" id="state_19"></a>State 19</h3>
1493 <p class="pre"> <a href="#rule_8"> 8</a> <span class="i">exp</span> → <b>"incr"</b> <span class="i">exp</span> <span class="i">@1</span> <span class="i">@2</span> <span class="i">exp</span> <span class="dot">•</span>
1495 $default <a href="#rule_8">reduce using rule 8</a> (exp)
1498 <div id="footer"><hr />This document was generated using
1499 <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
1500 GNU Bison VERSION</a>
1501 XML Automaton Report.<br />
1502 Verbatim copying and distribution of this entire page is
1503 permitted in any medium, provided this notice is preserved.</div></body>
1508 AT_BISON_OPTION_POPDEFS
1512 ## ------------------------ ##
1513 ## Reports with conflicts. ##
1514 ## ------------------------ ##
1516 AT_SETUP([Reports with conflicts])
1518 AT_KEYWORDS([cex report])
1520 # We need UTF-8 support for correct screen-width computation of UTF-8
1521 # characters. Skip the test if not available.
1522 locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
1523 AT_SKIP_IF([test x == x"$locale"])
1525 AT_BISON_OPTION_PUSHDEFS
1537 AT_CHECK([LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --xml input.y], [], [],
1538 [[input.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
1539 input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
1540 input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
1541 Example: exp "+" exp • "⊕" exp
1550 input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterexamples]
1551 Example: exp "+" exp •
1552 First reduce derivation
1555 Second reduce derivation
1558 input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
1559 Example: exp "+" exp • "⊕" exp
1568 input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
1569 Example: exp "⊕" exp • "⊕" exp
1578 input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
1579 Example: exp "⊕" exp • "+" exp
1588 input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
1589 Example: exp "⊕" exp • "+" exp
1598 input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother]
1601 # Check the contents of the report.
1602 # FIXME: Avoid trailing white spaces.
1603 AT_CHECK([sed -e 's/ *$//' input.output], [],
1604 [[Rules useless in parser due to conflicts
1609 State 7 conflicts: 1 shift/reduce, 3 reduce/reduce
1610 State 8 conflicts: 2 shift/reduce
1624 Terminals, with rules where they appear
1634 Nonterminals, with rules where they appear
1645 0 $accept: • exp $end
1646 1 exp: • exp "⊕" exp
1652 "number" shift, and go to state 1
1653 "Ñùṃéℝô" shift, and go to state 2
1662 $default reduce using rule 4 (exp)
1669 $default reduce using rule 5 (exp)
1674 0 $accept: exp • $end
1675 1 exp: exp • "⊕" exp
1679 $end shift, and go to state 4
1680 "+" shift, and go to state 5
1681 "⊕" shift, and go to state 6
1686 0 $accept: exp $end •
1693 1 exp: • exp "⊕" exp
1701 "number" shift, and go to state 1
1702 "Ñùṃéℝô" shift, and go to state 2
1709 1 exp: • exp "⊕" exp
1716 "number" shift, and go to state 1
1717 "Ñùṃéℝô" shift, and go to state 2
1724 1 exp: exp • "⊕" exp
1726 2 | exp "+" exp • [$end, "+", "⊕"]
1728 3 | exp "+" exp • [$end, "+", "⊕"]
1730 "⊕" shift, and go to state 6
1732 $end reduce using rule 2 (exp)
1733 $end [reduce using rule 3 (exp)]
1734 "+" reduce using rule 2 (exp)
1735 "+" [reduce using rule 3 (exp)]
1736 "⊕" [reduce using rule 2 (exp)]
1737 "⊕" [reduce using rule 3 (exp)]
1738 $default reduce using rule 2 (exp)
1740 Conflict between rule 2 and token "+" resolved as reduce (%left "+").
1742 shift/reduce conflict on token "⊕":
1743 2 exp: exp "+" exp •
1744 1 exp: exp • "⊕" exp
1745 Example: exp "+" exp • "⊕" exp
1755 reduce/reduce conflict on tokens $end, "+", "⊕":
1756 2 exp: exp "+" exp •
1757 3 exp: exp "+" exp •
1758 Example: exp "+" exp •
1759 First reduce derivation
1762 Second reduce derivation
1766 shift/reduce conflict on token "⊕":
1767 3 exp: exp "+" exp •
1768 1 exp: exp • "⊕" exp
1769 Example: exp "+" exp • "⊕" exp
1783 1 exp: exp • "⊕" exp
1784 1 | exp "⊕" exp • [$end, "+", "⊕"]
1788 "+" shift, and go to state 5
1789 "⊕" shift, and go to state 6
1791 "+" [reduce using rule 1 (exp)]
1792 "⊕" [reduce using rule 1 (exp)]
1793 $default reduce using rule 1 (exp)
1795 shift/reduce conflict on token "⊕":
1796 1 exp: exp "⊕" exp •
1797 1 exp: exp • "⊕" exp
1798 Example: exp "⊕" exp • "⊕" exp
1808 shift/reduce conflict on token "+":
1809 1 exp: exp "⊕" exp •
1810 2 exp: exp • "+" exp
1811 Example: exp "⊕" exp • "+" exp
1821 shift/reduce conflict on token "+":
1822 1 exp: exp "⊕" exp •
1823 3 exp: exp • "+" exp
1824 Example: exp "⊕" exp • "+" exp
1839 AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
1840 [[// Generated by GNU Bison VERSION.
1841 // Report bugs to <bug-bison@gnu.org>.
1842 // Home page: <https://www.gnu.org/software/bison/>.
1846 node [fontname = courier, shape = box, colorscheme = paired6]
1847 edge [fontname = courier]
1849 0 [label="State 0\n\l 0 $accept: • exp $end\l 1 exp: • exp \"⊕\" exp\l 2 | • exp \"+\" exp\l 3 | • exp \"+\" exp\l 4 | • \"number\"\l 5 | • \"Ñùṃéℝô\"\l"]
1850 0 -> 1 [style=solid label="\"number\""]
1851 0 -> 2 [style=solid label="\"Ñùṃéℝô\""]
1852 0 -> 3 [style=dashed label="exp"]
1853 1 [label="State 1\n\l 4 exp: \"number\" •\l"]
1854 1 -> "1R4" [style=solid]
1855 "1R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
1856 2 [label="State 2\n\l 5 exp: \"Ñùṃéℝô\" •\l"]
1857 2 -> "2R5" [style=solid]
1858 "2R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
1859 3 [label="State 3\n\l 0 $accept: exp • $end\l 1 exp: exp • \"⊕\" exp\l 2 | exp • \"+\" exp\l 3 | exp • \"+\" exp\l"]
1860 3 -> 4 [style=solid label="$end"]
1861 3 -> 5 [style=solid label="\"+\""]
1862 3 -> 6 [style=solid label="\"⊕\""]
1863 4 [label="State 4\n\l 0 $accept: exp $end •\l"]
1864 4 -> "4R0" [style=solid]
1865 "4R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
1866 5 [label="State 5\n\l 1 exp: • exp \"⊕\" exp\l 2 | • exp \"+\" exp\l 2 | exp \"+\" • exp\l 3 | • exp \"+\" exp\l 3 | exp \"+\" • exp\l 4 | • \"number\"\l 5 | • \"Ñùṃéℝô\"\l"]
1867 5 -> 1 [style=solid label="\"number\""]
1868 5 -> 2 [style=solid label="\"Ñùṃéℝô\""]
1869 5 -> 7 [style=dashed label="exp"]
1870 6 [label="State 6\n\l 1 exp: • exp \"⊕\" exp\l 1 | exp \"⊕\" • exp\l 2 | • exp \"+\" exp\l 3 | • exp \"+\" exp\l 4 | • \"number\"\l 5 | • \"Ñùṃéℝô\"\l"]
1871 6 -> 1 [style=solid label="\"number\""]
1872 6 -> 2 [style=solid label="\"Ñùṃéℝô\""]
1873 6 -> 8 [style=dashed label="exp"]
1874 7 [label="State 7\n\l 1 exp: exp • \"⊕\" exp\l 2 | exp • \"+\" exp\l 2 | exp \"+\" exp • [$end, \"+\", \"⊕\"]\l 3 | exp • \"+\" exp\l 3 | exp \"+\" exp • [$end, \"+\", \"⊕\"]\l"]
1875 7 -> 6 [style=solid label="\"⊕\""]
1876 7 -> "7R2d" [label="[\"⊕\"]", style=solid]
1877 "7R2d" [label="R2", fillcolor=5, shape=diamond, style=filled]
1878 7 -> "7R2" [style=solid]
1879 "7R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
1880 7 -> "7R3d" [label="[$end, \"+\", \"⊕\"]", style=solid]
1881 "7R3d" [label="R3", fillcolor=5, shape=diamond, style=filled]
1882 8 [label="State 8\n\l 1 exp: exp • \"⊕\" exp\l 1 | exp \"⊕\" exp • [$end, \"+\", \"⊕\"]\l 2 | exp • \"+\" exp\l 3 | exp • \"+\" exp\l"]
1883 8 -> 5 [style=solid label="\"+\""]
1884 8 -> 6 [style=solid label="\"⊕\""]
1885 8 -> "8R1d" [label="[\"+\", \"⊕\"]", style=solid]
1886 "8R1d" [label="R1", fillcolor=5, shape=diamond, style=filled]
1887 8 -> "8R1" [style=solid]
1888 "8R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
1893 AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
1894 [[<?xml version="1.0"?>
1896 <bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
1898 <filename>input.y</filename>
1902 <rule number="0" usefulness="useful">
1905 <symbol>exp</symbol>
1906 <symbol>$end</symbol>
1909 <rule number="1" usefulness="useful">
1912 <symbol>exp</symbol>
1913 <symbol>"⊕"</symbol>
1914 <symbol>exp</symbol>
1917 <rule number="2" usefulness="useful">
1920 <symbol>exp</symbol>
1921 <symbol>"+"</symbol>
1922 <symbol>exp</symbol>
1925 <rule number="3" usefulness="useless-in-parser">
1928 <symbol>exp</symbol>
1929 <symbol>"+"</symbol>
1930 <symbol>exp</symbol>
1933 <rule number="4" usefulness="useful">
1936 <symbol>"number"</symbol>
1939 <rule number="5" usefulness="useful">
1942 <symbol>"Ñùṃéℝô"</symbol>
1947 <terminal symbol-number="0" token-number="0" name="$end" type="" usefulness="useful"/>
1948 <terminal symbol-number="1" token-number="256" name="error" type="" usefulness="useful"/>
1949 <terminal symbol-number="3" token-number="258" name=""+"" type="" usefulness="useful" prec="1" assoc="left"/>
1950 <terminal symbol-number="4" token-number="259" name=""⊕"" type="" usefulness="useful"/>
1951 <terminal symbol-number="5" token-number="260" name=""number"" type="" usefulness="useful"/>
1952 <terminal symbol-number="6" token-number="261" name=""Ñùṃéℝô"" type="" usefulness="useful"/>
1955 <nonterminal symbol-number="7" name="$accept" type="" usefulness="useful"/>
1956 <nonterminal symbol-number="8" name="exp" type="" usefulness="useful"/>
1964 <item rule-number="0" dot="0"/>
1965 <item rule-number="1" dot="0"/>
1966 <item rule-number="2" dot="0"/>
1967 <item rule-number="3" dot="0"/>
1968 <item rule-number="4" dot="0"/>
1969 <item rule-number="5" dot="0"/>
1973 <transition type="shift" symbol=""number"" state="1"/>
1974 <transition type="shift" symbol=""Ñùṃéℝô"" state="2"/>
1975 <transition type="goto" symbol="exp" state="3"/>
1985 <item rule-number="4" dot="1"/>
1991 <reduction symbol="$default" rule="4" enabled="true"/>
1999 <item rule-number="5" dot="1"/>
2005 <reduction symbol="$default" rule="5" enabled="true"/>
2013 <item rule-number="0" dot="1"/>
2014 <item rule-number="1" dot="1"/>
2015 <item rule-number="2" dot="1"/>
2016 <item rule-number="3" dot="1"/>
2020 <transition type="shift" symbol="$end" state="4"/>
2021 <transition type="shift" symbol=""+"" state="5"/>
2022 <transition type="shift" symbol=""⊕"" state="6"/>
2032 <item rule-number="0" dot="2"/>
2038 <reduction symbol="$default" rule="accept" enabled="true"/>
2046 <item rule-number="1" dot="0"/>
2047 <item rule-number="2" dot="0"/>
2048 <item rule-number="2" dot="2"/>
2049 <item rule-number="3" dot="0"/>
2050 <item rule-number="3" dot="2"/>
2051 <item rule-number="4" dot="0"/>
2052 <item rule-number="5" dot="0"/>
2056 <transition type="shift" symbol=""number"" state="1"/>
2057 <transition type="shift" symbol=""Ñùṃéℝô"" state="2"/>
2058 <transition type="goto" symbol="exp" state="7"/>
2068 <item rule-number="1" dot="0"/>
2069 <item rule-number="1" dot="2"/>
2070 <item rule-number="2" dot="0"/>
2071 <item rule-number="3" dot="0"/>
2072 <item rule-number="4" dot="0"/>
2073 <item rule-number="5" dot="0"/>
2077 <transition type="shift" symbol=""number"" state="1"/>
2078 <transition type="shift" symbol=""Ñùṃéℝô"" state="2"/>
2079 <transition type="goto" symbol="exp" state="8"/>
2089 <item rule-number="1" dot="1"/>
2090 <item rule-number="2" dot="1"/>
2091 <item rule-number="2" dot="3">
2093 <symbol>$end</symbol>
2094 <symbol>"+"</symbol>
2095 <symbol>"⊕"</symbol>
2098 <item rule-number="3" dot="1"/>
2099 <item rule-number="3" dot="3">
2101 <symbol>$end</symbol>
2102 <symbol>"+"</symbol>
2103 <symbol>"⊕"</symbol>
2109 <transition type="shift" symbol=""⊕"" state="6"/>
2113 <reduction symbol="$end" rule="2" enabled="true"/>
2114 <reduction symbol="$end" rule="3" enabled="false"/>
2115 <reduction symbol=""+"" rule="2" enabled="true"/>
2116 <reduction symbol=""+"" rule="3" enabled="false"/>
2117 <reduction symbol=""⊕"" rule="2" enabled="false"/>
2118 <reduction symbol=""⊕"" rule="3" enabled="false"/>
2119 <reduction symbol="$default" rule="2" enabled="true"/>
2123 <resolution rule="2" symbol=""+"" type="reduce">%left "+"</resolution>
2129 <item rule-number="1" dot="1"/>
2130 <item rule-number="1" dot="3">
2132 <symbol>$end</symbol>
2133 <symbol>"+"</symbol>
2134 <symbol>"⊕"</symbol>
2137 <item rule-number="2" dot="1"/>
2138 <item rule-number="3" dot="1"/>
2142 <transition type="shift" symbol=""+"" state="5"/>
2143 <transition type="shift" symbol=""⊕"" state="6"/>
2147 <reduction symbol=""+"" rule="1" enabled="false"/>
2148 <reduction symbol=""⊕"" rule="1" enabled="false"/>
2149 <reduction symbol="$default" rule="1" enabled="true"/>
2158 # Check HTML output.
2159 if test x"$XSLTPROC" != x""; then
2160 AT_CHECK([[$XSLTPROC \
2161 `]]AT_SET_ENV[[ bison --print-datadir`/xslt/xml2xhtml.xsl \
2163 sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/' \
2166 AT_CHECK([cat input.html], [],
2167 [[<?xml version="1.0" encoding="UTF-8"?>
2168 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2169 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="http://www.gnu.org/software/bison/">
2171 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
2172 <title>input.y - GNU Bison XML Automaton Report</title>
2173 <style type="text/css">
2175 font-family: "Nimbus Sans L", Arial, sans-serif;
2180 text-decoration: none;
2184 text-decoration: none;
2190 text-decoration: underline;
2196 font-family: monospace;
2200 list-style-type: decimal;
2203 list-style-type: lower-alpha;
2214 <body><h1>GNU Bison XML Automaton Report</h1><p>
2215 input grammar: <span class="i">input.y</span></p>
2217 <h3>Table of Contents</h3><ul id="menu"><li><a href="#reductions">Reductions</a><ul class="lower-alpha"><li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li><li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li><li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li><li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li></ul></li><li><a href="#conflicts">Conflicts</a></li><li><a href="#grammar">Grammar</a><ul class="lower-alpha"><li><a href="#grammar">Itemset</a></li><li><a href="#terminals">Terminal symbols</a></li><li><a href="#nonterminals">Nonterminal symbols</a></li></ul></li><li><a href="#automaton">Automaton</a></li></ul><h2><a name="reductions" id="reductions"></a> Reductions</h2><h3><a name="nonterminals_useless_in_grammar" id="nonterminals_useless_in_grammar"></a> Nonterminals useless in grammar</h3>
2219 <h3><a name="terminals_unused_in_grammar" id="terminals_unused_in_grammar"></a> Terminals unused in grammar</h3>
2221 <h3><a name="rules_useless_in_grammar" id="rules_useless_in_grammar"></a> Rules useless in grammar</h3>
2222 <h2><a name="rules_useless_in_parser" id="rules_useless_in_parser"></a> Rules useless in parser due to conflicts</h2>
2224 <a href="#rule_3"> 3</a> <span class="i">exp</span> → <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2227 <h2><a name="conflicts" id="conflicts"></a> Conflicts</h2>
2229 <p class="pre"><a href="#state_7">State 7</a> conflicts: 1 shift/reduce, 3 reduce/reduce
2230 <a href="#state_8">State 8</a> conflicts: 2 shift/reduce
2233 </p><h2><a name="grammar" id="grammar"></a> Grammar</h2>
2235 <a name="rule_0" id="rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">exp</span> <b>$end</b>
2237 <a name="rule_1" id="rule_1"> 1</a> <span class="i">exp</span> → <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span>
2238 <a name="rule_2" id="rule_2"> 2</a> | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2239 <a name="rule_3" id="rule_3"> 3</a> | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2240 <a name="rule_4" id="rule_4"> 4</a> | <b>"number"</b>
2241 <a name="rule_5" id="rule_5"> 5</a> | <b>"Ñùṃéℝô"</b>
2244 <h3><a name="terminals" id="terminals"></a> Terminals, with rules where they appear</h3>
2247 <li><b>$end</b> (0) <a href="#rule_0">0</a></li>
2248 <li><b>error</b> (256)</li>
2249 <li><b>"+"</b> (258) <a href="#rule_2">2</a> <a href="#rule_3">3</a></li>
2250 <li><b>"⊕"</b> (259) <a href="#rule_1">1</a></li>
2251 <li><b>"number"</b> (260) <a href="#rule_4">4</a></li>
2252 <li><b>"Ñùṃéℝô"</b> (261) <a href="#rule_5">5</a></li>
2255 <h3><a name="nonterminals" id="nonterminals"></a> Nonterminals, with rules where they appear</h3>
2258 <li><b>$accept</b> (7)
2260 <li>on left: <a href="#rule_0">0</a></li>
2265 <li>on left: <a href="#rule_1">1</a> <a href="#rule_2">2</a> <a href="#rule_3">3</a> <a href="#rule_4">4</a> <a href="#rule_5">5</a></li>
2266 <li>on right: <a href="#rule_0">0</a> <a href="#rule_1">1</a> <a href="#rule_2">2</a> <a href="#rule_3">3</a></li>
2269 </ul><h2><a name="automaton" id="automaton"></a> Automaton</h2>
2271 <h3><a name="state_0" id="state_0"></a>State 0</h3>
2273 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="dot">•</span> <span class="i">exp</span> <b>$end</b>
2274 <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="dot">•</span> <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span>
2275 <a href="#rule_2"> 2</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2276 <a href="#rule_3"> 3</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2277 <a href="#rule_4"> 4</a> | <span class="dot">•</span> <b>"number"</b>
2278 <a href="#rule_5"> 5</a> | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>
2280 "number" <a href="#state_1">shift, and go to state 1</a>
2281 "Ñùṃéℝô" <a href="#state_2">shift, and go to state 2</a>
2283 exp <a href="#state_3">go to state 3</a>
2286 <h3><a name="state_1" id="state_1"></a>State 1</h3>
2288 <p class="pre"> <a href="#rule_4"> 4</a> <span class="i">exp</span> → <b>"number"</b> <span class="dot">•</span>
2290 $default <a href="#rule_4">reduce using rule 4</a> (exp)
2293 <h3><a name="state_2" id="state_2"></a>State 2</h3>
2295 <p class="pre"> <a href="#rule_5"> 5</a> <span class="i">exp</span> → <b>"Ñùṃéℝô"</b> <span class="dot">•</span>
2297 $default <a href="#rule_5">reduce using rule 5</a> (exp)
2300 <h3><a name="state_3" id="state_3"></a>State 3</h3>
2302 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">exp</span> <span class="dot">•</span> <b>$end</b>
2303 <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="i">exp</span> <span class="dot">•</span> <b>"⊕"</b> <span class="i">exp</span>
2304 <a href="#rule_2"> 2</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2305 <a href="#rule_3"> 3</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2307 $end <a href="#state_4">shift, and go to state 4</a>
2308 "+" <a href="#state_5">shift, and go to state 5</a>
2309 "⊕" <a href="#state_6">shift, and go to state 6</a>
2312 <h3><a name="state_4" id="state_4"></a>State 4</h3>
2314 <p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">exp</span> <b>$end</b> <span class="dot">•</span>
2319 <h3><a name="state_5" id="state_5"></a>State 5</h3>
2321 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="dot">•</span> <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span>
2322 <a href="#rule_2"> 2</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2323 <a href="#rule_2"> 2</a> | <span class="i">exp</span> <b>"+"</b> <span class="dot">•</span> <span class="i">exp</span>
2324 <a href="#rule_3"> 3</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2325 <a href="#rule_3"> 3</a> | <span class="i">exp</span> <b>"+"</b> <span class="dot">•</span> <span class="i">exp</span>
2326 <a href="#rule_4"> 4</a> | <span class="dot">•</span> <b>"number"</b>
2327 <a href="#rule_5"> 5</a> | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>
2329 "number" <a href="#state_1">shift, and go to state 1</a>
2330 "Ñùṃéℝô" <a href="#state_2">shift, and go to state 2</a>
2332 exp <a href="#state_7">go to state 7</a>
2335 <h3><a name="state_6" id="state_6"></a>State 6</h3>
2337 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="dot">•</span> <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span>
2338 <a href="#rule_1"> 1</a> | <span class="i">exp</span> <b>"⊕"</b> <span class="dot">•</span> <span class="i">exp</span>
2339 <a href="#rule_2"> 2</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2340 <a href="#rule_3"> 3</a> | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
2341 <a href="#rule_4"> 4</a> | <span class="dot">•</span> <b>"number"</b>
2342 <a href="#rule_5"> 5</a> | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>
2344 "number" <a href="#state_1">shift, and go to state 1</a>
2345 "Ñùṃéℝô" <a href="#state_2">shift, and go to state 2</a>
2347 exp <a href="#state_8">go to state 8</a>
2350 <h3><a name="state_7" id="state_7"></a>State 7</h3>
2352 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="i">exp</span> <span class="dot">•</span> <b>"⊕"</b> <span class="i">exp</span>
2353 <a href="#rule_2"> 2</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2354 <a href="#rule_2"> 2</a> | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span> <span class="dot">•</span> [$end, "+", "⊕"]
2355 <a href="#rule_3"> 3</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2356 <a href="#rule_3"> 3</a> | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span> <span class="dot">•</span> [$end, "+", "⊕"]
2358 "⊕" <a href="#state_6">shift, and go to state 6</a>
2360 $end <a href="#rule_2">reduce using rule 2</a> (exp)
2361 $end [<a href="#rule_3">reduce using rule 3</a> (exp)]
2362 "+" <a href="#rule_2">reduce using rule 2</a> (exp)
2363 "+" [<a href="#rule_3">reduce using rule 3</a> (exp)]
2364 "⊕" [<a href="#rule_2">reduce using rule 2</a> (exp)]
2365 "⊕" [<a href="#rule_3">reduce using rule 3</a> (exp)]
2366 $default <a href="#rule_2">reduce using rule 2</a> (exp)
2368 Conflict between <a href="#rule_2">rule 2</a> and token "+" resolved as reduce (%left "+").
2371 <h3><a name="state_8" id="state_8"></a>State 8</h3>
2373 <p class="pre"> <a href="#rule_1"> 1</a> <span class="i">exp</span> → <span class="i">exp</span> <span class="dot">•</span> <b>"⊕"</b> <span class="i">exp</span>
2374 <a href="#rule_1"> 1</a> | <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span> <span class="dot">•</span> [$end, "+", "⊕"]
2375 <a href="#rule_2"> 2</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2376 <a href="#rule_3"> 3</a> | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
2378 "+" <a href="#state_5">shift, and go to state 5</a>
2379 "⊕" <a href="#state_6">shift, and go to state 6</a>
2381 "+" [<a href="#rule_1">reduce using rule 1</a> (exp)]
2382 "⊕" [<a href="#rule_1">reduce using rule 1</a> (exp)]
2383 $default <a href="#rule_1">reduce using rule 1</a> (exp)
2386 <div id="footer"><hr />This document was generated using
2387 <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
2388 GNU Bison VERSION</a>
2389 XML Automaton Report.<br />
2390 Verbatim copying and distribution of this entire page is
2391 permitted in any medium, provided this notice is preserved.</div></body>
2396 AT_BISON_OPTION_POPDEFS