Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit030517f49274e5bb4ff10971a18f9229b8eaaa41 (patch)
Author
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-10-24 21:52:24 +0300
Committer
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-10-25 18:21:33 +0300
Files7c657ba03a7694875f80dc0f84492f8a625da560
IPL-030517f49274e5bb4ff10971a18f9229b8eaaa41.tar
IPL-030517f49274e5bb4ff10971a18f9229b8eaaa41.tar.gz
IPL-030517f49274e5bb4ff10971a18f9229b8eaaa41.zip
Parent63f10cd40a27b109863895381a283b8229c5664f (diff)
added debug for the bison parser
7 files changed, 907 insertions, 25 deletions
-rw-r--r--demo/bison/calc/Makefile18
-rw-r--r--demo/bison/calc/parser.dot77
-rw-r--r--demo/bison/calc/parser.html334
-rw-r--r--demo/bison/calc/parser.svg459
-rw-r--r--demo/bison/calc/parser.tab.c41
-rw-r--r--demo/bison/calc/parser.tab.h2
-rw-r--r--demo/bison/calc/parser.y1
diff --git a/demo/bison/calc/Makefile b/demo/bison/calc/Makefile
index ba07ca1..4f417cf 100644
--- a/demo/bison/calc/Makefile
+++ b/demo/bison/calc/Makefile
@@ -1,13 +1,23 @@
all: calc
+BISON_DATA_DIR=$(shell bison --print-datadir)
+
lex.yy.c: lexer.lex
flex lexer.lex
parser.tab.c: parser.y
- bison ${DEBUG} -v -d parser.y
+ bison ${DEBUG} -x -d parser.y
+
+parser.tab.h: parser.tab.c
+
+parser.html: parser.tab.c
+ xsltproc ${BISON_DATA_DIR}/xslt/xml2xhtml.xsl parser.xml > parser.html
+
+parser.dot: parser.tab.c
+ xsltproc ${BISON_DATA_DIR}/xslt/xml2dot.xsl parser.xml > parser.dot
-parser.tab.h: parser.y
- bison ${DEBUG} -v -d parser.y
+parser.svg: parser.dot
+ dot -Tsvg parser.dot > parser.svg
calc: lex.yy.c parser.tab.c parser.tab.h
- ${CC} lex.yy.c parser.tab.c -o calc
+ ${CC} ${CFLAGS} lex.yy.c parser.tab.c -o calc
diff --git a/demo/bison/calc/parser.dot b/demo/bison/calc/parser.dot
new file mode 100644
index 0000000..ac06822
--- /dev/null
+++ b/demo/bison/calc/parser.dot
@@ -0,0 +1,77 @@
+// Generated by GNU Bison 3.0.4.
+// Report bugs to <bug-bison@gnu.org>.
+// Home page: <http://www.gnu.org/software/bison/>.
+
+digraph "parser.y"
+{
+ node [fontname = courier, shape = box, colorscheme = paired6]
+ edge [fontname = courier]
+
+ 0 [label="State 0\n\l 0 $accept: . input $end\l 1 input: . %empty [$end]\l 2 | . expr\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 5 | . expr PLUS expr\l 6 | . expr MINUS expr\l 7 | . expr MULT expr\l 8 | . expr DIV expr\l"]
+ 0 -> 1 [style=solid label="NUMBER"]
+ 0 -> 2 [style=solid label="'('"]
+ 0 -> 3 [style=dashed label="input"]
+ 0 -> 4 [style=dashed label="expr"]
+ 0 -> "0R1" [style=solid]
+ "0R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
+ 1 [label="State 1\n\l 3 expr: NUMBER .\l"]
+ 1 -> "1R3" [style=solid]
+ "1R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+ 2 [label="State 2\n\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 4 | '(' . expr ')'\l 5 | . expr PLUS expr\l 6 | . expr MINUS expr\l 7 | . expr MULT expr\l 8 | . expr DIV expr\l"]
+ 2 -> 1 [style=solid label="NUMBER"]
+ 2 -> 2 [style=solid label="'('"]
+ 2 -> 5 [style=dashed label="expr"]
+ 3 [label="State 3\n\l 0 $accept: input . $end\l"]
+ 3 -> 6 [style=solid label="$end"]
+ 4 [label="State 4\n\l 2 input: expr . [$end]\l 5 expr: expr . PLUS expr\l 6 | expr . MINUS expr\l 7 | expr . MULT expr\l 8 | expr . DIV expr\l"]
+ 4 -> 7 [style=solid label="PLUS"]
+ 4 -> 8 [style=solid label="MINUS"]
+ 4 -> 9 [style=solid label="MULT"]
+ 4 -> 10 [style=solid label="DIV"]
+ 4 -> "4R2" [style=solid]
+ "4R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+ 5 [label="State 5\n\l 4 expr: '(' expr . ')'\l 5 | expr . PLUS expr\l 6 | expr . MINUS expr\l 7 | expr . MULT expr\l 8 | expr . DIV expr\l"]
+ 5 -> 7 [style=solid label="PLUS"]
+ 5 -> 8 [style=solid label="MINUS"]
+ 5 -> 9 [style=solid label="MULT"]
+ 5 -> 10 [style=solid label="DIV"]
+ 5 -> 11 [style=solid label="')'"]
+ 6 [label="State 6\n\l 0 $accept: input $end .\l"]
+ 6 -> "6R0" [style=solid]
+ "6R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+ 7 [label="State 7\n\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 5 | . expr PLUS expr\l 5 | expr PLUS . expr\l 6 | . expr MINUS expr\l 7 | . expr MULT expr\l 8 | . expr DIV expr\l"]
+ 7 -> 1 [style=solid label="NUMBER"]
+ 7 -> 2 [style=solid label="'('"]
+ 7 -> 12 [style=dashed label="expr"]
+ 8 [label="State 8\n\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 5 | . expr PLUS expr\l 6 | . expr MINUS expr\l 6 | expr MINUS . expr\l 7 | . expr MULT expr\l 8 | . expr DIV expr\l"]
+ 8 -> 1 [style=solid label="NUMBER"]
+ 8 -> 2 [style=solid label="'('"]
+ 8 -> 13 [style=dashed label="expr"]
+ 9 [label="State 9\n\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 5 | . expr PLUS expr\l 6 | . expr MINUS expr\l 7 | . expr MULT expr\l 7 | expr MULT . expr\l 8 | . expr DIV expr\l"]
+ 9 -> 1 [style=solid label="NUMBER"]
+ 9 -> 2 [style=solid label="'('"]
+ 9 -> 14 [style=dashed label="expr"]
+ 10 [label="State 10\n\l 3 expr: . NUMBER\l 4 | . '(' expr ')'\l 5 | . expr PLUS expr\l 6 | . expr MINUS expr\l 7 | . expr MULT expr\l 8 | . expr DIV expr\l 8 | expr DIV . expr\l"]
+ 10 -> 1 [style=solid label="NUMBER"]
+ 10 -> 2 [style=solid label="'('"]
+ 10 -> 15 [style=dashed label="expr"]
+ 11 [label="State 11\n\l 4 expr: '(' expr ')' .\l"]
+ 11 -> "11R4" [style=solid]
+ "11R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
+ 12 [label="State 12\n\l 5 expr: expr . PLUS expr\l 5 | expr PLUS expr . [$end, PLUS, MINUS, ')']\l 6 | expr . MINUS expr\l 7 | expr . MULT expr\l 8 | expr . DIV expr\l"]
+ 12 -> 9 [style=solid label="MULT"]
+ 12 -> 10 [style=solid label="DIV"]
+ 12 -> "12R5" [style=solid]
+ "12R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
+ 13 [label="State 13\n\l 5 expr: expr . PLUS expr\l 6 | expr . MINUS expr\l 6 | expr MINUS expr . [$end, PLUS, MINUS, ')']\l 7 | expr . MULT expr\l 8 | expr . DIV expr\l"]
+ 13 -> 9 [style=solid label="MULT"]
+ 13 -> 10 [style=solid label="DIV"]
+ 13 -> "13R6" [style=solid]
+ "13R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
+ 14 [label="State 14\n\l 5 expr: expr . PLUS expr\l 6 | expr . MINUS expr\l 7 | expr . MULT expr\l 7 | expr MULT expr . [$end, PLUS, MINUS, MULT, DIV, ')']\l 8 | expr . DIV expr\l"]
+ 14 -> "14R7" [style=solid]
+ "14R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
+ 15 [label="State 15\n\l 5 expr: expr . PLUS expr\l 6 | expr . MINUS expr\l 7 | expr . MULT expr\l 8 | expr . DIV expr\l 8 | expr DIV expr . [$end, PLUS, MINUS, MULT, DIV, ')']\l"]
+ 15 -> "15R8" [style=solid]
+ "15R8" [label="R8", fillcolor=3, shape=diamond, style=filled]
+}
diff --git a/demo/bison/calc/parser.html b/demo/bison/calc/parser.html
new file mode 100644
index 0000000..724b703
--- /dev/null
+++ b/demo/bison/calc/parser.html
@@ -0,0 +1,334 @@
+<?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>parser.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;
+ }
+ .point {
+ 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">parser.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></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"></a> 0 <span class="i">$accept</span> → <span class="i">input</span> <b>$end</b>
+
+<a name="rule_1" id="rule_1"></a> 1 <span class="i">input</span> → %empty
+<a name="rule_2" id="rule_2"></a> 2 | <span class="i">expr</span>
+
+<a name="rule_3" id="rule_3"></a> 3 <span class="i">expr</span> → <b>NUMBER</b>
+<a name="rule_4" id="rule_4"></a> 4 | <b>'('</b> <span class="i">expr</span> <b>')'</b>
+<a name="rule_5" id="rule_5"></a> 5 | <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+<a name="rule_6" id="rule_6"></a> 6 | <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+<a name="rule_7" id="rule_7"></a> 7 | <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+<a name="rule_8" id="rule_8"></a> 8 | <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+</p>
+
+<h3><a name="terminals" id="terminals"></a> Terminals, with rules where they appear</h3>
+
+<p class="pre"><b>$end</b> (0) <a href="#rule_0">0</a>
+<b>'('</b> (40) <a href="#rule_4">4</a>
+<b>')'</b> (41) <a href="#rule_4">4</a>
+<b>error</b> (256)
+<b>NUMBER</b> (258) <a href="#rule_3">3</a>
+<b>PLUS</b> (259) <a href="#rule_5">5</a>
+<b>MINUS</b> (260) <a href="#rule_6">6</a>
+<b>MULT</b> (261) <a href="#rule_7">7</a>
+<b>DIV</b> (262) <a href="#rule_8">8</a>
+</p>
+
+<h3><a name="nonterminals" id="nonterminals"></a> Nonterminals, with rules where they appear</h3>
+
+<p class="pre"><b>$accept</b> (10)
+ on left: <a href="#rule_0">0</a>
+<b>input</b> (11)
+ on left: <a href="#rule_1">1</a> <a href="#rule_2">2</a>
+ on right: <a href="#rule_0">0</a>
+<b>expr</b> (12)
+ on left: <a href="#rule_3">3</a> <a href="#rule_4">4</a> <a href="#rule_5">5</a> <a href="#rule_6">6</a> <a href="#rule_7">7</a> <a href="#rule_8">8</a>
+ on right: <a href="#rule_2">2</a> <a href="#rule_4">4</a> <a href="#rule_5">5</a> <a href="#rule_6">6</a> <a href="#rule_7">7</a> <a href="#rule_8">8</a>
+</p><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="point">.</span> <span class="i">input</span> <b>$end</b>
+ <a href="#rule_1"> 1</a> <span class="i">input</span> → <span class="point">.</span> %empty [$end]
+ <a href="#rule_2"> 2</a> | <span class="point">.</span> <span class="i">expr</span>
+ <a href="#rule_3"> 3</a> <span class="i">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ $default <a href="#rule_1">reduce using rule 1</a> (input)
+
+ input <a href="#state_3">go to state 3</a>
+ expr <a href="#state_4">go to state 4</a>
+</p>
+
+<h3><a name="state_1" id="state_1"></a>state 1</h3>
+
+<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">expr</span> → <b>NUMBER</b> <span class="point">.</span>
+
+ $default <a href="#rule_3">reduce using rule 3</a> (expr)
+</p>
+
+<h3><a name="state_2" id="state_2"></a>state 2</h3>
+
+<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_4"> 4</a> | <b>'('</b> <span class="point">.</span> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ expr <a href="#state_5">go to state 5</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">input</span> <span class="point">.</span> <b>$end</b>
+
+ $end <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_2"> 2</a> <span class="i">input</span> → <span class="i">expr</span> <span class="point">.</span> [$end]
+ <a href="#rule_5"> 5</a> <span class="i">expr</span> → <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+
+ PLUS <a href="#state_7">shift, and go to state 7</a>
+ MINUS <a href="#state_8">shift, and go to state 8</a>
+ MULT <a href="#state_9">shift, and go to state 9</a>
+ DIV <a href="#state_10">shift, and go to state 10</a>
+
+ $default <a href="#rule_2">reduce using rule 2</a> (input)
+</p>
+
+<h3><a name="state_5" id="state_5"></a>state 5</h3>
+
+<p class="pre"> <a href="#rule_4"> 4</a> <span class="i">expr</span> → <b>'('</b> <span class="i">expr</span> <span class="point">.</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+
+ PLUS <a href="#state_7">shift, and go to state 7</a>
+ MINUS <a href="#state_8">shift, and go to state 8</a>
+ MULT <a href="#state_9">shift, and go to state 9</a>
+ DIV <a href="#state_10">shift, and go to state 10</a>
+ ')' <a href="#state_11">shift, and go to state 11</a>
+</p>
+
+<h3><a name="state_6" id="state_6"></a>state 6</h3>
+
+<p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span> → <span class="i">input</span> <b>$end</b> <span class="point">.</span>
+
+ $default accept
+</p>
+
+<h3><a name="state_7" id="state_7"></a>state 7</h3>
+
+<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_5"> 5</a> | <span class="i">expr</span> <b>PLUS</b> <span class="point">.</span> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ expr <a href="#state_12">go to state 12</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">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <b>MINUS</b> <span class="point">.</span> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ expr <a href="#state_13">go to state 13</a>
+</p>
+
+<h3><a name="state_9" id="state_9"></a>state 9</h3>
+
+<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <b>MULT</b> <span class="point">.</span> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ expr <a href="#state_14">go to state 14</a>
+</p>
+
+<h3><a name="state_10" id="state_10"></a>state 10</h3>
+
+<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">expr</span> → <span class="point">.</span> <b>NUMBER</b>
+ <a href="#rule_4"> 4</a> | <span class="point">.</span> <b>'('</b> <span class="i">expr</span> <b>')'</b>
+ <a href="#rule_5"> 5</a> | <span class="point">.</span> <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="point">.</span> <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="point">.</span> <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="point">.</span> <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <b>DIV</b> <span class="point">.</span> <span class="i">expr</span>
+
+ NUMBER <a href="#state_1">shift, and go to state 1</a>
+ '(' <a href="#state_2">shift, and go to state 2</a>
+
+ expr <a href="#state_15">go to state 15</a>
+</p>
+
+<h3><a name="state_11" id="state_11"></a>state 11</h3>
+
+<p class="pre"> <a href="#rule_4"> 4</a> <span class="i">expr</span> → <b>'('</b> <span class="i">expr</span> <b>')'</b> <span class="point">.</span>
+
+ $default <a href="#rule_4">reduce using rule 4</a> (expr)
+</p>
+
+<h3><a name="state_12" id="state_12"></a>state 12</h3>
+
+<p class="pre"> <a href="#rule_5"> 5</a> <span class="i">expr</span> → <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_5"> 5</a> | <span class="i">expr</span> <b>PLUS</b> <span class="i">expr</span> <span class="point">.</span> [$end, PLUS, MINUS, ')']
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+
+ MULT <a href="#state_9">shift, and go to state 9</a>
+ DIV <a href="#state_10">shift, and go to state 10</a>
+
+ $default <a href="#rule_5">reduce using rule 5</a> (expr)
+
+ Conflict between <a href="#rule_5">rule 5</a> and token PLUS resolved as reduce (%left PLUS).
+ Conflict between <a href="#rule_5">rule 5</a> and token MINUS resolved as reduce (%left MINUS).
+ Conflict between <a href="#rule_5">rule 5</a> and token MULT resolved as shift (PLUS &lt; MULT).
+ Conflict between <a href="#rule_5">rule 5</a> and token DIV resolved as shift (PLUS &lt; DIV).
+</p>
+
+<h3><a name="state_13" id="state_13"></a>state 13</h3>
+
+<p class="pre"> <a href="#rule_5"> 5</a> <span class="i">expr</span> → <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <b>MINUS</b> <span class="i">expr</span> <span class="point">.</span> [$end, PLUS, MINUS, ')']
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+
+ MULT <a href="#state_9">shift, and go to state 9</a>
+ DIV <a href="#state_10">shift, and go to state 10</a>
+
+ $default <a href="#rule_6">reduce using rule 6</a> (expr)
+
+ Conflict between <a href="#rule_6">rule 6</a> and token PLUS resolved as reduce (%left PLUS).
+ Conflict between <a href="#rule_6">rule 6</a> and token MINUS resolved as reduce (%left MINUS).
+ Conflict between <a href="#rule_6">rule 6</a> and token MULT resolved as shift (MINUS &lt; MULT).
+ Conflict between <a href="#rule_6">rule 6</a> and token DIV resolved as shift (MINUS &lt; DIV).
+</p>
+
+<h3><a name="state_14" id="state_14"></a>state 14</h3>
+
+<p class="pre"> <a href="#rule_5"> 5</a> <span class="i">expr</span> → <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <b>MULT</b> <span class="i">expr</span> <span class="point">.</span> [$end, PLUS, MINUS, MULT, DIV, ')']
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+
+ $default <a href="#rule_7">reduce using rule 7</a> (expr)
+
+ Conflict between <a href="#rule_7">rule 7</a> and token PLUS resolved as reduce (PLUS &lt; MULT).
+ Conflict between <a href="#rule_7">rule 7</a> and token MINUS resolved as reduce (MINUS &lt; MULT).
+ Conflict between <a href="#rule_7">rule 7</a> and token MULT resolved as reduce (%left MULT).
+ Conflict between <a href="#rule_7">rule 7</a> and token DIV resolved as reduce (%left DIV).
+</p>
+
+<h3><a name="state_15" id="state_15"></a>state 15</h3>
+
+<p class="pre"> <a href="#rule_5"> 5</a> <span class="i">expr</span> → <span class="i">expr</span> <span class="point">.</span> <b>PLUS</b> <span class="i">expr</span>
+ <a href="#rule_6"> 6</a> | <span class="i">expr</span> <span class="point">.</span> <b>MINUS</b> <span class="i">expr</span>
+ <a href="#rule_7"> 7</a> | <span class="i">expr</span> <span class="point">.</span> <b>MULT</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <span class="point">.</span> <b>DIV</b> <span class="i">expr</span>
+ <a href="#rule_8"> 8</a> | <span class="i">expr</span> <b>DIV</b> <span class="i">expr</span> <span class="point">.</span> [$end, PLUS, MINUS, MULT, DIV, ')']
+
+ $default <a href="#rule_8">reduce using rule 8</a> (expr)
+
+ Conflict between <a href="#rule_8">rule 8</a> and token PLUS resolved as reduce (PLUS &lt; DIV).
+ Conflict between <a href="#rule_8">rule 8</a> and token MINUS resolved as reduce (MINUS &lt; DIV).
+ Conflict between <a href="#rule_8">rule 8</a> and token MULT resolved as reduce (%left MULT).
+ Conflict between <a href="#rule_8">rule 8</a> and token DIV resolved as reduce (%left DIV).
+</p>
+
+<div id="footer"><hr />This document was generated using
+ <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
+ GNU Bison 3.0.4</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>
diff --git a/demo/bison/calc/parser.svg b/demo/bison/calc/parser.svg
new file mode 100644
index 0000000..67c6535
--- /dev/null
+++ b/demo/bison/calc/parser.svg
@@ -0,0 +1,459 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.38.0 (20140413.2041)
+ -->
+<!-- Title: parser.y Pages: 1 -->
+<svg width="1691pt" height="1335pt"
+ viewBox="0.00 0.00 1690.50 1335.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1331)">
+<title>parser.y</title>
+<polygon fill="white" stroke="none" points="-4,4 -4,-1331 1686.5,-1331 1686.5,4 -4,4"/>
+<!-- 0 -->
+<g id="node1" class="node"><title>0</title>
+<polygon fill="none" stroke="black" points="1211.5,-1327 972.5,-1327 972.5,-1153 1211.5,-1153 1211.5,-1327"/>
+<text text-anchor="middle" x="1092" y="-1311.8" font-family="Courier,monospace" font-size="14.00">State 0</text>
+<text text-anchor="start" x="980.5" y="-1280.8" font-family="Courier,monospace" font-size="14.00"> &#160;0 $accept: . input $end</text>
+<text text-anchor="start" x="980.5" y="-1265.8" font-family="Courier,monospace" font-size="14.00"> &#160;1 input: . %empty &#160;[$end]</text>
+<text text-anchor="start" x="980.5" y="-1250.8" font-family="Courier,monospace" font-size="14.00"> &#160;2 &#160;&#160;&#160;&#160;&#160;| . expr</text>
+<text text-anchor="start" x="980.5" y="-1235.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="980.5" y="-1220.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="980.5" y="-1205.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="980.5" y="-1190.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="980.5" y="-1175.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="980.5" y="-1160.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+</g>
+<!-- 1 -->
+<g id="node2" class="node"><title>1</title>
+<polygon fill="none" stroke="black" points="385.5,-157 220.5,-157 220.5,-103 385.5,-103 385.5,-157"/>
+<text text-anchor="middle" x="303" y="-141.8" font-family="Courier,monospace" font-size="14.00">State 1</text>
+<text text-anchor="start" x="228.5" y="-110.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: NUMBER .</text>
+</g>
+<!-- 0&#45;&gt;1 -->
+<g id="edge1" class="edge"><title>0&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M972.275,-1228.66C688.765,-1202.57 0,-1129.09 0,-1031 0,-1031 0,-1031 0,-309 0,-210.207 121.232,-165.176 210.328,-145.422"/>
+<polygon fill="black" stroke="black" points="211.159,-148.823 220.204,-143.305 209.692,-141.978 211.159,-148.823"/>
+<text text-anchor="middle" x="25" y="-666.3" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 2 -->
+<g id="node3" class="node"><title>2</title>
+<polygon fill="none" stroke="black" points="867.5,-1102 628.5,-1102 628.5,-958 867.5,-958 867.5,-1102"/>
+<text text-anchor="middle" x="748" y="-1086.8" font-family="Courier,monospace" font-size="14.00">State 2</text>
+<text text-anchor="start" x="636.5" y="-1055.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="636.5" y="-1040.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="636.5" y="-1025.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| &#39;(&#39; . expr &#39;)&#39;</text>
+<text text-anchor="start" x="636.5" y="-1010.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="636.5" y="-995.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="636.5" y="-980.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="636.5" y="-965.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+</g>
+<!-- 0&#45;&gt;2 -->
+<g id="edge2" class="edge"><title>0&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M972.168,-1166.54C940.62,-1147.47 906.485,-1126.83 874.593,-1107.54"/>
+<polygon fill="black" stroke="black" points="876.03,-1104.32 865.662,-1102.14 872.408,-1110.31 876.03,-1104.32"/>
+<text text-anchor="middle" x="932.5" y="-1123.8" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 3 -->
+<g id="node4" class="node"><title>3</title>
+<polygon fill="none" stroke="black" points="1367.5,-1057 1144.5,-1057 1144.5,-1003 1367.5,-1003 1367.5,-1057"/>
+<text text-anchor="middle" x="1256" y="-1041.8" font-family="Courier,monospace" font-size="14.00">State 3</text>
+<text text-anchor="start" x="1152.5" y="-1010.8" font-family="Courier,monospace" font-size="14.00"> &#160;0 $accept: input . $end</text>
+</g>
+<!-- 0&#45;&gt;3 -->
+<g id="edge3" class="edge"><title>0&#45;&gt;3</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M1159.89,-1152.9C1184.17,-1122.1 1210.15,-1089.15 1228.97,-1065.29"/>
+<polygon fill="black" stroke="black" points="1231.87,-1067.26 1235.31,-1057.24 1226.37,-1062.93 1231.87,-1067.26"/>
+<text text-anchor="middle" x="1205" y="-1123.8" font-family="Courier,monospace" font-size="14.00">input</text>
+</g>
+<!-- 4 -->
+<g id="node5" class="node"><title>4</title>
+<polygon fill="none" stroke="black" points="1305.5,-907 1066.5,-907 1066.5,-793 1305.5,-793 1305.5,-907"/>
+<text text-anchor="middle" x="1186" y="-891.8" font-family="Courier,monospace" font-size="14.00">State 4</text>
+<text text-anchor="start" x="1074.5" y="-860.8" font-family="Courier,monospace" font-size="14.00"> &#160;2 input: expr . &#160;[$end]</text>
+<text text-anchor="start" x="1074.5" y="-845.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 expr: expr . PLUS expr</text>
+<text text-anchor="start" x="1074.5" y="-830.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="1074.5" y="-815.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="1074.5" y="-800.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+</g>
+<!-- 0&#45;&gt;4 -->
+<g id="edge4" class="edge"><title>0&#45;&gt;4</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M1081.01,-1152.73C1077.02,-1095.73 1078.13,-1020.32 1101,-958 1106.52,-942.968 1115.03,-928.425 1124.58,-915.157"/>
+<polygon fill="black" stroke="black" points="1127.45,-917.17 1130.64,-907.069 1121.85,-912.971 1127.45,-917.17"/>
+<text text-anchor="middle" x="1118" y="-1026.3" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 0R1 -->
+<g id="node6" class="node"><title>0R1</title>
+<polygon fill="#b2df8a" stroke="black" points="1416,-1048 1385.83,-1030 1416,-1012 1446.17,-1030 1416,-1048"/>
+<text text-anchor="middle" x="1416" y="-1026.3" font-family="Courier,monospace" font-size="14.00">R1</text>
+</g>
+<!-- 0&#45;&gt;0R1 -->
+<g id="edge5" class="edge"><title>0&#45;&gt;0R1</title>
+<path fill="none" stroke="black" d="M1211.66,-1200.17C1266.5,-1177.93 1329.49,-1145.64 1376,-1102 1390.05,-1088.82 1400.47,-1069.57 1407.15,-1054.44"/>
+<polygon fill="black" stroke="black" points="1410.38,-1055.77 1410.99,-1045.2 1403.92,-1053.08 1410.38,-1055.77"/>
+</g>
+<!-- 1R3 -->
+<g id="node7" class="node"><title>1R3</title>
+<polygon fill="#b2df8a" stroke="black" points="303,-36 272.835,-18 303,-3.55271e-15 333.165,-18 303,-36"/>
+<text text-anchor="middle" x="303" y="-14.3" font-family="Courier,monospace" font-size="14.00">R3</text>
+</g>
+<!-- 1&#45;&gt;1R3 -->
+<g id="edge6" class="edge"><title>1&#45;&gt;1R3</title>
+<path fill="none" stroke="black" d="M303,-102.932C303,-85.8851 303,-63.6551 303,-46.3559"/>
+<polygon fill="black" stroke="black" points="306.5,-46.3123 303,-36.3123 299.5,-46.3123 306.5,-46.3123"/>
+</g>
+<!-- 2&#45;&gt;1 -->
+<g id="edge7" class="edge"><title>2&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M628.217,-1021.7C435.502,-1006.64 78,-963.531 78,-851 78,-851 78,-851 78,-309 78,-236.396 150.949,-188.763 213.773,-161.203"/>
+<polygon fill="black" stroke="black" points="215.531,-164.259 223.357,-157.117 212.785,-157.819 215.531,-164.259"/>
+<text text-anchor="middle" x="103" y="-568.8" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 2&#45;&gt;2 -->
+<g id="edge8" class="edge"><title>2&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M867.75,-1044.3C878.646,-1041.33 885.5,-1036.56 885.5,-1030 885.5,-1025.69 882.548,-1022.16 877.44,-1019.4"/>
+<polygon fill="black" stroke="black" points="878.34,-1016 867.75,-1015.7 875.842,-1022.53 878.34,-1016"/>
+<text text-anchor="middle" x="898" y="-1026.3" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 5 -->
+<g id="node8" class="node"><title>5</title>
+<polygon fill="none" stroke="black" points="867.5,-907 628.5,-907 628.5,-793 867.5,-793 867.5,-907"/>
+<text text-anchor="middle" x="748" y="-891.8" font-family="Courier,monospace" font-size="14.00">State 5</text>
+<text text-anchor="start" x="636.5" y="-860.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 expr: &#39;(&#39; expr . &#39;)&#39;</text>
+<text text-anchor="start" x="636.5" y="-845.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| expr . PLUS expr</text>
+<text text-anchor="start" x="636.5" y="-830.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="636.5" y="-815.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="636.5" y="-800.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+</g>
+<!-- 2&#45;&gt;5 -->
+<g id="edge9" class="edge"><title>2&#45;&gt;5</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M748,-957.882C748,-944.587 748,-930.736 748,-917.584"/>
+<polygon fill="black" stroke="black" points="751.5,-917.21 748,-907.211 744.5,-917.211 751.5,-917.21"/>
+<text text-anchor="middle" x="765" y="-928.8" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 6 -->
+<g id="node9" class="node"><title>6</title>
+<polygon fill="none" stroke="black" points="1682.5,-877 1459.5,-877 1459.5,-823 1682.5,-823 1682.5,-877"/>
+<text text-anchor="middle" x="1571" y="-861.8" font-family="Courier,monospace" font-size="14.00">State 6</text>
+<text text-anchor="start" x="1467.5" y="-830.8" font-family="Courier,monospace" font-size="14.00"> &#160;0 $accept: input $end .</text>
+</g>
+<!-- 3&#45;&gt;6 -->
+<g id="edge10" class="edge"><title>3&#45;&gt;6</title>
+<path fill="none" stroke="black" d="M1294.38,-1002.84C1317.5,-988.016 1348,-970.082 1377,-958 1405.86,-945.978 1416.67,-953.228 1445,-940 1476.69,-925.201 1508.84,-902.338 1532.73,-883.491"/>
+<polygon fill="black" stroke="black" points="1535.21,-885.994 1540.83,-877.011 1530.83,-880.53 1535.21,-885.994"/>
+<text text-anchor="middle" x="1489" y="-928.8" font-family="Courier,monospace" font-size="14.00">$end</text>
+</g>
+<!-- 7 -->
+<g id="node10" class="node"><title>7</title>
+<polygon fill="none" stroke="black" points="1202.5,-742 963.5,-742 963.5,-598 1202.5,-598 1202.5,-742"/>
+<text text-anchor="middle" x="1083" y="-726.8" font-family="Courier,monospace" font-size="14.00">State 7</text>
+<text text-anchor="start" x="971.5" y="-695.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="971.5" y="-680.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="971.5" y="-665.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="971.5" y="-650.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| expr PLUS . expr</text>
+<text text-anchor="start" x="971.5" y="-635.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="971.5" y="-620.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="971.5" y="-605.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+</g>
+<!-- 4&#45;&gt;7 -->
+<g id="edge11" class="edge"><title>4&#45;&gt;7</title>
+<path fill="none" stroke="black" d="M1153.41,-792.68C1145.75,-779.437 1137.44,-765.074 1129.3,-751.013"/>
+<polygon fill="black" stroke="black" points="1132.3,-749.212 1124.26,-742.31 1126.24,-752.718 1132.3,-749.212"/>
+<text text-anchor="middle" x="1158" y="-763.8" font-family="Courier,monospace" font-size="14.00">PLUS</text>
+</g>
+<!-- 8 -->
+<g id="node11" class="node"><title>8</title>
+<polygon fill="none" stroke="black" points="634.5,-742 395.5,-742 395.5,-598 634.5,-598 634.5,-742"/>
+<text text-anchor="middle" x="515" y="-726.8" font-family="Courier,monospace" font-size="14.00">State 8</text>
+<text text-anchor="start" x="403.5" y="-695.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="403.5" y="-680.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="403.5" y="-665.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="403.5" y="-650.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="403.5" y="-635.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr MINUS . expr</text>
+<text text-anchor="start" x="403.5" y="-620.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="403.5" y="-605.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+</g>
+<!-- 4&#45;&gt;8 -->
+<g id="edge12" class="edge"><title>4&#45;&gt;8</title>
+<path fill="none" stroke="black" d="M1066.5,-819.431C1026.17,-810.115 980.79,-800.349 939,-793 875.911,-781.905 855.91,-797.675 796,-775 784.932,-770.811 784.919,-764.563 774,-760 735.557,-743.936 721.833,-754.217 682,-742 669.639,-738.209 656.95,-733.808 644.355,-729.092"/>
+<polygon fill="black" stroke="black" points="645.339,-725.721 634.749,-725.428 642.845,-732.262 645.339,-725.721"/>
+<text text-anchor="middle" x="817" y="-763.8" font-family="Courier,monospace" font-size="14.00">MINUS</text>
+</g>
+<!-- 9 -->
+<g id="node12" class="node"><title>9</title>
+<polygon fill="none" stroke="black" points="1453.5,-382 1214.5,-382 1214.5,-238 1453.5,-238 1453.5,-382"/>
+<text text-anchor="middle" x="1334" y="-366.8" font-family="Courier,monospace" font-size="14.00">State 9</text>
+<text text-anchor="start" x="1222.5" y="-335.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="1222.5" y="-320.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="1222.5" y="-305.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="1222.5" y="-290.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="1222.5" y="-275.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="1222.5" y="-260.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr MULT . expr</text>
+<text text-anchor="start" x="1222.5" y="-245.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+</g>
+<!-- 4&#45;&gt;9 -->
+<g id="edge13" class="edge"><title>4&#45;&gt;9</title>
+<path fill="none" stroke="black" d="M1238.95,-792.893C1251.93,-777.228 1264.97,-759.643 1275,-742 1308.56,-682.982 1301.21,-661.206 1326,-598 1335.01,-575.019 1343.01,-571.176 1348,-547 1358.48,-496.27 1355.22,-438.202 1349.23,-392.36"/>
+<polygon fill="black" stroke="black" points="1352.65,-391.606 1347.82,-382.177 1345.72,-392.561 1352.65,-391.606"/>
+<text text-anchor="middle" x="1360" y="-568.8" font-family="Courier,monospace" font-size="14.00">MULT</text>
+</g>
+<!-- 10 -->
+<g id="node13" class="node"><title>10</title>
+<polygon fill="none" stroke="black" points="793.5,-382 554.5,-382 554.5,-238 793.5,-238 793.5,-382"/>
+<text text-anchor="middle" x="674" y="-366.8" font-family="Courier,monospace" font-size="14.00">State 10</text>
+<text text-anchor="start" x="562.5" y="-335.8" font-family="Courier,monospace" font-size="14.00"> &#160;3 expr: . NUMBER</text>
+<text text-anchor="start" x="562.5" y="-320.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 &#160;&#160;&#160;&#160;| . &#39;(&#39; expr &#39;)&#39;</text>
+<text text-anchor="start" x="562.5" y="-305.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| . expr PLUS expr</text>
+<text text-anchor="start" x="562.5" y="-290.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| . expr MINUS expr</text>
+<text text-anchor="start" x="562.5" y="-275.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| . expr MULT expr</text>
+<text text-anchor="start" x="562.5" y="-260.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| . expr DIV expr</text>
+<text text-anchor="start" x="562.5" y="-245.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr DIV . expr</text>
+</g>
+<!-- 4&#45;&gt;10 -->
+<g id="edge14" class="edge"><title>4&#45;&gt;10</title>
+<path fill="none" stroke="black" d="M1066.24,-816.698C1025.54,-800.328 983.057,-776.388 954,-742 911.205,-691.354 964.515,-642.098 915,-598 874.727,-562.132 832.873,-618.394 795,-580 748.696,-533.059 801.486,-493.382 775,-433 768.506,-418.194 759.667,-403.754 749.903,-390.292"/>
+<polygon fill="black" stroke="black" points="752.516,-387.943 743.716,-382.043 746.916,-392.143 752.516,-387.943"/>
+<text text-anchor="middle" x="807.5" y="-568.8" font-family="Courier,monospace" font-size="14.00">DIV</text>
+</g>
+<!-- 4R2 -->
+<g id="node14" class="node"><title>4R2</title>
+<polygon fill="#b2df8a" stroke="black" points="1365,-688 1334.83,-670 1365,-652 1395.17,-670 1365,-688"/>
+<text text-anchor="middle" x="1365" y="-666.3" font-family="Courier,monospace" font-size="14.00">R2</text>
+</g>
+<!-- 4&#45;&gt;4R2 -->
+<g id="edge15" class="edge"><title>4&#45;&gt;4R2</title>
+<path fill="none" stroke="black" d="M1302.03,-792.755C1308.86,-787.262 1315.27,-781.346 1321,-775 1341.31,-752.522 1353.13,-719.287 1359.31,-696.472"/>
+<polygon fill="black" stroke="black" points="1362.78,-697.053 1361.84,-686.5 1355.99,-695.335 1362.78,-697.053"/>
+</g>
+<!-- 5&#45;&gt;7 -->
+<g id="edge16" class="edge"><title>5&#45;&gt;7</title>
+<path fill="none" stroke="black" d="M815.9,-792.978C834.256,-778.526 851.837,-765.488 862,-760 883.889,-748.18 891.75,-750.848 915,-742 927.621,-737.197 940.7,-732.024 953.733,-726.737"/>
+<polygon fill="black" stroke="black" points="955.272,-729.889 963.209,-722.871 952.627,-723.408 955.272,-729.889"/>
+<text text-anchor="middle" x="879" y="-763.8" font-family="Courier,monospace" font-size="14.00">PLUS</text>
+</g>
+<!-- 5&#45;&gt;8 -->
+<g id="edge17" class="edge"><title>5&#45;&gt;8</title>
+<path fill="none" stroke="black" d="M632.296,-792.815C623.484,-787.181 614.941,-781.226 607,-775 597.27,-767.371 587.746,-758.625 578.736,-749.515"/>
+<polygon fill="black" stroke="black" points="581.088,-746.912 571.626,-742.146 576.05,-751.772 581.088,-746.912"/>
+<text text-anchor="middle" x="628" y="-763.8" font-family="Courier,monospace" font-size="14.00">MINUS</text>
+</g>
+<!-- 5&#45;&gt;9 -->
+<g id="edge18" class="edge"><title>5&#45;&gt;9</title>
+<path fill="none" stroke="black" d="M867.568,-794.344C869.049,-793.883 870.527,-793.434 872,-793 1018.14,-749.905 1089.79,-834.322 1211,-742 1266.71,-699.562 1241.23,-659.358 1275,-598 1283.5,-582.557 1285.82,-578.632 1297,-565 1304.17,-556.251 1310.25,-557.27 1315,-547 1337.21,-498.94 1341.88,-439.501 1341.04,-392.299"/>
+<polygon fill="black" stroke="black" points="1344.53,-392.019 1340.77,-382.115 1337.53,-392.204 1344.53,-392.019"/>
+<text text-anchor="middle" x="1314" y="-568.8" font-family="Courier,monospace" font-size="14.00">MULT</text>
+</g>
+<!-- 5&#45;&gt;10 -->
+<g id="edge19" class="edge"><title>5&#45;&gt;10</title>
+<path fill="none" stroke="black" d="M705.65,-792.823C696.047,-777.158 687.166,-759.591 682,-742 663.436,-678.784 666.624,-498.647 670.424,-392.323"/>
+<polygon fill="black" stroke="black" points="673.923,-392.392 670.793,-382.271 666.928,-392.135 673.923,-392.392"/>
+<text text-anchor="middle" x="680.5" y="-568.8" font-family="Courier,monospace" font-size="14.00">DIV</text>
+</g>
+<!-- 11 -->
+<g id="node15" class="node"><title>11</title>
+<polygon fill="none" stroke="black" points="906.5,-697 691.5,-697 691.5,-643 906.5,-643 906.5,-697"/>
+<text text-anchor="middle" x="799" y="-681.8" font-family="Courier,monospace" font-size="14.00">State 11</text>
+<text text-anchor="start" x="699.5" y="-650.8" font-family="Courier,monospace" font-size="14.00"> &#160;4 expr: &#39;(&#39; expr &#39;)&#39; .</text>
+</g>
+<!-- 5&#45;&gt;11 -->
+<g id="edge20" class="edge"><title>5&#45;&gt;11</title>
+<path fill="none" stroke="black" d="M744.387,-792.872C744.861,-781.838 746.203,-770.449 749,-760 754.095,-740.966 764.195,-721.678 773.992,-705.947"/>
+<polygon fill="black" stroke="black" points="777.204,-707.425 779.685,-697.125 771.322,-703.629 777.204,-707.425"/>
+<text text-anchor="middle" x="761.5" y="-763.8" font-family="Courier,monospace" font-size="14.00">&#39;)&#39;</text>
+</g>
+<!-- 6R0 -->
+<g id="node16" class="node"><title>6R0</title>
+<polygon fill="#a6cee3" stroke="black" points="1571,-688 1533.13,-670 1571,-652 1608.87,-670 1571,-688"/>
+<text text-anchor="middle" x="1571" y="-666.3" font-family="Courier,monospace" font-size="14.00">Acc</text>
+</g>
+<!-- 6&#45;&gt;6R0 -->
+<g id="edge21" class="edge"><title>6&#45;&gt;6R0</title>
+<path fill="none" stroke="black" d="M1571,-822.735C1571,-789.401 1571,-732.177 1571,-698.339"/>
+<polygon fill="black" stroke="black" points="1574.5,-698.234 1571,-688.234 1567.5,-698.234 1574.5,-698.234"/>
+</g>
+<!-- 7&#45;&gt;1 -->
+<g id="edge22" class="edge"><title>7&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M963.212,-605.474C958.413,-602.947 953.662,-600.448 949,-598 905.529,-575.172 879.693,-586.844 851,-547 769.743,-434.164 897.634,-338.94 802,-238 798.474,-234.278 538.946,-179.953 395.625,-150.181"/>
+<polygon fill="black" stroke="black" points="396.015,-146.687 385.512,-148.081 394.592,-153.541 396.015,-146.687"/>
+<text text-anchor="middle" x="855" y="-403.8" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 7&#45;&gt;2 -->
+<g id="edge23" class="edge"><title>7&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M1023.46,-742.173C982.935,-789.788 927.504,-853.32 876,-907 862.119,-921.468 846.989,-936.495 832.151,-950.853"/>
+<polygon fill="black" stroke="black" points="829.669,-948.384 824.897,-957.843 834.527,-953.424 829.669,-948.384"/>
+<text text-anchor="middle" x="991.5" y="-846.3" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 12 -->
+<g id="node17" class="node"><title>12</title>
+<polygon fill="none" stroke="black" points="1306,-547 860,-547 860,-433 1306,-433 1306,-547"/>
+<text text-anchor="middle" x="1083" y="-531.8" font-family="Courier,monospace" font-size="14.00">State 12</text>
+<text text-anchor="start" x="868" y="-500.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 expr: expr . PLUS expr</text>
+<text text-anchor="start" x="868" y="-485.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 &#160;&#160;&#160;&#160;| expr PLUS expr . &#160;[$end, PLUS, MINUS, &#39;)&#39;]</text>
+<text text-anchor="start" x="868" y="-470.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="868" y="-455.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="868" y="-440.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+</g>
+<!-- 7&#45;&gt;12 -->
+<g id="edge24" class="edge"><title>7&#45;&gt;12</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M1083,-597.882C1083,-584.587 1083,-570.736 1083,-557.584"/>
+<polygon fill="black" stroke="black" points="1086.5,-557.21 1083,-547.211 1079.5,-557.211 1086.5,-557.21"/>
+<text text-anchor="middle" x="1100" y="-568.8" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 8&#45;&gt;1 -->
+<g id="edge25" class="edge"><title>8&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M395.404,-658.064C322.135,-644.484 233.722,-614.227 187,-547 101.816,-424.43 219.268,-240.923 275.71,-165.376"/>
+<polygon fill="black" stroke="black" points="278.706,-167.218 281.949,-157.132 273.124,-162.994 278.706,-167.218"/>
+<text text-anchor="middle" x="187" y="-403.8" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 8&#45;&gt;2 -->
+<g id="edge26" class="edge"><title>8&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M527.619,-742.222C538.956,-791.783 559.314,-857.575 594,-907 605.096,-922.811 618.818,-937.596 633.462,-951.037"/>
+<polygon fill="black" stroke="black" points="631.405,-953.892 641.195,-957.941 636.067,-948.67 631.405,-953.892"/>
+<text text-anchor="middle" x="606.5" y="-846.3" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 13 -->
+<g id="node18" class="node"><title>13</title>
+<polygon fill="none" stroke="black" points="650,-547 196,-547 196,-433 650,-433 650,-547"/>
+<text text-anchor="middle" x="423" y="-531.8" font-family="Courier,monospace" font-size="14.00">State 13</text>
+<text text-anchor="start" x="204" y="-500.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 expr: expr . PLUS expr</text>
+<text text-anchor="start" x="204" y="-485.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="204" y="-470.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr MINUS expr . &#160;[$end, PLUS, MINUS, &#39;)&#39;]</text>
+<text text-anchor="start" x="204" y="-455.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="204" y="-440.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+</g>
+<!-- 8&#45;&gt;13 -->
+<g id="edge27" class="edge"><title>8&#45;&gt;13</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M478.243,-597.882C471.167,-584.192 463.787,-569.913 456.81,-556.414"/>
+<polygon fill="black" stroke="black" points="459.753,-554.487 452.053,-547.211 453.535,-557.701 459.753,-554.487"/>
+<text text-anchor="middle" x="486" y="-568.8" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 9&#45;&gt;1 -->
+<g id="edge28" class="edge"><title>9&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M1214.47,-263.922C1184.62,-254.071 1152.44,-244.623 1122,-238 883.418,-186.082 816.785,-221.01 575,-187 514.786,-178.53 447.884,-164.814 395.498,-153.076"/>
+<polygon fill="black" stroke="black" points="396.081,-149.62 385.556,-150.833 394.541,-156.448 396.081,-149.62"/>
+<text text-anchor="middle" x="1045" y="-208.8" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 9&#45;&gt;2 -->
+<g id="edge29" class="edge"><title>9&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M1393.5,-382.151C1413.58,-413.024 1431,-450.815 1431,-489 1431,-851 1431,-851 1431,-851 1431,-908.649 1368.56,-888.387 1314,-907 1211.61,-941.927 1181.75,-935.223 1076,-958 1010.58,-972.09 937.84,-987.828 877.514,-1000.9"/>
+<polygon fill="black" stroke="black" points="876.59,-997.519 867.558,-1003.06 878.073,-1004.36 876.59,-997.519"/>
+<text text-anchor="middle" x="1443.5" y="-666.3" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 14 -->
+<g id="node19" class="node"><title>14</title>
+<polygon fill="none" stroke="black" points="1666,-187 1130,-187 1130,-73 1666,-73 1666,-187"/>
+<text text-anchor="middle" x="1398" y="-171.8" font-family="Courier,monospace" font-size="14.00">State 14</text>
+<text text-anchor="start" x="1138" y="-140.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 expr: expr . PLUS expr</text>
+<text text-anchor="start" x="1138" y="-125.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="1138" y="-110.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="1138" y="-95.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr MULT expr . &#160;[$end, PLUS, MINUS, MULT, DIV, &#39;)&#39;]</text>
+<text text-anchor="start" x="1138" y="-80.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+</g>
+<!-- 9&#45;&gt;14 -->
+<g id="edge30" class="edge"><title>9&#45;&gt;14</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M1359.57,-237.882C1364.45,-224.324 1369.53,-210.188 1374.34,-196.804"/>
+<polygon fill="black" stroke="black" points="1377.7,-197.805 1377.79,-187.211 1371.11,-195.437 1377.7,-197.805"/>
+<text text-anchor="middle" x="1387" y="-208.8" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 10&#45;&gt;1 -->
+<g id="edge31" class="edge"><title>10&#45;&gt;1</title>
+<path fill="none" stroke="black" d="M554.315,-251.577C491.916,-221.639 418.101,-186.224 366.678,-161.552"/>
+<polygon fill="black" stroke="black" points="367.874,-158.244 357.344,-157.074 364.846,-164.555 367.874,-158.244"/>
+<text text-anchor="middle" x="514" y="-208.8" font-family="Courier,monospace" font-size="14.00">NUMBER</text>
+</g>
+<!-- 10&#45;&gt;2 -->
+<g id="edge32" class="edge"><title>10&#45;&gt;2</title>
+<path fill="none" stroke="black" d="M554.4,-357.176C524.623,-366.963 492.487,-376.106 462,-382 428.56,-388.464 179.365,-375.22 156,-400 151.426,-404.85 155.233,-408.378 156,-415 187.858,-689.999 315.67,-742.049 538,-907 563.361,-925.816 591.857,-944.064 619.482,-960.467"/>
+<polygon fill="black" stroke="black" points="618.023,-963.669 628.416,-965.726 621.574,-957.636 618.023,-963.669"/>
+<text text-anchor="middle" x="329.5" y="-666.3" font-family="Courier,monospace" font-size="14.00">&#39;(&#39;</text>
+</g>
+<!-- 15 -->
+<g id="node20" class="node"><title>15</title>
+<polygon fill="none" stroke="black" points="1112,-187 584,-187 584,-73 1112,-73 1112,-187"/>
+<text text-anchor="middle" x="848" y="-171.8" font-family="Courier,monospace" font-size="14.00">State 15</text>
+<text text-anchor="start" x="592" y="-140.8" font-family="Courier,monospace" font-size="14.00"> &#160;5 expr: expr . PLUS expr</text>
+<text text-anchor="start" x="592" y="-125.8" font-family="Courier,monospace" font-size="14.00"> &#160;6 &#160;&#160;&#160;&#160;| expr . MINUS expr</text>
+<text text-anchor="start" x="592" y="-110.8" font-family="Courier,monospace" font-size="14.00"> &#160;7 &#160;&#160;&#160;&#160;| expr . MULT expr</text>
+<text text-anchor="start" x="592" y="-95.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr . DIV expr</text>
+<text text-anchor="start" x="592" y="-80.8" font-family="Courier,monospace" font-size="14.00"> &#160;8 &#160;&#160;&#160;&#160;| expr DIV expr . &#160;[$end, PLUS, MINUS, MULT, DIV, &#39;)&#39;]</text>
+</g>
+<!-- 10&#45;&gt;15 -->
+<g id="edge33" class="edge"><title>10&#45;&gt;15</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M743.52,-237.882C757.545,-223.534 772.204,-208.539 785.953,-194.473"/>
+<polygon fill="black" stroke="black" points="788.565,-196.808 793.053,-187.211 783.559,-191.915 788.565,-196.808"/>
+<text text-anchor="middle" x="789" y="-208.8" font-family="Courier,monospace" font-size="14.00">expr</text>
+</g>
+<!-- 11R4 -->
+<g id="node21" class="node"><title>11R4</title>
+<polygon fill="#b2df8a" stroke="black" points="736,-508 705.835,-490 736,-472 766.165,-490 736,-508"/>
+<text text-anchor="middle" x="736" y="-486.3" font-family="Courier,monospace" font-size="14.00">R4</text>
+</g>
+<!-- 11&#45;&gt;11R4 -->
+<g id="edge34" class="edge"><title>11&#45;&gt;11R4</title>
+<path fill="none" stroke="black" d="M789.704,-642.735C777.535,-608.354 756.372,-548.559 744.573,-515.221"/>
+<polygon fill="black" stroke="black" points="747.73,-513.651 741.094,-505.392 741.131,-515.987 747.73,-513.651"/>
+</g>
+<!-- 12&#45;&gt;9 -->
+<g id="edge35" class="edge"><title>12&#45;&gt;9</title>
+<path fill="none" stroke="black" d="M1162.07,-432.924C1182.12,-418.71 1204,-403.191 1225.23,-388.134"/>
+<polygon fill="black" stroke="black" points="1227.51,-390.806 1233.65,-382.167 1223.47,-385.096 1227.51,-390.806"/>
+<text text-anchor="middle" x="1226" y="-403.8" font-family="Courier,monospace" font-size="14.00">MULT</text>
+</g>
+<!-- 12&#45;&gt;10 -->
+<g id="edge36" class="edge"><title>12&#45;&gt;10</title>
+<path fill="none" stroke="black" d="M859.911,-444.867C835.669,-436.517 811.883,-426.648 790,-415 781.64,-410.55 769.173,-400.752 755.471,-388.864"/>
+<polygon fill="black" stroke="black" points="757.569,-386.048 747.751,-382.066 752.943,-391.302 757.569,-386.048"/>
+<text text-anchor="middle" x="802.5" y="-403.8" font-family="Courier,monospace" font-size="14.00">DIV</text>
+</g>
+<!-- 12R5 -->
+<g id="node22" class="node"><title>12R5</title>
+<polygon fill="#b2df8a" stroke="black" points="1083,-328 1052.83,-310 1083,-292 1113.17,-310 1083,-328"/>
+<text text-anchor="middle" x="1083" y="-306.3" font-family="Courier,monospace" font-size="14.00">R5</text>
+</g>
+<!-- 12&#45;&gt;12R5 -->
+<g id="edge37" class="edge"><title>12&#45;&gt;12R5</title>
+<path fill="none" stroke="black" d="M1083,-432.68C1083,-401.272 1083,-363.558 1083,-338.528"/>
+<polygon fill="black" stroke="black" points="1086.5,-338.31 1083,-328.31 1079.5,-338.31 1086.5,-338.31"/>
+</g>
+<!-- 13&#45;&gt;9 -->
+<g id="edge38" class="edge"><title>13&#45;&gt;9</title>
+<path fill="none" stroke="black" d="M590.406,-432.89C635.56,-419.891 684.733,-407.64 731,-400 902.638,-371.658 950.993,-413.929 1122,-382 1149.19,-376.924 1177.66,-369.174 1204.6,-360.631"/>
+<polygon fill="black" stroke="black" points="1206.01,-363.854 1214.45,-357.451 1203.86,-357.193 1206.01,-363.854"/>
+<text text-anchor="middle" x="748" y="-403.8" font-family="Courier,monospace" font-size="14.00">MULT</text>
+</g>
+<!-- 13&#45;&gt;10 -->
+<g id="edge39" class="edge"><title>13&#45;&gt;10</title>
+<path fill="none" stroke="black" d="M502.073,-432.924C522.117,-418.71 544,-403.191 565.232,-388.134"/>
+<polygon fill="black" stroke="black" points="567.515,-390.806 573.647,-382.167 563.465,-385.096 567.515,-390.806"/>
+<text text-anchor="middle" x="561.5" y="-403.8" font-family="Courier,monospace" font-size="14.00">DIV</text>
+</g>
+<!-- 13R6 -->
+<g id="node23" class="node"><title>13R6</title>
+<polygon fill="#b2df8a" stroke="black" points="423,-328 392.835,-310 423,-292 453.165,-310 423,-328"/>
+<text text-anchor="middle" x="423" y="-306.3" font-family="Courier,monospace" font-size="14.00">R6</text>
+</g>
+<!-- 13&#45;&gt;13R6 -->
+<g id="edge40" class="edge"><title>13&#45;&gt;13R6</title>
+<path fill="none" stroke="black" d="M423,-432.68C423,-401.272 423,-363.558 423,-338.528"/>
+<polygon fill="black" stroke="black" points="426.5,-338.31 423,-328.31 419.5,-338.31 426.5,-338.31"/>
+</g>
+<!-- 14R7 -->
+<g id="node24" class="node"><title>14R7</title>
+<polygon fill="#b2df8a" stroke="black" points="1398,-36 1367.83,-18 1398,-3.55271e-15 1428.17,-18 1398,-36"/>
+<text text-anchor="middle" x="1398" y="-14.3" font-family="Courier,monospace" font-size="14.00">R7</text>
+</g>
+<!-- 14&#45;&gt;14R7 -->
+<g id="edge41" class="edge"><title>14&#45;&gt;14R7</title>
+<path fill="none" stroke="black" d="M1398,-72.711C1398,-63.5533 1398,-54.4431 1398,-46.397"/>
+<polygon fill="black" stroke="black" points="1401.5,-46.1799 1398,-36.1799 1394.5,-46.18 1401.5,-46.1799"/>
+</g>
+<!-- 15R8 -->
+<g id="node25" class="node"><title>15R8</title>
+<polygon fill="#b2df8a" stroke="black" points="848,-36 817.835,-18 848,-3.55271e-15 878.165,-18 848,-36"/>
+<text text-anchor="middle" x="848" y="-14.3" font-family="Courier,monospace" font-size="14.00">R8</text>
+</g>
+<!-- 15&#45;&gt;15R8 -->
+<g id="edge42" class="edge"><title>15&#45;&gt;15R8</title>
+<path fill="none" stroke="black" d="M848,-72.711C848,-63.5533 848,-54.4431 848,-46.397"/>
+<polygon fill="black" stroke="black" points="851.5,-46.1799 848,-36.1799 844.5,-46.18 851.5,-46.1799"/>
+</g>
+</g>
+</svg>
diff --git a/demo/bison/calc/parser.tab.c b/demo/bison/calc/parser.tab.c
index 0948b48..2395da5 100644
--- a/demo/bison/calc/parser.tab.c
+++ b/demo/bison/calc/parser.tab.c
@@ -67,8 +67,9 @@
#include <stdio.h>
int yylex();
int yyerror(const char* error);
+#define YYDEBUG 1
-#line 72 "parser.tab.c" /* yacc.c:339 */
+#line 73 "parser.tab.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -92,7 +93,7 @@ int yyerror(const char* error);
# define YY_YY_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
@@ -127,7 +128,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 131 "parser.tab.c" /* yacc.c:358 */
+#line 132 "parser.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -425,7 +426,7 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 22, 22, 23, 26, 27, 28, 29, 30, 31
+ 0, 23, 23, 24, 27, 28, 29, 30, 31, 32
};
#endif
@@ -1196,49 +1197,49 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 23 "parser.y" /* yacc.c:1646 */
+#line 24 "parser.y" /* yacc.c:1646 */
{ printf("%f\n", (yyvsp[0])); }
-#line 1202 "parser.tab.c" /* yacc.c:1646 */
+#line 1203 "parser.tab.c" /* yacc.c:1646 */
break;
case 4:
-#line 26 "parser.y" /* yacc.c:1646 */
+#line 27 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 1208 "parser.tab.c" /* yacc.c:1646 */
+#line 1209 "parser.tab.c" /* yacc.c:1646 */
break;
case 5:
-#line 27 "parser.y" /* yacc.c:1646 */
+#line 28 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 1214 "parser.tab.c" /* yacc.c:1646 */
+#line 1215 "parser.tab.c" /* yacc.c:1646 */
break;
case 6:
-#line 28 "parser.y" /* yacc.c:1646 */
+#line 29 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]) + (yyvsp[0]); }
-#line 1220 "parser.tab.c" /* yacc.c:1646 */
+#line 1221 "parser.tab.c" /* yacc.c:1646 */
break;
case 7:
-#line 29 "parser.y" /* yacc.c:1646 */
+#line 30 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]) - (yyvsp[0]); }
-#line 1226 "parser.tab.c" /* yacc.c:1646 */
+#line 1227 "parser.tab.c" /* yacc.c:1646 */
break;
case 8:
-#line 30 "parser.y" /* yacc.c:1646 */
+#line 31 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]) * (yyvsp[0]); }
-#line 1232 "parser.tab.c" /* yacc.c:1646 */
+#line 1233 "parser.tab.c" /* yacc.c:1646 */
break;
case 9:
-#line 31 "parser.y" /* yacc.c:1646 */
+#line 32 "parser.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]) / (yyvsp[0]); }
-#line 1238 "parser.tab.c" /* yacc.c:1646 */
+#line 1239 "parser.tab.c" /* yacc.c:1646 */
break;
-#line 1242 "parser.tab.c" /* yacc.c:1646 */
+#line 1243 "parser.tab.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1466,7 +1467,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 33 "parser.y" /* yacc.c:1906 */
+#line 34 "parser.y" /* yacc.c:1906 */
int yyerror(const char* error)
diff --git a/demo/bison/calc/parser.tab.h b/demo/bison/calc/parser.tab.h
index f05a83f..0428297 100644
--- a/demo/bison/calc/parser.tab.h
+++ b/demo/bison/calc/parser.tab.h
@@ -34,7 +34,7 @@
# define YY_YY_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
diff --git a/demo/bison/calc/parser.y b/demo/bison/calc/parser.y
index 098382a..98885e5 100644
--- a/demo/bison/calc/parser.y
+++ b/demo/bison/calc/parser.y
@@ -2,6 +2,7 @@
#include <stdio.h>
int yylex();
int yyerror(const char* error);
+#define YYDEBUG 1
%}
%start input