# Bison Reports.                               -*- Autotest -*-

# Copyright (C) 2018-2020 Free Software Foundation, Inc.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

AT_BANNER([[Test reports.]])

## --------- ##
## Reports.  ##
## --------- ##

AT_SETUP([Reports])

AT_KEYWORDS([report])

AT_BISON_OPTION_PUSHDEFS
AT_DATA([input.yy],
[[%token
  END  0  "end of file"
  ASSIGN  ":="
  INCR    "incr"
;

%token <std::string> IDENTIFIER "identifier"
%type <std::string> id
%token <int> NUMBER "number"
%type  <int> exp

%%
%start unit;
unit: assignments exp  { driver.result = $2; };

assignments:
  %empty                 {}
| assignments assignment {};

assignment:
  id ":=" exp { driver.variables[$id] = $exp; };

id:
  "identifier";

exp:
  "incr" exp <int>{ $$ = 1; } <int>{ $$ = 10; } exp   { $$ = $2 + $3 + $4 + $5; }
| "(" exp ")"   { std::swap ($$, $2); }
| "identifier"  { $$ = driver.variables[$1]; }
| "number"      { std::swap ($$, $1); };
]])

AT_SKIP_IF([[test x"$XSLTPROC" = x]])
AT_BISON_CHECK([-o input.cc -v --graph=input.gv --html --xml input.yy])

# Check the contents of the report.
AT_CHECK([cat input.output], [],
[[Grammar

    0 $accept: unit "end of file"

    1 unit: assignments exp

    2 assignments: %empty
    3            | assignments assignment

    4 assignment: id ":=" exp

    5 id: "identifier"

    6 @1: %empty

    7 @2: %empty

    8 exp: "incr" exp @1 @2 exp
    9    | "(" exp ")"
   10    | "identifier"
   11    | "number"


Terminals, with rules where they appear

    "end of file" (0) 0
    error (256)
    ":=" (258) 4
    "incr" (259) 8
    "identifier" <std::string> (260) 5 10
    "number" <int> (261) 11
    "(" (262) 9
    ")" (263) 9


Nonterminals, with rules where they appear

    $accept (9)
        on left: 0
    unit (10)
        on left: 1
        on right: 0
    assignments (11)
        on left: 2 3
        on right: 1 3
    assignment (12)
        on left: 4
        on right: 3
    id <std::string> (13)
        on left: 5
        on right: 4
    exp <int> (14)
        on left: 8 9 10 11
        on right: 1 4 8 9
    @1 <int> (15)
        on left: 6
        on right: 8
    @2 <int> (16)
        on left: 7
        on right: 8


State 0

    0 $accept: . unit "end of file"

    $default  reduce using rule 2 (assignments)

    unit         go to state 1
    assignments  go to state 2


State 1

    0 $accept: unit . "end of file"

    "end of file"  shift, and go to state 3


State 2

    1 unit: assignments . exp
    3 assignments: assignments . assignment

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 5
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    assignment  go to state 8
    id          go to state 9
    exp         go to state 10


State 3

    0 $accept: unit "end of file" .

    $default  accept


State 4

    8 exp: "incr" . exp @1 @2 exp

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 12


State 5

    5 id: "identifier" .
   10 exp: "identifier" .

    "end of file"  reduce using rule 10 (exp)
    $default       reduce using rule 5 (id)


State 6

   11 exp: "number" .

    $default  reduce using rule 11 (exp)


State 7

    9 exp: "(" . exp ")"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 13


State 8

    3 assignments: assignments assignment .

    $default  reduce using rule 3 (assignments)


State 9

    4 assignment: id . ":=" exp

    ":="  shift, and go to state 14


State 10

    1 unit: assignments exp .

    $default  reduce using rule 1 (unit)


State 11

   10 exp: "identifier" .

    $default  reduce using rule 10 (exp)


State 12

    8 exp: "incr" exp . @1 @2 exp

    $default  reduce using rule 6 (@1)

    @1  go to state 15


State 13

    9 exp: "(" exp . ")"

    ")"  shift, and go to state 16


State 14

    4 assignment: id ":=" . exp

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 17


State 15

    8 exp: "incr" exp @1 . @2 exp

    $default  reduce using rule 7 (@2)

    @2  go to state 18


State 16

    9 exp: "(" exp ")" .

    $default  reduce using rule 9 (exp)


State 17

    4 assignment: id ":=" exp .

    $default  reduce using rule 4 (assignment)


State 18

    8 exp: "incr" exp @1 @2 . exp

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 19


State 19

    8 exp: "incr" exp @1 @2 exp .

    $default  reduce using rule 8 (exp)
]])


# Now generate verbose reports.
AT_SKIP_IF([[test x"$XSLTPROC" = x]])
AT_BISON_CHECK([-o input.cc -rall --graph=input.gv --html --xml input.yy])

# Check the contents of the report.
AT_CHECK([cat input.output], [],
[[Grammar

    0 $accept: unit "end of file"

    1 unit: assignments exp

    2 assignments: %empty
    3            | assignments assignment

    4 assignment: id ":=" exp

    5 id: "identifier"

    6 @1: %empty

    7 @2: %empty

    8 exp: "incr" exp @1 @2 exp
    9    | "(" exp ")"
   10    | "identifier"
   11    | "number"


Terminals, with rules where they appear

    "end of file" (0) 0
    error (256)
    ":=" (258) 4
    "incr" (259) 8
    "identifier" <std::string> (260) 5 10
    "number" <int> (261) 11
    "(" (262) 9
    ")" (263) 9


Nonterminals, with rules where they appear

    $accept (9)
        on left: 0
    unit (10)
        on left: 1
        on right: 0
    assignments (11)
        on left: 2 3
        on right: 1 3
    assignment (12)
        on left: 4
        on right: 3
    id <std::string> (13)
        on left: 5
        on right: 4
    exp <int> (14)
        on left: 8 9 10 11
        on right: 1 4 8 9
    @1 <int> (15)
        on left: 6
        on right: 8
    @2 <int> (16)
        on left: 7
        on right: 8


State 0

    0 $accept: . unit "end of file"
    1 unit: . assignments exp
    2 assignments: . %empty
    3            | . assignments assignment

    $default  reduce using rule 2 (assignments)

    unit         go to state 1
    assignments  go to state 2


State 1

    0 $accept: unit . "end of file"

    "end of file"  shift, and go to state 3


State 2

    1 unit: assignments . exp
    3 assignments: assignments . assignment
    4 assignment: . id ":=" exp
    5 id: . "identifier"
    8 exp: . "incr" exp @1 @2 exp
    9    | . "(" exp ")"
   10    | . "identifier"
   11    | . "number"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 5
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    assignment  go to state 8
    id          go to state 9
    exp         go to state 10


State 3

    0 $accept: unit "end of file" .

    $default  accept


State 4

    8 exp: . "incr" exp @1 @2 exp
    8    | "incr" . exp @1 @2 exp
    9    | . "(" exp ")"
   10    | . "identifier"
   11    | . "number"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 12


State 5

    5 id: "identifier" .  [":="]
   10 exp: "identifier" .  ["end of file"]

    "end of file"  reduce using rule 10 (exp)
    $default       reduce using rule 5 (id)


State 6

   11 exp: "number" .

    $default  reduce using rule 11 (exp)


State 7

    8 exp: . "incr" exp @1 @2 exp
    9    | . "(" exp ")"
    9    | "(" . exp ")"
   10    | . "identifier"
   11    | . "number"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 13


State 8

    3 assignments: assignments assignment .

    $default  reduce using rule 3 (assignments)


State 9

    4 assignment: id . ":=" exp

    ":="  shift, and go to state 14


State 10

    1 unit: assignments exp .

    $default  reduce using rule 1 (unit)


State 11

   10 exp: "identifier" .

    $default  reduce using rule 10 (exp)


State 12

    6 @1: . %empty
    8 exp: "incr" exp . @1 @2 exp

    $default  reduce using rule 6 (@1)

    @1  go to state 15


State 13

    9 exp: "(" exp . ")"

    ")"  shift, and go to state 16


State 14

    4 assignment: id ":=" . exp
    8 exp: . "incr" exp @1 @2 exp
    9    | . "(" exp ")"
   10    | . "identifier"
   11    | . "number"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 17


State 15

    7 @2: . %empty
    8 exp: "incr" exp @1 . @2 exp

    $default  reduce using rule 7 (@2)

    @2  go to state 18


State 16

    9 exp: "(" exp ")" .

    $default  reduce using rule 9 (exp)


State 17

    4 assignment: id ":=" exp .

    $default  reduce using rule 4 (assignment)


State 18

    8 exp: . "incr" exp @1 @2 exp
    8    | "incr" exp @1 @2 . exp
    9    | . "(" exp ")"
   10    | . "identifier"
   11    | . "number"

    "incr"        shift, and go to state 4
    "identifier"  shift, and go to state 11
    "number"      shift, and go to state 6
    "("           shift, and go to state 7

    exp  go to state 19


State 19

    8 exp: "incr" exp @1 @2 exp .

    $default  reduce using rule 8 (exp)
]])



AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
[[// Generated by GNU Bison VERSION.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.

digraph "input.yy"
{
  node [fontname = courier, shape = box, colorscheme = paired6]
  edge [fontname = courier]

  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"]
  0 -> 1 [style=dashed label="unit"]
  0 -> 2 [style=dashed label="assignments"]
  0 -> "0R2" [style=solid]
 "0R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
  1 [label="State 1\n\l  0 $accept: unit • \"end of file\"\l"]
  1 -> 3 [style=solid label="\"end of file\""]
  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"]
  2 -> 4 [style=solid label="\"incr\""]
  2 -> 5 [style=solid label="\"identifier\""]
  2 -> 6 [style=solid label="\"number\""]
  2 -> 7 [style=solid label="\"(\""]
  2 -> 8 [style=dashed label="assignment"]
  2 -> 9 [style=dashed label="id"]
  2 -> 10 [style=dashed label="exp"]
  3 [label="State 3\n\l  0 $accept: unit \"end of file\" •\l"]
  3 -> "3R0" [style=solid]
 "3R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
  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"]
  4 -> 4 [style=solid label="\"incr\""]
  4 -> 11 [style=solid label="\"identifier\""]
  4 -> 6 [style=solid label="\"number\""]
  4 -> 7 [style=solid label="\"(\""]
  4 -> 12 [style=dashed label="exp"]
  5 [label="State 5\n\l  5 id: \"identifier\" •  [\":=\"]\l 10 exp: \"identifier\" •  [\"end of file\"]\l"]
  5 -> "5R5" [style=solid]
 "5R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
  5 -> "5R10" [label="[\"end of file\"]", style=solid]
 "5R10" [label="R10", fillcolor=3, shape=diamond, style=filled]
  6 [label="State 6\n\l 11 exp: \"number\" •\l"]
  6 -> "6R11" [style=solid]
 "6R11" [label="R11", fillcolor=3, shape=diamond, style=filled]
  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"]
  7 -> 4 [style=solid label="\"incr\""]
  7 -> 11 [style=solid label="\"identifier\""]
  7 -> 6 [style=solid label="\"number\""]
  7 -> 7 [style=solid label="\"(\""]
  7 -> 13 [style=dashed label="exp"]
  8 [label="State 8\n\l  3 assignments: assignments assignment •\l"]
  8 -> "8R3" [style=solid]
 "8R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
  9 [label="State 9\n\l  4 assignment: id • \":=\" exp\l"]
  9 -> 14 [style=solid label="\":=\""]
  10 [label="State 10\n\l  1 unit: assignments exp •\l"]
  10 -> "10R1" [style=solid]
 "10R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
  11 [label="State 11\n\l 10 exp: \"identifier\" •\l"]
  11 -> "11R10" [style=solid]
 "11R10" [label="R10", fillcolor=3, shape=diamond, style=filled]
  12 [label="State 12\n\l  6 @1: • %empty\l  8 exp: \"incr\" exp • @1 @2 exp\l"]
  12 -> 15 [style=dashed label="@1"]
  12 -> "12R6" [style=solid]
 "12R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
  13 [label="State 13\n\l  9 exp: \"(\" exp • \")\"\l"]
  13 -> 16 [style=solid label="\")\""]
  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"]
  14 -> 4 [style=solid label="\"incr\""]
  14 -> 11 [style=solid label="\"identifier\""]
  14 -> 6 [style=solid label="\"number\""]
  14 -> 7 [style=solid label="\"(\""]
  14 -> 17 [style=dashed label="exp"]
  15 [label="State 15\n\l  7 @2: • %empty\l  8 exp: \"incr\" exp @1 • @2 exp\l"]
  15 -> 18 [style=dashed label="@2"]
  15 -> "15R7" [style=solid]
 "15R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
  16 [label="State 16\n\l  9 exp: \"(\" exp \")\" •\l"]
  16 -> "16R9" [style=solid]
 "16R9" [label="R9", fillcolor=3, shape=diamond, style=filled]
  17 [label="State 17\n\l  4 assignment: id \":=\" exp •\l"]
  17 -> "17R4" [style=solid]
 "17R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
  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"]
  18 -> 4 [style=solid label="\"incr\""]
  18 -> 11 [style=solid label="\"identifier\""]
  18 -> 6 [style=solid label="\"number\""]
  18 -> 7 [style=solid label="\"(\""]
  18 -> 19 [style=dashed label="exp"]
  19 [label="State 19\n\l  8 exp: \"incr\" exp @1 @2 exp •\l"]
  19 -> "19R8" [style=solid]
 "19R8" [label="R8", fillcolor=3, shape=diamond, style=filled]
}
]])


AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
[[<?xml version="1.0"?>

<bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">

  <filename>input.yy</filename>

  <grammar>
    <rules>
      <rule number="0" usefulness="useful">
        <lhs>$accept</lhs>
        <rhs>
          <symbol>unit</symbol>
          <symbol>&quot;end of file&quot;</symbol>
        </rhs>
      </rule>
      <rule number="1" usefulness="useful">
        <lhs>unit</lhs>
        <rhs>
          <symbol>assignments</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="2" usefulness="useful">
        <lhs>assignments</lhs>
        <rhs>
          <empty/>
        </rhs>
      </rule>
      <rule number="3" usefulness="useful">
        <lhs>assignments</lhs>
        <rhs>
          <symbol>assignments</symbol>
          <symbol>assignment</symbol>
        </rhs>
      </rule>
      <rule number="4" usefulness="useful">
        <lhs>assignment</lhs>
        <rhs>
          <symbol>id</symbol>
          <symbol>&quot;:=&quot;</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="5" usefulness="useful">
        <lhs>id</lhs>
        <rhs>
          <symbol>&quot;identifier&quot;</symbol>
        </rhs>
      </rule>
      <rule number="6" usefulness="useful">
        <lhs>@1</lhs>
        <rhs>
          <empty/>
        </rhs>
      </rule>
      <rule number="7" usefulness="useful">
        <lhs>@2</lhs>
        <rhs>
          <empty/>
        </rhs>
      </rule>
      <rule number="8" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;incr&quot;</symbol>
          <symbol>exp</symbol>
          <symbol>@1</symbol>
          <symbol>@2</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="9" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;(&quot;</symbol>
          <symbol>exp</symbol>
          <symbol>&quot;)&quot;</symbol>
        </rhs>
      </rule>
      <rule number="10" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;identifier&quot;</symbol>
        </rhs>
      </rule>
      <rule number="11" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;number&quot;</symbol>
        </rhs>
      </rule>
    </rules>
    <terminals>
      <terminal symbol-number="0" token-number="0" name="&quot;end of file&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="1" token-number="256" name="error" type="" usefulness="useful"/>
      <terminal symbol-number="3" token-number="258" name="&quot;:=&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="4" token-number="259" name="&quot;incr&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="5" token-number="260" name="&quot;identifier&quot;" type="std::string" usefulness="useful"/>
      <terminal symbol-number="6" token-number="261" name="&quot;number&quot;" type="int" usefulness="useful"/>
      <terminal symbol-number="7" token-number="262" name="&quot;(&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="8" token-number="263" name="&quot;)&quot;" type="" usefulness="useful"/>
    </terminals>
    <nonterminals>
      <nonterminal symbol-number="9" name="$accept" type="" usefulness="useful"/>
      <nonterminal symbol-number="10" name="unit" type="" usefulness="useful"/>
      <nonterminal symbol-number="11" name="assignments" type="" usefulness="useful"/>
      <nonterminal symbol-number="12" name="assignment" type="" usefulness="useful"/>
      <nonterminal symbol-number="13" name="id" type="std::string" usefulness="useful"/>
      <nonterminal symbol-number="14" name="exp" type="int" usefulness="useful"/>
      <nonterminal symbol-number="15" name="@1" type="int" usefulness="useful"/>
      <nonterminal symbol-number="16" name="@2" type="int" usefulness="useful"/>
    </nonterminals>
  </grammar>

  <automaton>

    <state number="0">
      <itemset>
        <item rule-number="0" dot="0"/>
        <item rule-number="1" dot="0"/>
        <item rule-number="2" dot="0"/>
        <item rule-number="3" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="goto" symbol="unit" state="1"/>
          <transition type="goto" symbol="assignments" state="2"/>
        </transitions>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="2" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="1">
      <itemset>
        <item rule-number="0" dot="1"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;end of file&quot;" state="3"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="2">
      <itemset>
        <item rule-number="1" dot="1"/>
        <item rule-number="3" dot="1"/>
        <item rule-number="4" dot="0"/>
        <item rule-number="5" dot="0"/>
        <item rule-number="8" dot="0"/>
        <item rule-number="9" dot="0"/>
        <item rule-number="10" dot="0"/>
        <item rule-number="11" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;incr&quot;" state="4"/>
          <transition type="shift" symbol="&quot;identifier&quot;" state="5"/>
          <transition type="shift" symbol="&quot;number&quot;" state="6"/>
          <transition type="shift" symbol="&quot;(&quot;" state="7"/>
          <transition type="goto" symbol="assignment" state="8"/>
          <transition type="goto" symbol="id" state="9"/>
          <transition type="goto" symbol="exp" state="10"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="3">
      <itemset>
        <item rule-number="0" dot="2"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="accept" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="4">
      <itemset>
        <item rule-number="8" dot="0"/>
        <item rule-number="8" dot="1"/>
        <item rule-number="9" dot="0"/>
        <item rule-number="10" dot="0"/>
        <item rule-number="11" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;incr&quot;" state="4"/>
          <transition type="shift" symbol="&quot;identifier&quot;" state="11"/>
          <transition type="shift" symbol="&quot;number&quot;" state="6"/>
          <transition type="shift" symbol="&quot;(&quot;" state="7"/>
          <transition type="goto" symbol="exp" state="12"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="5">
      <itemset>
        <item rule-number="5" dot="1">
          <lookaheads>
            <symbol>&quot;:=&quot;</symbol>
          </lookaheads>
        </item>
        <item rule-number="10" dot="1">
          <lookaheads>
            <symbol>&quot;end of file&quot;</symbol>
          </lookaheads>
        </item>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="&quot;end of file&quot;" rule="10" enabled="true"/>
          <reduction symbol="$default" rule="5" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="6">
      <itemset>
        <item rule-number="11" dot="1"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="11" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="7">
      <itemset>
        <item rule-number="8" dot="0"/>
        <item rule-number="9" dot="0"/>
        <item rule-number="9" dot="1"/>
        <item rule-number="10" dot="0"/>
        <item rule-number="11" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;incr&quot;" state="4"/>
          <transition type="shift" symbol="&quot;identifier&quot;" state="11"/>
          <transition type="shift" symbol="&quot;number&quot;" state="6"/>
          <transition type="shift" symbol="&quot;(&quot;" state="7"/>
          <transition type="goto" symbol="exp" state="13"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="8">
      <itemset>
        <item rule-number="3" dot="2"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="3" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="9">
      <itemset>
        <item rule-number="4" dot="1"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;:=&quot;" state="14"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="10">
      <itemset>
        <item rule-number="1" dot="2"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="1" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="11">
      <itemset>
        <item rule-number="10" dot="1"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="10" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="12">
      <itemset>
        <item rule-number="6" dot="0"/>
        <item rule-number="8" dot="2"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="goto" symbol="@1" state="15"/>
        </transitions>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="6" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="13">
      <itemset>
        <item rule-number="9" dot="2"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;)&quot;" state="16"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="14">
      <itemset>
        <item rule-number="4" dot="2"/>
        <item rule-number="8" dot="0"/>
        <item rule-number="9" dot="0"/>
        <item rule-number="10" dot="0"/>
        <item rule-number="11" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;incr&quot;" state="4"/>
          <transition type="shift" symbol="&quot;identifier&quot;" state="11"/>
          <transition type="shift" symbol="&quot;number&quot;" state="6"/>
          <transition type="shift" symbol="&quot;(&quot;" state="7"/>
          <transition type="goto" symbol="exp" state="17"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="15">
      <itemset>
        <item rule-number="7" dot="0"/>
        <item rule-number="8" dot="3"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="goto" symbol="@2" state="18"/>
        </transitions>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="7" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="16">
      <itemset>
        <item rule-number="9" dot="3"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="9" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="17">
      <itemset>
        <item rule-number="4" dot="3"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="4" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="18">
      <itemset>
        <item rule-number="8" dot="0"/>
        <item rule-number="8" dot="4"/>
        <item rule-number="9" dot="0"/>
        <item rule-number="10" dot="0"/>
        <item rule-number="11" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;incr&quot;" state="4"/>
          <transition type="shift" symbol="&quot;identifier&quot;" state="11"/>
          <transition type="shift" symbol="&quot;number&quot;" state="6"/>
          <transition type="shift" symbol="&quot;(&quot;" state="7"/>
          <transition type="goto" symbol="exp" state="19"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="19">
      <itemset>
        <item rule-number="8" dot="5"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="8" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>
  </automaton>
</bison-xml-report>
]])

# Check HTML output.
AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]], [],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="http://www.gnu.org/software/bison/">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>input.yy - GNU Bison XML Automaton Report</title>
    <style type="text/css">
      body {
        font-family: "Nimbus Sans L", Arial, sans-serif;
        font-size: 9pt;
      }
      a:link {
        color: #1f00ff;
        text-decoration: none;
      }
      a:visited {
        color: #1f00ff;
        text-decoration: none;
      }
      a:hover {
        color: red;
      }
      #menu a {
        text-decoration: underline;
      }
      .i {
        font-style: italic;
      }
      .pre {
        font-family: monospace;
        white-space: pre;
      }
      ol.decimal {
        list-style-type: decimal;
      }
      ol.lower-alpha {
        list-style-type: lower-alpha;
      }
      .dot {
        color: #cc0000;
      }
      #footer {
        margin-top: 3.5em;
        font-size: 7pt;
      }
      </style>
  </head>
  <body><h1>GNU Bison XML Automaton Report</h1><p>
    input grammar: <span class="i">input.yy</span></p>

<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>

<h3><a name="terminals_unused_in_grammar" id="terminals_unused_in_grammar"></a> Terminals unused in grammar</h3>

<h3><a name="rules_useless_in_grammar" id="rules_useless_in_grammar"></a> Rules useless in grammar</h3>
<h2><a name="conflicts" id="conflicts"></a> Conflicts</h2>

<h2><a name="grammar" id="grammar"></a> Grammar</h2>
<p class="pre">
  <a name="rule_0" id="rule_0">  0</a> <span class="i">$accept</span> → <span class="i">unit</span> <b>"end of file"</b>

  <a name="rule_1" id="rule_1">  1</a> <span class="i">unit</span> → <span class="i">assignments</span> <span class="i">exp</span>

  <a name="rule_2" id="rule_2">  2</a> <span class="i">assignments</span> → %empty
  <a name="rule_3" id="rule_3">  3</a>             | <span class="i">assignments</span> <span class="i">assignment</span>

  <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>

  <a name="rule_5" id="rule_5">  5</a> <span class="i">id</span> → <b>"identifier"</b>

  <a name="rule_6" id="rule_6">  6</a> <span class="i">@1</span> → %empty

  <a name="rule_7" id="rule_7">  7</a> <span class="i">@2</span> → %empty

  <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>
  <a name="rule_9" id="rule_9">  9</a>     | <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a name="rule_10" id="rule_10"> 10</a>     | <b>"identifier"</b>
  <a name="rule_11" id="rule_11"> 11</a>     | <b>"number"</b>
</p>

<h3><a name="terminals" id="terminals"></a> Terminals, with rules where they appear</h3>

<ul>
  <li><b>"end of file"</b> (0) <a href="#rule_0">0</a></li>
  <li><b>error</b> (256)</li>
  <li><b>":="</b> (258) <a href="#rule_4">4</a></li>
  <li><b>"incr"</b> (259) <a href="#rule_8">8</a></li>
  <li><b>"identifier"</b> &lt;std::string&gt; (260) <a href="#rule_5">5</a> <a href="#rule_10">10</a></li>
  <li><b>"number"</b> &lt;int&gt; (261) <a href="#rule_11">11</a></li>
  <li><b>"("</b> (262) <a href="#rule_9">9</a></li>
  <li><b>")"</b> (263) <a href="#rule_9">9</a></li>
</ul>

<h3><a name="nonterminals" id="nonterminals"></a> Nonterminals, with rules where they appear</h3>

<ul>
  <li><b>$accept</b> (9)
    <ul>
      <li>on left: <a href="#rule_0">0</a></li>
    </ul>
  </li>
  <li><b>unit</b> (10)
    <ul>
      <li>on left: <a href="#rule_1">1</a></li>
      <li>on right: <a href="#rule_0">0</a></li>
    </ul>
  </li>
  <li><b>assignments</b> (11)
    <ul>
      <li>on left: <a href="#rule_2">2</a> <a href="#rule_3">3</a></li>
      <li>on right: <a href="#rule_1">1</a> <a href="#rule_3">3</a></li>
    </ul>
  </li>
  <li><b>assignment</b> (12)
    <ul>
      <li>on left: <a href="#rule_4">4</a></li>
      <li>on right: <a href="#rule_3">3</a></li>
    </ul>
  </li>
  <li><b>id</b> &lt;std::string&gt; (13)
    <ul>
      <li>on left: <a href="#rule_5">5</a></li>
      <li>on right: <a href="#rule_4">4</a></li>
    </ul>
  </li>
  <li><b>exp</b> &lt;int&gt; (14)
    <ul>
      <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>
      <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>
    </ul>
  </li>
  <li><b>@1</b> &lt;int&gt; (15)
    <ul>
      <li>on left: <a href="#rule_6">6</a></li>
      <li>on right: <a href="#rule_8">8</a></li>
    </ul>
  </li>
  <li><b>@2</b> &lt;int&gt; (16)
    <ul>
      <li>on left: <a href="#rule_7">7</a></li>
      <li>on right: <a href="#rule_8">8</a></li>
    </ul>
  </li>
</ul><h2><a name="automaton" id="automaton"></a> Automaton</h2>

<h3><a name="state_0" id="state_0"></a>State 0</h3>

<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>
  <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>
  <a href="#rule_2">  2</a> <span class="i">assignments</span> → <span class="dot">•</span> %empty
  <a href="#rule_3">  3</a>             | <span class="dot">•</span> <span class="i">assignments</span> <span class="i">assignment</span>

    $default  <a href="#rule_2">reduce using rule 2</a> (assignments)

    unit         <a href="#state_1">go to state 1</a>
    assignments  <a href="#state_2">go to state 2</a>
</p>

<h3><a name="state_1" id="state_1"></a>State 1</h3>

<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>

    "end of file"  <a href="#state_3">shift, and go to state 3</a>
</p>

<h3><a name="state_2" id="state_2"></a>State 2</h3>

<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>
  <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>
  <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>
  <a href="#rule_5">  5</a> <span class="i">id</span> → <span class="dot">•</span> <b>"identifier"</b>
  <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>
  <a href="#rule_9">  9</a>     | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_10"> 10</a>     | <span class="dot">•</span> <b>"identifier"</b>
  <a href="#rule_11"> 11</a>     | <span class="dot">•</span> <b>"number"</b>

    "incr"        <a href="#state_4">shift, and go to state 4</a>
    "identifier"  <a href="#state_5">shift, and go to state 5</a>
    "number"      <a href="#state_6">shift, and go to state 6</a>
    "("           <a href="#state_7">shift, and go to state 7</a>

    assignment  <a href="#state_8">go to state 8</a>
    id          <a href="#state_9">go to state 9</a>
    exp         <a href="#state_10">go to state 10</a>
</p>

<h3><a name="state_3" id="state_3"></a>State 3</h3>

<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>

    $default  accept
</p>

<h3><a name="state_4" id="state_4"></a>State 4</h3>

<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>
  <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>
  <a href="#rule_9">  9</a>     | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_10"> 10</a>     | <span class="dot">•</span> <b>"identifier"</b>
  <a href="#rule_11"> 11</a>     | <span class="dot">•</span> <b>"number"</b>

    "incr"        <a href="#state_4">shift, and go to state 4</a>
    "identifier"  <a href="#state_11">shift, and go to state 11</a>
    "number"      <a href="#state_6">shift, and go to state 6</a>
    "("           <a href="#state_7">shift, and go to state 7</a>

    exp  <a href="#state_12">go to state 12</a>
</p>

<h3><a name="state_5" id="state_5"></a>State 5</h3>

<p class="pre">  <a href="#rule_5">  5</a> <span class="i">id</span> → <b>"identifier"</b> <span class="dot">•</span>  [":="]
  <a href="#rule_10"> 10</a> <span class="i">exp</span> → <b>"identifier"</b> <span class="dot">•</span>  ["end of file"]

    "end of file"  <a href="#rule_10">reduce using rule 10</a> (exp)
    $default       <a href="#rule_5">reduce using rule 5</a> (id)
</p>

<h3><a name="state_6" id="state_6"></a>State 6</h3>

<p class="pre">  <a href="#rule_11"> 11</a> <span class="i">exp</span> → <b>"number"</b> <span class="dot">•</span>

    $default  <a href="#rule_11">reduce using rule 11</a> (exp)
</p>

<h3><a name="state_7" id="state_7"></a>State 7</h3>

<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>
  <a href="#rule_9">  9</a>     | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_9">  9</a>     | <b>"("</b> <span class="dot">•</span> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_10"> 10</a>     | <span class="dot">•</span> <b>"identifier"</b>
  <a href="#rule_11"> 11</a>     | <span class="dot">•</span> <b>"number"</b>

    "incr"        <a href="#state_4">shift, and go to state 4</a>
    "identifier"  <a href="#state_11">shift, and go to state 11</a>
    "number"      <a href="#state_6">shift, and go to state 6</a>
    "("           <a href="#state_7">shift, and go to state 7</a>

    exp  <a href="#state_13">go to state 13</a>
</p>

<h3><a name="state_8" id="state_8"></a>State 8</h3>

<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>

    $default  <a href="#rule_3">reduce using rule 3</a> (assignments)
</p>

<h3><a name="state_9" id="state_9"></a>State 9</h3>

<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>

    ":="  <a href="#state_14">shift, and go to state 14</a>
</p>

<h3><a name="state_10" id="state_10"></a>State 10</h3>

<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>

    $default  <a href="#rule_1">reduce using rule 1</a> (unit)
</p>

<h3><a name="state_11" id="state_11"></a>State 11</h3>

<p class="pre">  <a href="#rule_10"> 10</a> <span class="i">exp</span> → <b>"identifier"</b> <span class="dot">•</span>

    $default  <a href="#rule_10">reduce using rule 10</a> (exp)
</p>

<h3><a name="state_12" id="state_12"></a>State 12</h3>

<p class="pre">  <a href="#rule_6">  6</a> <span class="i">@1</span> → <span class="dot">•</span> %empty
  <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>

    $default  <a href="#rule_6">reduce using rule 6</a> (@1)

    @1  <a href="#state_15">go to state 15</a>
</p>

<h3><a name="state_13" id="state_13"></a>State 13</h3>

<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>

    ")"  <a href="#state_16">shift, and go to state 16</a>
</p>

<h3><a name="state_14" id="state_14"></a>State 14</h3>

<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>
  <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>
  <a href="#rule_9">  9</a>     | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_10"> 10</a>     | <span class="dot">•</span> <b>"identifier"</b>
  <a href="#rule_11"> 11</a>     | <span class="dot">•</span> <b>"number"</b>

    "incr"        <a href="#state_4">shift, and go to state 4</a>
    "identifier"  <a href="#state_11">shift, and go to state 11</a>
    "number"      <a href="#state_6">shift, and go to state 6</a>
    "("           <a href="#state_7">shift, and go to state 7</a>

    exp  <a href="#state_17">go to state 17</a>
</p>

<h3><a name="state_15" id="state_15"></a>State 15</h3>

<p class="pre">  <a href="#rule_7">  7</a> <span class="i">@2</span> → <span class="dot">•</span> %empty
  <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>

    $default  <a href="#rule_7">reduce using rule 7</a> (@2)

    @2  <a href="#state_18">go to state 18</a>
</p>

<h3><a name="state_16" id="state_16"></a>State 16</h3>

<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>

    $default  <a href="#rule_9">reduce using rule 9</a> (exp)
</p>

<h3><a name="state_17" id="state_17"></a>State 17</h3>

<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>

    $default  <a href="#rule_4">reduce using rule 4</a> (assignment)
</p>

<h3><a name="state_18" id="state_18"></a>State 18</h3>

<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>
  <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>
  <a href="#rule_9">  9</a>     | <span class="dot">•</span> <b>"("</b> <span class="i">exp</span> <b>")"</b>
  <a href="#rule_10"> 10</a>     | <span class="dot">•</span> <b>"identifier"</b>
  <a href="#rule_11"> 11</a>     | <span class="dot">•</span> <b>"number"</b>

    "incr"        <a href="#state_4">shift, and go to state 4</a>
    "identifier"  <a href="#state_11">shift, and go to state 11</a>
    "number"      <a href="#state_6">shift, and go to state 6</a>
    "("           <a href="#state_7">shift, and go to state 7</a>

    exp  <a href="#state_19">go to state 19</a>
</p>

<h3><a name="state_19" id="state_19"></a>State 19</h3>

<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>

    $default  <a href="#rule_8">reduce using rule 8</a> (exp)
</p>

<div id="footer"><hr />This document was generated using
      <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
      GNU Bison VERSION</a>
      XML Automaton Report.<br />
      Verbatim copying and distribution of this entire page is
      permitted in any medium, provided this notice is preserved.</div></body>
</html>
]])

AT_BISON_OPTION_POPDEFS
AT_CLEANUP


## ------------------------ ##
## Reports with conflicts.  ##
## ------------------------ ##

AT_SETUP([Reports with conflicts])

AT_KEYWORDS([cex report])

# We need UTF-8 support for correct screen-width computation of UTF-8
# characters.  Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
AT_SKIP_IF([[test x = x"$locale"]])

AT_SKIP_IF([[test x"$XSLTPROC" = x]])

AT_BISON_OPTION_PUSHDEFS
AT_DATA([input.y],
[[%left "+"
%%
exp
: exp "⊕" exp
| exp "+" exp
| exp "+" exp
| "number"
| "Ñùṃéℝô"
]])

AT_CHECK([LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --html --xml input.y], [], [],
[[input.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
  Example: exp "+" exp • "⊕" exp
  Shift derivation
    exp
    ↳ 2: exp "+" exp
                 ↳ 1: exp • "⊕" exp
  Reduce derivation
    exp
    ↳ 1: exp                "⊕" exp
         ↳ 2: exp "+" exp •
input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterexamples]
  Example: exp "+" exp •
  First reduce derivation
    exp
    ↳ 2: exp "+" exp •
  Second reduce derivation
    exp
    ↳ 3: exp "+" exp •
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
  Example: exp "+" exp • "⊕" exp
  Shift derivation
    exp
    ↳ 2: exp "+" exp
                 ↳ 1: exp • "⊕" exp
  Reduce derivation
    exp
    ↳ 1: exp                "⊕" exp
         ↳ 3: exp "+" exp •
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
  Example: exp "⊕" exp • "⊕" exp
  Shift derivation
    exp
    ↳ 1: exp "⊕" exp
                 ↳ 1: exp • "⊕" exp
  Reduce derivation
    exp
    ↳ 1: exp                "⊕" exp
         ↳ 1: exp "⊕" exp •
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
  Example: exp "⊕" exp • "+" exp
  Shift derivation
    exp
    ↳ 1: exp "⊕" exp
                 ↳ 2: exp • "+" exp
  Reduce derivation
    exp
    ↳ 2: exp                "+" exp
         ↳ 1: exp "⊕" exp •
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
  Example: exp "⊕" exp • "+" exp
  Shift derivation
    exp
    ↳ 1: exp "⊕" exp
                 ↳ 3: exp • "+" exp
  Reduce derivation
    exp
    ↳ 2: exp                "+" exp
         ↳ 1: exp "⊕" exp •
input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother]
]])

# Check the contents of the report.
# FIXME: Avoid trailing white spaces.
AT_CHECK([sed -e 's/ *$//' input.output], [],
[[Rules useless in parser due to conflicts

    3 exp: exp "+" exp


State 7 conflicts: 1 shift/reduce, 3 reduce/reduce
State 8 conflicts: 2 shift/reduce


Grammar

    0 $accept: exp $end

    1 exp: exp "⊕" exp
    2    | exp "+" exp
    3    | exp "+" exp
    4    | "number"
    5    | "Ñùṃéℝô"


Terminals, with rules where they appear

    $end (0) 0
    error (256)
    "+" (258) 2 3
    "⊕" (259) 1
    "number" (260) 4
    "Ñùṃéℝô" (261) 5


Nonterminals, with rules where they appear

    $accept (7)
        on left: 0
    exp (8)
        on left: 1 2 3 4 5
        on right: 0 1 2 3


State 0

    0 $accept: • exp $end
    1 exp: • exp "⊕" exp
    2    | • exp "+" exp
    3    | • exp "+" exp
    4    | • "number"
    5    | • "Ñùṃéℝô"

    "number"  shift, and go to state 1
    "Ñùṃéℝô"  shift, and go to state 2

    exp  go to state 3


State 1

    4 exp: "number" •

    $default  reduce using rule 4 (exp)


State 2

    5 exp: "Ñùṃéℝô" •

    $default  reduce using rule 5 (exp)


State 3

    0 $accept: exp • $end
    1 exp: exp • "⊕" exp
    2    | exp • "+" exp
    3    | exp • "+" exp

    $end  shift, and go to state 4
    "+"   shift, and go to state 5
    "⊕"   shift, and go to state 6


State 4

    0 $accept: exp $end •

    $default  accept


State 5

    1 exp: • exp "⊕" exp
    2    | • exp "+" exp
    2    | exp "+" • exp
    3    | • exp "+" exp
    3    | exp "+" • exp
    4    | • "number"
    5    | • "Ñùṃéℝô"

    "number"  shift, and go to state 1
    "Ñùṃéℝô"  shift, and go to state 2

    exp  go to state 7


State 6

    1 exp: • exp "⊕" exp
    1    | exp "⊕" • exp
    2    | • exp "+" exp
    3    | • exp "+" exp
    4    | • "number"
    5    | • "Ñùṃéℝô"

    "number"  shift, and go to state 1
    "Ñùṃéℝô"  shift, and go to state 2

    exp  go to state 8


State 7

    1 exp: exp • "⊕" exp
    2    | exp • "+" exp
    2    | exp "+" exp •  [$end, "+", "⊕"]
    3    | exp • "+" exp
    3    | exp "+" exp •  [$end, "+", "⊕"]

    "⊕"  shift, and go to state 6

    $end      reduce using rule 2 (exp)
    $end      [reduce using rule 3 (exp)]
    "+"       reduce using rule 2 (exp)
    "+"       [reduce using rule 3 (exp)]
    "⊕"       [reduce using rule 2 (exp)]
    "⊕"       [reduce using rule 3 (exp)]
    $default  reduce using rule 2 (exp)

    Conflict between rule 2 and token "+" resolved as reduce (%left "+").

    shift/reduce conflict on token "⊕":
        2 exp: exp "+" exp •
        1 exp: exp • "⊕" exp
      Example: exp "+" exp • "⊕" exp
      Shift derivation
        exp
        ↳ 2: exp "+" exp
                     ↳ 1: exp • "⊕" exp
      Reduce derivation
        exp
        ↳ 1: exp                "⊕" exp
             ↳ 2: exp "+" exp •

    reduce/reduce conflict on tokens $end, "+", "⊕":
        2 exp: exp "+" exp •
        3 exp: exp "+" exp •
      Example: exp "+" exp •
      First reduce derivation
        exp
        ↳ 2: exp "+" exp •
      Second reduce derivation
        exp
        ↳ 3: exp "+" exp •

    shift/reduce conflict on token "⊕":
        3 exp: exp "+" exp •
        1 exp: exp • "⊕" exp
      Example: exp "+" exp • "⊕" exp
      Shift derivation
        exp
        ↳ 2: exp "+" exp
                     ↳ 1: exp • "⊕" exp
      Reduce derivation
        exp
        ↳ 1: exp                "⊕" exp
             ↳ 3: exp "+" exp •



State 8

    1 exp: exp • "⊕" exp
    1    | exp "⊕" exp •  [$end, "+", "⊕"]
    2    | exp • "+" exp
    3    | exp • "+" exp

    "+"  shift, and go to state 5
    "⊕"  shift, and go to state 6

    "+"       [reduce using rule 1 (exp)]
    "⊕"       [reduce using rule 1 (exp)]
    $default  reduce using rule 1 (exp)

    shift/reduce conflict on token "⊕":
        1 exp: exp "⊕" exp •
        1 exp: exp • "⊕" exp
      Example: exp "⊕" exp • "⊕" exp
      Shift derivation
        exp
        ↳ 1: exp "⊕" exp
                     ↳ 1: exp • "⊕" exp
      Reduce derivation
        exp
        ↳ 1: exp                "⊕" exp
             ↳ 1: exp "⊕" exp •

    shift/reduce conflict on token "+":
        1 exp: exp "⊕" exp •
        2 exp: exp • "+" exp
      Example: exp "⊕" exp • "+" exp
      Shift derivation
        exp
        ↳ 1: exp "⊕" exp
                     ↳ 2: exp • "+" exp
      Reduce derivation
        exp
        ↳ 2: exp                "+" exp
             ↳ 1: exp "⊕" exp •

    shift/reduce conflict on token "+":
        1 exp: exp "⊕" exp •
        3 exp: exp • "+" exp
      Example: exp "⊕" exp • "+" exp
      Shift derivation
        exp
        ↳ 1: exp "⊕" exp
                     ↳ 3: exp • "+" exp
      Reduce derivation
        exp
        ↳ 2: exp                "+" exp
             ↳ 1: exp "⊕" exp •

]])




AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
[[// Generated by GNU Bison VERSION.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.

digraph "input.y"
{
  node [fontname = courier, shape = box, colorscheme = paired6]
  edge [fontname = courier]

  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"]
  0 -> 1 [style=solid label="\"number\""]
  0 -> 2 [style=solid label="\"Ñùṃéℝô\""]
  0 -> 3 [style=dashed label="exp"]
  1 [label="State 1\n\l  4 exp: \"number\" •\l"]
  1 -> "1R4" [style=solid]
 "1R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
  2 [label="State 2\n\l  5 exp: \"Ñùṃéℝô\" •\l"]
  2 -> "2R5" [style=solid]
 "2R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
  3 [label="State 3\n\l  0 $accept: exp • $end\l  1 exp: exp • \"⊕\" exp\l  2    | exp • \"+\" exp\l  3    | exp • \"+\" exp\l"]
  3 -> 4 [style=solid label="$end"]
  3 -> 5 [style=solid label="\"+\""]
  3 -> 6 [style=solid label="\"⊕\""]
  4 [label="State 4\n\l  0 $accept: exp $end •\l"]
  4 -> "4R0" [style=solid]
 "4R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
  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"]
  5 -> 1 [style=solid label="\"number\""]
  5 -> 2 [style=solid label="\"Ñùṃéℝô\""]
  5 -> 7 [style=dashed label="exp"]
  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"]
  6 -> 1 [style=solid label="\"number\""]
  6 -> 2 [style=solid label="\"Ñùṃéℝô\""]
  6 -> 8 [style=dashed label="exp"]
  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"]
  7 -> 6 [style=solid label="\"⊕\""]
  7 -> "7R2d" [label="[\"⊕\"]", style=solid]
 "7R2d" [label="R2", fillcolor=5, shape=diamond, style=filled]
  7 -> "7R2" [style=solid]
 "7R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
  7 -> "7R3d" [label="[$end, \"+\", \"⊕\"]", style=solid]
 "7R3d" [label="R3", fillcolor=5, shape=diamond, style=filled]
  8 [label="State 8\n\l  1 exp: exp • \"⊕\" exp\l  1    | exp \"⊕\" exp •  [$end, \"+\", \"⊕\"]\l  2    | exp • \"+\" exp\l  3    | exp • \"+\" exp\l"]
  8 -> 5 [style=solid label="\"+\""]
  8 -> 6 [style=solid label="\"⊕\""]
  8 -> "8R1d" [label="[\"+\", \"⊕\"]", style=solid]
 "8R1d" [label="R1", fillcolor=5, shape=diamond, style=filled]
  8 -> "8R1" [style=solid]
 "8R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
}
]])


AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
[[<?xml version="1.0"?>

<bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">

  <filename>input.y</filename>

  <grammar>
    <rules>
      <rule number="0" usefulness="useful">
        <lhs>$accept</lhs>
        <rhs>
          <symbol>exp</symbol>
          <symbol>$end</symbol>
        </rhs>
      </rule>
      <rule number="1" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>exp</symbol>
          <symbol>&quot;⊕&quot;</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="2" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>exp</symbol>
          <symbol>&quot;+&quot;</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="3" usefulness="useless-in-parser">
        <lhs>exp</lhs>
        <rhs>
          <symbol>exp</symbol>
          <symbol>&quot;+&quot;</symbol>
          <symbol>exp</symbol>
        </rhs>
      </rule>
      <rule number="4" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;number&quot;</symbol>
        </rhs>
      </rule>
      <rule number="5" usefulness="useful">
        <lhs>exp</lhs>
        <rhs>
          <symbol>&quot;Ñùṃéℝô&quot;</symbol>
        </rhs>
      </rule>
    </rules>
    <terminals>
      <terminal symbol-number="0" token-number="0" name="$end" type="" usefulness="useful"/>
      <terminal symbol-number="1" token-number="256" name="error" type="" usefulness="useful"/>
      <terminal symbol-number="3" token-number="258" name="&quot;+&quot;" type="" usefulness="useful" prec="1" assoc="left"/>
      <terminal symbol-number="4" token-number="259" name="&quot;⊕&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="5" token-number="260" name="&quot;number&quot;" type="" usefulness="useful"/>
      <terminal symbol-number="6" token-number="261" name="&quot;Ñùṃéℝô&quot;" type="" usefulness="useful"/>
    </terminals>
    <nonterminals>
      <nonterminal symbol-number="7" name="$accept" type="" usefulness="useful"/>
      <nonterminal symbol-number="8" name="exp" type="" usefulness="useful"/>
    </nonterminals>
  </grammar>

  <automaton>

    <state number="0">
      <itemset>
        <item rule-number="0" dot="0"/>
        <item rule-number="1" dot="0"/>
        <item rule-number="2" dot="0"/>
        <item rule-number="3" dot="0"/>
        <item rule-number="4" dot="0"/>
        <item rule-number="5" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;number&quot;" state="1"/>
          <transition type="shift" symbol="&quot;Ñùṃéℝô&quot;" state="2"/>
          <transition type="goto" symbol="exp" state="3"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="1">
      <itemset>
        <item rule-number="4" dot="1"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="4" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="2">
      <itemset>
        <item rule-number="5" dot="1"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="5" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="3">
      <itemset>
        <item rule-number="0" dot="1"/>
        <item rule-number="1" dot="1"/>
        <item rule-number="2" dot="1"/>
        <item rule-number="3" dot="1"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="$end" state="4"/>
          <transition type="shift" symbol="&quot;+&quot;" state="5"/>
          <transition type="shift" symbol="&quot;⊕&quot;" state="6"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="4">
      <itemset>
        <item rule-number="0" dot="2"/>
      </itemset>
      <actions>
        <transitions/>
        <errors/>
        <reductions>
          <reduction symbol="$default" rule="accept" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="5">
      <itemset>
        <item rule-number="1" dot="0"/>
        <item rule-number="2" dot="0"/>
        <item rule-number="2" dot="2"/>
        <item rule-number="3" dot="0"/>
        <item rule-number="3" dot="2"/>
        <item rule-number="4" dot="0"/>
        <item rule-number="5" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;number&quot;" state="1"/>
          <transition type="shift" symbol="&quot;Ñùṃéℝô&quot;" state="2"/>
          <transition type="goto" symbol="exp" state="7"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="6">
      <itemset>
        <item rule-number="1" dot="0"/>
        <item rule-number="1" dot="2"/>
        <item rule-number="2" dot="0"/>
        <item rule-number="3" dot="0"/>
        <item rule-number="4" dot="0"/>
        <item rule-number="5" dot="0"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;number&quot;" state="1"/>
          <transition type="shift" symbol="&quot;Ñùṃéℝô&quot;" state="2"/>
          <transition type="goto" symbol="exp" state="8"/>
        </transitions>
        <errors/>
        <reductions/>
      </actions>
      <solved-conflicts/>
    </state>

    <state number="7">
      <itemset>
        <item rule-number="1" dot="1"/>
        <item rule-number="2" dot="1"/>
        <item rule-number="2" dot="3">
          <lookaheads>
            <symbol>$end</symbol>
            <symbol>&quot;+&quot;</symbol>
            <symbol>&quot;⊕&quot;</symbol>
          </lookaheads>
        </item>
        <item rule-number="3" dot="1"/>
        <item rule-number="3" dot="3">
          <lookaheads>
            <symbol>$end</symbol>
            <symbol>&quot;+&quot;</symbol>
            <symbol>&quot;⊕&quot;</symbol>
          </lookaheads>
        </item>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;⊕&quot;" state="6"/>
        </transitions>
        <errors/>
        <reductions>
          <reduction symbol="$end" rule="2" enabled="true"/>
          <reduction symbol="$end" rule="3" enabled="false"/>
          <reduction symbol="&quot;+&quot;" rule="2" enabled="true"/>
          <reduction symbol="&quot;+&quot;" rule="3" enabled="false"/>
          <reduction symbol="&quot;⊕&quot;" rule="2" enabled="false"/>
          <reduction symbol="&quot;⊕&quot;" rule="3" enabled="false"/>
          <reduction symbol="$default" rule="2" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts>
        <resolution rule="2" symbol="&quot;+&quot;" type="reduce">%left &quot;+&quot;</resolution>
      </solved-conflicts>
    </state>

    <state number="8">
      <itemset>
        <item rule-number="1" dot="1"/>
        <item rule-number="1" dot="3">
          <lookaheads>
            <symbol>$end</symbol>
            <symbol>&quot;+&quot;</symbol>
            <symbol>&quot;⊕&quot;</symbol>
          </lookaheads>
        </item>
        <item rule-number="2" dot="1"/>
        <item rule-number="3" dot="1"/>
      </itemset>
      <actions>
        <transitions>
          <transition type="shift" symbol="&quot;+&quot;" state="5"/>
          <transition type="shift" symbol="&quot;⊕&quot;" state="6"/>
        </transitions>
        <errors/>
        <reductions>
          <reduction symbol="&quot;+&quot;" rule="1" enabled="false"/>
          <reduction symbol="&quot;⊕&quot;" rule="1" enabled="false"/>
          <reduction symbol="$default" rule="1" enabled="true"/>
        </reductions>
      </actions>
      <solved-conflicts/>
    </state>
  </automaton>
</bison-xml-report>
]])


AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]], [],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="http://www.gnu.org/software/bison/">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>input.y - GNU Bison XML Automaton Report</title>
    <style type="text/css">
      body {
        font-family: "Nimbus Sans L", Arial, sans-serif;
        font-size: 9pt;
      }
      a:link {
        color: #1f00ff;
        text-decoration: none;
      }
      a:visited {
        color: #1f00ff;
        text-decoration: none;
      }
      a:hover {
        color: red;
      }
      #menu a {
        text-decoration: underline;
      }
      .i {
        font-style: italic;
      }
      .pre {
        font-family: monospace;
        white-space: pre;
      }
      ol.decimal {
        list-style-type: decimal;
      }
      ol.lower-alpha {
        list-style-type: lower-alpha;
      }
      .dot {
        color: #cc0000;
      }
      #footer {
        margin-top: 3.5em;
        font-size: 7pt;
      }
      </style>
  </head>
  <body><h1>GNU Bison XML Automaton Report</h1><p>
    input grammar: <span class="i">input.y</span></p>

<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>

<h3><a name="terminals_unused_in_grammar" id="terminals_unused_in_grammar"></a> Terminals unused in grammar</h3>

<h3><a name="rules_useless_in_grammar" id="rules_useless_in_grammar"></a> Rules useless in grammar</h3>
<h2><a name="rules_useless_in_parser" id="rules_useless_in_parser"></a> Rules useless in parser due to conflicts</h2>
<p class="pre">
  <a href="#rule_3">  3</a> <span class="i">exp</span> → <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
</p>

<h2><a name="conflicts" id="conflicts"></a> Conflicts</h2>

<p class="pre"><a href="#state_7">State 7</a> conflicts: 1 shift/reduce, 3 reduce/reduce
<a href="#state_8">State 8</a> conflicts: 2 shift/reduce


</p><h2><a name="grammar" id="grammar"></a> Grammar</h2>
<p class="pre">
  <a name="rule_0" id="rule_0">  0</a> <span class="i">$accept</span> → <span class="i">exp</span> <b>$end</b>

  <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>
  <a name="rule_2" id="rule_2">  2</a>     | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a name="rule_3" id="rule_3">  3</a>     | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a name="rule_4" id="rule_4">  4</a>     | <b>"number"</b>
  <a name="rule_5" id="rule_5">  5</a>     | <b>"Ñùṃéℝô"</b>
</p>

<h3><a name="terminals" id="terminals"></a> Terminals, with rules where they appear</h3>

<ul>
  <li><b>$end</b> (0) <a href="#rule_0">0</a></li>
  <li><b>error</b> (256)</li>
  <li><b>"+"</b> (258) <a href="#rule_2">2</a> <a href="#rule_3">3</a></li>
  <li><b>"⊕"</b> (259) <a href="#rule_1">1</a></li>
  <li><b>"number"</b> (260) <a href="#rule_4">4</a></li>
  <li><b>"Ñùṃéℝô"</b> (261) <a href="#rule_5">5</a></li>
</ul>

<h3><a name="nonterminals" id="nonterminals"></a> Nonterminals, with rules where they appear</h3>

<ul>
  <li><b>$accept</b> (7)
    <ul>
      <li>on left: <a href="#rule_0">0</a></li>
    </ul>
  </li>
  <li><b>exp</b> (8)
    <ul>
      <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>
      <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>
    </ul>
  </li>
</ul><h2><a name="automaton" id="automaton"></a> Automaton</h2>

<h3><a name="state_0" id="state_0"></a>State 0</h3>

<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>
  <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>
  <a href="#rule_2">  2</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_4">  4</a>     | <span class="dot">•</span> <b>"number"</b>
  <a href="#rule_5">  5</a>     | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>

    "number"  <a href="#state_1">shift, and go to state 1</a>
    "Ñùṃéℝô"  <a href="#state_2">shift, and go to state 2</a>

    exp  <a href="#state_3">go to state 3</a>
</p>

<h3><a name="state_1" id="state_1"></a>State 1</h3>

<p class="pre">  <a href="#rule_4">  4</a> <span class="i">exp</span> → <b>"number"</b> <span class="dot">•</span>

    $default  <a href="#rule_4">reduce using rule 4</a> (exp)
</p>

<h3><a name="state_2" id="state_2"></a>State 2</h3>

<p class="pre">  <a href="#rule_5">  5</a> <span class="i">exp</span> → <b>"Ñùṃéℝô"</b> <span class="dot">•</span>

    $default  <a href="#rule_5">reduce using rule 5</a> (exp)
</p>

<h3><a name="state_3" id="state_3"></a>State 3</h3>

<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>
  <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>
  <a href="#rule_2">  2</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>

    $end  <a href="#state_4">shift, and go to state 4</a>
    "+"   <a href="#state_5">shift, and go to state 5</a>
    "⊕"   <a href="#state_6">shift, and go to state 6</a>
</p>

<h3><a name="state_4" id="state_4"></a>State 4</h3>

<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>

    $default  accept
</p>

<h3><a name="state_5" id="state_5"></a>State 5</h3>

<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>
  <a href="#rule_2">  2</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_2">  2</a>     | <span class="i">exp</span> <b>"+"</b> <span class="dot">•</span> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="i">exp</span> <b>"+"</b> <span class="dot">•</span> <span class="i">exp</span>
  <a href="#rule_4">  4</a>     | <span class="dot">•</span> <b>"number"</b>
  <a href="#rule_5">  5</a>     | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>

    "number"  <a href="#state_1">shift, and go to state 1</a>
    "Ñùṃéℝô"  <a href="#state_2">shift, and go to state 2</a>

    exp  <a href="#state_7">go to state 7</a>
</p>

<h3><a name="state_6" id="state_6"></a>State 6</h3>

<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>
  <a href="#rule_1">  1</a>     | <span class="i">exp</span> <b>"⊕"</b> <span class="dot">•</span> <span class="i">exp</span>
  <a href="#rule_2">  2</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="dot">•</span> <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_4">  4</a>     | <span class="dot">•</span> <b>"number"</b>
  <a href="#rule_5">  5</a>     | <span class="dot">•</span> <b>"Ñùṃéℝô"</b>

    "number"  <a href="#state_1">shift, and go to state 1</a>
    "Ñùṃéℝô"  <a href="#state_2">shift, and go to state 2</a>

    exp  <a href="#state_8">go to state 8</a>
</p>

<h3><a name="state_7" id="state_7"></a>State 7</h3>

<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>
  <a href="#rule_2">  2</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_2">  2</a>     | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span> <span class="dot">•</span>  [$end, "+", "⊕"]
  <a href="#rule_3">  3</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="i">exp</span> <b>"+"</b> <span class="i">exp</span> <span class="dot">•</span>  [$end, "+", "⊕"]

    "⊕"  <a href="#state_6">shift, and go to state 6</a>

    $end      <a href="#rule_2">reduce using rule 2</a> (exp)
    $end      [<a href="#rule_3">reduce using rule 3</a> (exp)]
    "+"       <a href="#rule_2">reduce using rule 2</a> (exp)
    "+"       [<a href="#rule_3">reduce using rule 3</a> (exp)]
    "⊕"       [<a href="#rule_2">reduce using rule 2</a> (exp)]
    "⊕"       [<a href="#rule_3">reduce using rule 3</a> (exp)]
    $default  <a href="#rule_2">reduce using rule 2</a> (exp)

    Conflict between <a href="#rule_2">rule 2</a> and token "+" resolved as reduce (%left "+").
</p>

<h3><a name="state_8" id="state_8"></a>State 8</h3>

<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>
  <a href="#rule_1">  1</a>     | <span class="i">exp</span> <b>"⊕"</b> <span class="i">exp</span> <span class="dot">•</span>  [$end, "+", "⊕"]
  <a href="#rule_2">  2</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>
  <a href="#rule_3">  3</a>     | <span class="i">exp</span> <span class="dot">•</span> <b>"+"</b> <span class="i">exp</span>

    "+"  <a href="#state_5">shift, and go to state 5</a>
    "⊕"  <a href="#state_6">shift, and go to state 6</a>

    "+"       [<a href="#rule_1">reduce using rule 1</a> (exp)]
    "⊕"       [<a href="#rule_1">reduce using rule 1</a> (exp)]
    $default  <a href="#rule_1">reduce using rule 1</a> (exp)
</p>

<div id="footer"><hr />This document was generated using
      <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
      GNU Bison VERSION</a>
      XML Automaton Report.<br />
      Verbatim copying and distribution of this entire page is
      permitted in any medium, provided this notice is preserved.</div></body>
</html>
]])

AT_BISON_OPTION_POPDEFS
AT_CLEANUP
