bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/6] xml: match DOT output and xml2dot.xsl processing


From: Theophile Ranquet
Subject: [PATCH 5/6] xml: match DOT output and xml2dot.xsl processing
Date: Mon, 12 Nov 2012 16:05:33 +0000

Make the DOT produced by XSLT processing equivalent to the one made with the
--graph option.

* data/xslt/xml2dot.xsl: Stylistic changes, and add support for reductions.
* doc/bison.texi (Xml): Update.
* src/graphviz.c (conclude_red): Minor stylistic changes to DOT internals.
(output_red): Swap enabled and disabled reductions output, for coherence
with XSLT output.
* src/print_graph.c (print_core): Minor stylistic change to States' output.
(print_actions): Swap order of output for reductions and transitions.
* tests/local.at (AT_BISON_CHECK_XML): Ignore differences in order.
* tests/output.at: Adjust to changes in DOT internals.
---
 data/xslt/xml2dot.xsl  | 185 ++++++++++++++++++++++++++--
 data/xslt/xml2text.xsl |   2 +-
 doc/bison.texi         |  15 +--
 src/graphviz.c         |  34 +++---
 src/print_graph.c      |   7 +-
 tests/local.at         |   4 +-
 tests/output.at        | 322 ++++++++++++++++++++++++-------------------------
 7 files changed, 372 insertions(+), 197 deletions(-)

diff --git a/data/xslt/xml2dot.xsl b/data/xslt/xml2dot.xsl
index 111613c..dceb8e1 100644
--- a/data/xslt/xml2dot.xsl
+++ b/data/xslt/xml2dot.xsl
@@ -55,7 +55,7 @@
   <xsl:call-template name="escape">
     <xsl:with-param name="subject" select="$filename"/>
   </xsl:call-template>
-  <xsl:text>&#10;{
+  <xsl:text>"&#10;{
   node [fontname = courier, shape = box, colorscheme = paired6]
   edge [fontname = courier]
 
@@ -68,11 +68,87 @@
   <xsl:call-template name="output-node">
     <xsl:with-param name="number" select="@number"/>
     <xsl:with-param name="label">
-      <xsl:value-of select="@number"/>
       <xsl:apply-templates select="itemset/item"/>
     </xsl:with-param>
   </xsl:call-template>
   <xsl:apply-templates select="actions/transitions"/>
+  <xsl:apply-templates select="actions/reductions">
+    <xsl:with-param name="staten">
+      <xsl:value-of select="@number"/>
+    </xsl:with-param>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="actions/reductions">
+  <xsl:param name="staten"/>
+  <xsl:for-each select='reduction'>
+    <!-- These variables are needed because the current context can't be
+         refered to directly in XPath expressions. -->
+    <xsl:variable name="rul">
+      <xsl:value-of select="@rule"/>
+    </xsl:variable>
+    <xsl:variable name="ena">
+      <xsl:value-of select="@enabled"/>
+    </xsl:variable>
+    <!-- The foreach's body is protected by this, so that we are actually
+         going to iterate once per reduction rule, and not per lookahead. -->
+    <xsl:if test='not(preceding-sibling::address@hidden and @enabled=$ena])'>
+      <xsl:variable name="rule">
+        <xsl:choose>
+          <!-- The acceptation state is refered to as 'accept' in the XML, but
+               just as '0' in the DOT. -->
+          <xsl:when test="@rule='accept'">
+            <xsl:text>0</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="@rule"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <!-- The edge's beginning -->
+      <xsl:call-template name="reduction-edge-start">
+        <xsl:with-param name="state" select="$staten"/>
+        <xsl:with-param name="rule" select="$rule"/>
+        <xsl:with-param name="enabled" select="@enabled"/>
+      </xsl:call-template>
+
+      <!-- The edge's tokens -->
+      <!-- Don't show labels for the default action. In other cases, there will
+           always be at least one token, so 'label="[]"' will not occur. -->
+      <xsl:if test='$rule!=0 and not(../address@hidden and @rule=$rule and 
@symbol="$default"])'>
+        <xsl:text>label="[</xsl:text>
+        <xsl:for-each select='../address@hidden and @rule=$rule]'>
+          <xsl:call-template name="escape">
+            <xsl:with-param name="subject" select="@symbol"/>
+          </xsl:call-template>
+          <xsl:if test="position() != last ()">
+            <xsl:text>, </xsl:text>
+          </xsl:if>
+        </xsl:for-each>
+        <xsl:text>]", </xsl:text>
+      </xsl:if>
+
+      <!-- The edge's end -->
+      <xsl:text>style=solid]&#10;</xsl:text>
+
+      <!-- The diamond representing the reduction -->
+      <xsl:call-template name="reduction-node">
+        <xsl:with-param name="state" select="$staten"/>
+        <xsl:with-param name="rule" select="$rule"/>
+        <xsl:with-param name="color">
+          <xsl:choose>
+            <xsl:when test='@enabled="true"'>
+              <xsl:text>3</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>5</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:for-each>
 </xsl:template>
 
 <xsl:template match="actions/transitions">
@@ -80,17 +156,48 @@
 </xsl:template>
 
 <xsl:template match="item">
+  <xsl:param name="prev-rule-number"
+    select="preceding-sibling::item[1]/@rule-number"/>
   <xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
     <xsl:with-param name="point" select="@point"/>
+    <xsl:with-param name="num" select="@rule-number"/>
+    <xsl:with-param name="prev-lhs"
+      select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
+   />
   </xsl:apply-templates>
   <xsl:apply-templates select="lookaheads"/>
 </xsl:template>
 
 <xsl:template match="rule">
   <xsl:param name="point"/>
+  <xsl:param name="num"/>
+  <xsl:param name="prev-lhs"/>
   <xsl:text>&#10;</xsl:text>
-  <xsl:value-of select="lhs"/>
-  <xsl:text> -&gt;</xsl:text>
+  <xsl:choose>
+    <xsl:when test="$num &lt; 10">
+      <xsl:text>  </xsl:text>
+    </xsl:when>
+    <xsl:when test="$num &lt; 100">
+      <xsl:text> </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text></xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:value-of select="$num"/>
+  <xsl:text> </xsl:text>
+  <xsl:choose>
+  <xsl:when test="$prev-lhs = lhs[text()]">
+      <xsl:call-template name="lpad">
+        <xsl:with-param name="str" select="'|'"/>
+        <xsl:with-param name="pad" select="number(string-length(lhs[text()])) 
+ 1"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="lhs"/>
+      <xsl:text>:</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
   <xsl:if test="$point = 0">
     <xsl:text> .</xsl:text>
   </xsl:if>
@@ -110,7 +217,7 @@
 <xsl:template match="empty"/>
 
 <xsl:template match="lookaheads">
-  <xsl:text>[</xsl:text>
+  <xsl:text>  [</xsl:text>
   <xsl:apply-templates select="symbol"/>
   <xsl:text>]</xsl:text>
 </xsl:template>
@@ -122,6 +229,50 @@
   </xsl:if>
 </xsl:template>
 
+<xsl:template name="reduction-edge-start">
+  <xsl:param name="state"/>
+  <xsl:param name="rule"/>
+  <xsl:param name="enabled"/>
+
+  <xsl:text>  </xsl:text>
+  <xsl:value-of select="$state"/>
+  <xsl:text> -> "</xsl:text>
+  <xsl:value-of select="$state"/>
+  <xsl:text>R</xsl:text>
+  <xsl:value-of select="$rule"/>
+  <xsl:if test='$enabled = "false"'>
+    <xsl:text>d</xsl:text>
+  </xsl:if>
+  <xsl:text>" [</xsl:text>
+</xsl:template>
+
+<xsl:template name="reduction-node">
+  <xsl:param name="state"/>
+  <xsl:param name="rule"/>
+  <xsl:param name="color"/>
+
+  <xsl:text> "</xsl:text>
+  <xsl:value-of select="$state"/>
+  <xsl:text>R</xsl:text>
+  <xsl:value-of select="$rule"/>
+  <xsl:if test="$color = 5">
+    <xsl:text>d</xsl:text>
+  </xsl:if>
+  <xsl:text>" [label="</xsl:text>
+  <xsl:choose>
+  <xsl:when test="$rule = 0">
+    <xsl:text>Acc", fillcolor=1</xsl:text>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:text>R</xsl:text>
+    <xsl:value-of select="$rule"/>
+    <xsl:text>", fillcolor=</xsl:text>
+    <xsl:value-of select="$color"/>
+  </xsl:otherwise>
+  </xsl:choose>
+  <xsl:text>, shape=diamond, style=filled]&#10;</xsl:text>
+</xsl:template>
+
 <xsl:template match="transition">
   <xsl:call-template name="output-edge">
     <xsl:with-param name="src" select="../../../@number"/>
@@ -153,10 +304,13 @@
   <xsl:text>  </xsl:text>
   <xsl:value-of select="$number"/>
   <xsl:text> [label="</xsl:text>
+  <xsl:text>State </xsl:text>
+  <xsl:value-of select="$number"/>
+  <xsl:text>\n</xsl:text>
   <xsl:call-template name="escape">
     <xsl:with-param name="subject" select="$label"/>
   </xsl:call-template>
-  <xsl:text>"]&#10;</xsl:text>
+  <xsl:text>\l"]&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template name="output-edge">
@@ -197,7 +351,7 @@
       </xsl:call-template>
     </xsl:with-param>
     <xsl:with-param name="search" select="'&#10;'"/>
-    <xsl:with-param name="replace" select="'\n'"/>
+    <xsl:with-param name="replace" select="'\l'"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -223,4 +377,21 @@
   </xsl:choose>
 </xsl:template>
 
+<xsl:template name="lpad">
+  <xsl:param name="str" select="''"/>
+  <xsl:param name="pad" select="0"/>
+  <xsl:variable name="diff" select="$pad - string-length($str)" />
+  <xsl:choose>
+    <xsl:when test="$diff &lt; 0">
+      <xsl:value-of select="$str"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="space">
+        <xsl:with-param name="repeat" select="$diff"/>
+      </xsl:call-template>
+      <xsl:value-of select="$str"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
diff --git a/data/xslt/xml2text.xsl b/data/xslt/xml2text.xsl
index 94e78e6..8b3f5ae 100644
--- a/data/xslt/xml2text.xsl
+++ b/data/xslt/xml2text.xsl
@@ -230,7 +230,7 @@
 <xsl:template match="automaton/state">
   <xsl:param name="pad"/>
   <xsl:text>&#10;&#10;</xsl:text>
-  <xsl:text>state </xsl:text>
+  <xsl:text>State </xsl:text>
   <xsl:value-of select="@number"/>
   <xsl:text>&#10;&#10;</xsl:text>
   <xsl:apply-templates select="itemset/item">
diff --git a/doc/bison.texi b/doc/bison.texi
index f7892cd..cd13dfb 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -8636,25 +8636,26 @@ Bison supports two major report formats: textual output 
(
 @pxref{Understanding}) when invoked with option @option{--verbose}, and DOT
 (@pxref{Graphviz}) when invoked with option @option{--graph}. However, an
 other alternative is to output an XML file that may then be, with xsltproc,
-rendered as either a raw text format very similar to the verbose file, or as
+rendered as either a raw text format equivalent to the verbose file, or as
 an HTML version of the same file, with clickable transitions, or even as a
-DOT.
+DOT. The @file{.output} and DOT files obtained via XSLT have no difference
+whatsoever with those obtained by invoking bison with options 
@option{--verbose}
+or @option{--graph}
 
 The textual file is generated when the options @option{-x} or
 @option{--xml[=FILE]} are specified, see @ref{Invocation,,Invoking Bison}.
 If not specified, its name is made by removing @samp{.tab.c} or @samp{.c}
 from the parser implementation file name, and adding @samp{.xml} instead.
-Therefore, if the grammar file is @file{foo.y}, then the parser
-implementation file is called @file{foo.tab.c} by default.  As a
-consequence, the XML output file is called @file{foo.xml}.
+Therefore, if the grammar file is @file{foo.y}, then the parser implementation
+file is called @file{foo.tab.c} by default.  As a consequence, the XML output
+file is called @file{foo.xml}.
 
 Bison ships with a data/xslt directory, containing XSL Transformation files
 to apply to the XML file. Their names are non-ambiguous:
 
 @table @file
 @item xml2dot.xsl
-Used to output a DOT version of the automaton. This might not be exactly the
-same as the one obtained through @option{--graph}.
+Used to output a copy of the DOT visualization of the automaton.
 @item xml2text.xsl
 Used to output a copy of the .output file.
 @item xml2xhtml.xsl
diff --git a/src/graphviz.c b/src/graphviz.c
index ec102a4..16ea8b9 100644
--- a/src/graphviz.c
+++ b/src/graphviz.c
@@ -106,7 +106,7 @@ conclude_red (struct obstack *out, int source, rule_number 
ruleno,
     return (void) obstack_finish0 (out);
   else
     {
-      char const *ed = enabled ? "e" : "d";
+      char const *ed = enabled ? "" : "d";
       char const *color = enabled ? ruleno ? "3" : "1" : "5";
 
       /* First, build the edge's head. The name of reduction nodes is "nRm",
@@ -116,24 +116,28 @@ conclude_red (struct obstack *out, int source, 
rule_number ruleno,
       fprintf (fout, "  %1$d -> \"%1$dR%2$d%3$s\" [",
                source, ruleno, ed);
 
+      /* (The lookahead tokens have been added to the beginning of the
+         obstack, in the caller function.) */
       if (! obstack_empty_p (out))
-        /* (The lookahead tokens have been added to the beginning of the
-           obstack, in the caller function.) */
-        fprintf (fout, "label = \"[%s]\" ", obstack_finish0 (out));
+        {
+          char *label = obstack_finish0 (out);
+          fprintf (fout, "label=\"[%s]\", ", label);
+          obstack_free (out, label);
+        }
 
       /* Then, the edge's tail. */
-      fprintf (fout, "style = solid]\n");
+      fprintf (fout, "style=solid]\n");
 
       /* Build the associated diamond representation of the target rule. */
-      fprintf (fout, " \"%dR%d%s\" [style = filled, "
-                    "shape = diamond, fillcolor = %s, ",
-               source, ruleno, ed, color);
-
-     if (ruleno)
-        fprintf (fout, "label = \"R%d\"]\n", ruleno);
+      fprintf (fout, " \"%dR%d%s\" [label=\"",
+               source, ruleno, ed);
+      if (ruleno)
+        fprintf (fout, "R%d", ruleno);
       else
-        fprintf (fout, "label = \"Acc\"]\n");
+        fprintf (fout, "Acc");
 
+      fprintf (fout, "\", fillcolor=%s, shape=diamond, style=filled]\n",
+               color);
     }
 }
 
@@ -171,7 +175,7 @@ output_red (state const *s, reductions const *reds, FILE 
*fout)
       bool defaulted = false;
       bool firstd = true;
       bool firste = true;
-      rule_number ruleno = reds->rules[j]->user_number;
+      rule_number ruleno = reds->rules[j]->number;
       rule *default_reduction = NULL;
 
       if (yydefact[s->number] != 0)
@@ -199,11 +203,11 @@ output_red (state const *s, reductions const *reds, FILE 
*fout)
         }
 
       /* Do the actual output. */
-      conclude_red (&eout, source, ruleno, true, firste && !defaulted, fout);
       conclude_red (&dout, source, ruleno, false, firstd, fout);
+      conclude_red (&eout, source, ruleno, true, firste && !defaulted, fout);
     }
-  obstack_free (&eout, 0);
   obstack_free (&dout, 0);
+  obstack_free (&eout, 0);
   bitset_free (no_reduce_set);
 }
 
diff --git a/src/print_graph.c b/src/print_graph.c
index 5ce0aa9..f4742b1 100644
--- a/src/print_graph.c
+++ b/src/print_graph.c
@@ -76,7 +76,7 @@ print_core (struct obstack *oout, state *s)
     }
 
   obstack_printf (oout, _("State %d"), s->number);
-  obstack_sgrow (oout, "\\n");
+  obstack_sgrow (oout, "\\n\\l");
   for (i = 0; i < snritems; i++)
     {
       item_number *sp;
@@ -142,9 +142,6 @@ print_actions (state const *s, FILE *fgraph)
   transitions const *trans = s->transitions;
   int i;
 
-  /* Display reductions. */
-  output_red (s, s->reductions, fgraph);
-
   if (!trans->num && !s->reductions)
     return;
 
@@ -167,6 +164,8 @@ print_actions (state const *s, FILE *fgraph)
                     TRANSITION_IS_ERROR (trans, i) ? NULL : symbols[sym]->tag,
                     style, fgraph);
       }
+  /* Display reductions. */
+  output_red (s, s->reductions, fgraph);
 }
 
 
diff --git a/tests/local.at b/tests/local.at
index ca64693..efba29d 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -556,10 +556,10 @@ m4_define([AT_BISON_CHECK_XML],
   AT_CHECK([[$XSLTPROC \
              `]]AT_QUELL_VALGRIND[[ bison --print-datadir`/xslt/xml2text.xsl \
              xml-tests/test.xml]], [[0]], [expout])
-  [cp xml-tests/test.dot expout]
+  [sort xml-tests/test.dot > expout]
   AT_CHECK([[$XSLTPROC \
              `]]AT_QUELL_VALGRIND[[ bison --print-datadir`/xslt/xml2dot.xsl \
-             xml-tests/test.xml]], [[0]], [expout])
+             xml-tests/test.xml | sort]], [[0]], [expout])
   [rm -rf xml-tests expout]
   AT_RESTORE_SPECIAL_FILES
 [fi]])
diff --git a/tests/output.at b/tests/output.at
index 37d2c3d..657903a 100644
--- a/tests/output.at
+++ b/tests/output.at
@@ -264,27 +264,27 @@ a: ;
 b: 'b';
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . exp $end\l  1 exp: . a '?' b\l  2 a: .\l"]
-  0 -> "0R2e" [style = solid]
- "0R2e" [style = filled, shape = diamond, fillcolor = 3, label = "R2"]
+  0 [label="State 0\n\l  0 $accept: . exp $end\l  1 exp: . a '?' b\l  2 a: 
.\l"]
   0 -> 1 [style=dashed label="exp"]
   0 -> 2 [style=dashed label="a"]
-  1 [label="State 1\n  0 $accept: exp . $end\l"]
+  0 -> "0R2" [style=solid]
+ "0R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+  1 [label="State 1\n\l  0 $accept: exp . $end\l"]
   1 -> 3 [style=solid label="$end"]
-  2 [label="State 2\n  1 exp: a . '?' b\l"]
+  2 [label="State 2\n\l  1 exp: a . '?' b\l"]
   2 -> 4 [style=solid label="'?'"]
-  3 [label="State 3\n  0 $accept: exp $end .\l"]
-  3 -> "3R0e" [style = solid]
- "3R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
-  4 [label="State 4\n  1 exp: a '?' . b\l  3 b: . 'b'\l"]
+  3 [label="State 3\n\l  0 $accept: exp $end .\l"]
+  3 -> "3R0" [style=solid]
+ "3R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+  4 [label="State 4\n\l  1 exp: a '?' . b\l  3 b: . 'b'\l"]
   4 -> 5 [style=solid label="'b'"]
   4 -> 6 [style=dashed label="b"]
-  5 [label="State 5\n  3 b: 'b' .\l"]
-  5 -> "5R3e" [style = solid]
- "5R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  6 [label="State 6\n  1 exp: a '?' b .\l"]
-  6 -> "6R1e" [style = solid]
- "6R1e" [style = filled, shape = diamond, fillcolor = 3, label = "R1"]
+  5 [label="State 5\n\l  3 b: 'b' .\l"]
+  5 -> "5R3" [style=solid]
+ "5R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  6 [label="State 6\n\l  1 exp: a '?' b .\l"]
+  6 -> "6R1" [style=solid]
+ "6R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
 ]])
 
 ## ------------------------ ##
@@ -306,13 +306,7 @@ empty_b: %prec 'b';
 empty_c: %prec 'c';
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . start $end\l  1 start: . 'a'\l  2      | . 
empty_a 'a'\l  3      | . 'b'\l  4      | . empty_b 'b'\l  5      | . 'c'\l  6  
    | . empty_c 'c'\l  7 empty_a: .  ['a']\l  8 empty_b: .  ['b']\l  9 empty_c: 
.  ['c']\l"]
-  0 -> "0R7d" [label = "['a']" style = solid]
- "0R7d" [style = filled, shape = diamond, fillcolor = 5, label = "R7"]
-  0 -> "0R8d" [label = "['b']" style = solid]
- "0R8d" [style = filled, shape = diamond, fillcolor = 5, label = "R8"]
-  0 -> "0R9d" [label = "['c']" style = solid]
- "0R9d" [style = filled, shape = diamond, fillcolor = 5, label = "R9"]
+  0 [label="State 0\n\l  0 $accept: . start $end\l  1 start: . 'a'\l  2      | 
. empty_a 'a'\l  3      | . 'b'\l  4      | . empty_b 'b'\l  5      | . 'c'\l  
6      | . empty_c 'c'\l  7 empty_a: .  ['a']\l  8 empty_b: .  ['b']\l  9 
empty_c: .  ['c']\l"]
   0 -> 1 [style=solid label="'a'"]
   0 -> 2 [style=solid label="'b'"]
   0 -> 3 [style=solid label="'c'"]
@@ -320,35 +314,41 @@ empty_c: %prec 'c';
   0 -> 5 [style=dashed label="empty_a"]
   0 -> 6 [style=dashed label="empty_b"]
   0 -> 7 [style=dashed label="empty_c"]
-  1 [label="State 1\n  1 start: 'a' .\l"]
-  1 -> "1R1e" [style = solid]
- "1R1e" [style = filled, shape = diamond, fillcolor = 3, label = "R1"]
-  2 [label="State 2\n  3 start: 'b' .\l"]
-  2 -> "2R3e" [style = solid]
- "2R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  3 [label="State 3\n  5 start: 'c' .\l"]
-  3 -> "3R5e" [style = solid]
- "3R5e" [style = filled, shape = diamond, fillcolor = 3, label = "R5"]
-  4 [label="State 4\n  0 $accept: start . $end\l"]
+  0 -> "0R7d" [label="['a']", style=solid]
+ "0R7d" [label="R7", fillcolor=5, shape=diamond, style=filled]
+  0 -> "0R8d" [label="['b']", style=solid]
+ "0R8d" [label="R8", fillcolor=5, shape=diamond, style=filled]
+  0 -> "0R9d" [label="['c']", style=solid]
+ "0R9d" [label="R9", fillcolor=5, shape=diamond, style=filled]
+  1 [label="State 1\n\l  1 start: 'a' .\l"]
+  1 -> "1R1" [style=solid]
+ "1R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
+  2 [label="State 2\n\l  3 start: 'b' .\l"]
+  2 -> "2R3" [style=solid]
+ "2R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  3 [label="State 3\n\l  5 start: 'c' .\l"]
+  3 -> "3R5" [style=solid]
+ "3R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
+  4 [label="State 4\n\l  0 $accept: start . $end\l"]
   4 -> 8 [style=solid label="$end"]
-  5 [label="State 5\n  2 start: empty_a . 'a'\l"]
+  5 [label="State 5\n\l  2 start: empty_a . 'a'\l"]
   5 -> 9 [style=solid label="'a'"]
-  6 [label="State 6\n  4 start: empty_b . 'b'\l"]
+  6 [label="State 6\n\l  4 start: empty_b . 'b'\l"]
   6 -> 10 [style=solid label="'b'"]
-  7 [label="State 7\n  6 start: empty_c . 'c'\l"]
+  7 [label="State 7\n\l  6 start: empty_c . 'c'\l"]
   7 -> 11 [style=solid label="'c'"]
-  8 [label="State 8\n  0 $accept: start $end .\l"]
-  8 -> "8R0e" [style = solid]
- "8R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
-  9 [label="State 9\n  2 start: empty_a 'a' .\l"]
-  9 -> "9R2e" [style = solid]
- "9R2e" [style = filled, shape = diamond, fillcolor = 3, label = "R2"]
-  10 [label="State 10\n  4 start: empty_b 'b' .\l"]
-  10 -> "10R4e" [style = solid]
- "10R4e" [style = filled, shape = diamond, fillcolor = 3, label = "R4"]
-  11 [label="State 11\n  6 start: empty_c 'c' .\l"]
-  11 -> "11R6e" [style = solid]
- "11R6e" [style = filled, shape = diamond, fillcolor = 3, label = "R6"]
+  8 [label="State 8\n\l  0 $accept: start $end .\l"]
+  8 -> "8R0" [style=solid]
+ "8R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+  9 [label="State 9\n\l  2 start: empty_a 'a' .\l"]
+  9 -> "9R2" [style=solid]
+ "9R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+  10 [label="State 10\n\l  4 start: empty_b 'b' .\l"]
+  10 -> "10R4" [style=solid]
+ "10R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
+  11 [label="State 11\n\l  6 start: empty_c 'c' .\l"]
+  11 -> "11R6" [style=solid]
+ "11R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
 ]])
 
 ## ---------------------- ##
@@ -373,41 +373,41 @@ empty_b: %prec 'b';
 empty_c: %prec 'c';
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . start $end\l  1 start: . 'a'\l  2      | . 
empty_a 'a'\l  3      | . 'b'\l  4      | . empty_b 'b'\l  5      | . 'c'\l  6  
    | . empty_c 'c'\l  7 empty_a: .  ['a']\l  8 empty_b: .  []\l  9 empty_c: .  
[]\l"]
-  0 -> "0R7e" [style = solid]
- "0R7e" [style = filled, shape = diamond, fillcolor = 3, label = "R7"]
+  0 [label="State 0\n\l  0 $accept: . start $end\l  1 start: . 'a'\l  2      | 
. empty_a 'a'\l  3      | . 'b'\l  4      | . empty_b 'b'\l  5      | . 'c'\l  
6      | . empty_c 'c'\l  7 empty_a: .  ['a']\l  8 empty_b: .  []\l  9 empty_c: 
.  []\l"]
   0 -> 1 [style=solid label="'b'"]
   0 -> 2 [style=solid label="'c'"]
   0 -> 3 [style=dashed label="start"]
   0 -> 4 [style=dashed label="empty_a"]
   0 -> 5 [style=dashed label="empty_b"]
   0 -> 6 [style=dashed label="empty_c"]
-  1 [label="State 1\n  3 start: 'b' .\l"]
-  1 -> "1R3e" [style = solid]
- "1R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  2 [label="State 2\n  5 start: 'c' .\l"]
-  2 -> "2R5e" [style = solid]
- "2R5e" [style = filled, shape = diamond, fillcolor = 3, label = "R5"]
-  3 [label="State 3\n  0 $accept: start . $end\l"]
+  0 -> "0R7" [style=solid]
+ "0R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
+  1 [label="State 1\n\l  3 start: 'b' .\l"]
+  1 -> "1R3" [style=solid]
+ "1R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  2 [label="State 2\n\l  5 start: 'c' .\l"]
+  2 -> "2R5" [style=solid]
+ "2R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
+  3 [label="State 3\n\l  0 $accept: start . $end\l"]
   3 -> 7 [style=solid label="$end"]
-  4 [label="State 4\n  2 start: empty_a . 'a'\l"]
+  4 [label="State 4\n\l  2 start: empty_a . 'a'\l"]
   4 -> 8 [style=solid label="'a'"]
-  5 [label="State 5\n  4 start: empty_b . 'b'\l"]
+  5 [label="State 5\n\l  4 start: empty_b . 'b'\l"]
   5 -> 9 [style=solid label="'b'"]
-  6 [label="State 6\n  6 start: empty_c . 'c'\l"]
+  6 [label="State 6\n\l  6 start: empty_c . 'c'\l"]
   6 -> 10 [style=solid label="'c'"]
-  7 [label="State 7\n  0 $accept: start $end .\l"]
-  7 -> "7R0e" [style = solid]
- "7R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
-  8 [label="State 8\n  2 start: empty_a 'a' .\l"]
-  8 -> "8R2e" [style = solid]
- "8R2e" [style = filled, shape = diamond, fillcolor = 3, label = "R2"]
-  9 [label="State 9\n  4 start: empty_b 'b' .\l"]
-  9 -> "9R4e" [style = solid]
- "9R4e" [style = filled, shape = diamond, fillcolor = 3, label = "R4"]
-  10 [label="State 10\n  6 start: empty_c 'c' .\l"]
-  10 -> "10R6e" [style = solid]
- "10R6e" [style = filled, shape = diamond, fillcolor = 3, label = "R6"]
+  7 [label="State 7\n\l  0 $accept: start $end .\l"]
+  7 -> "7R0" [style=solid]
+ "7R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+  8 [label="State 8\n\l  2 start: empty_a 'a' .\l"]
+  8 -> "8R2" [style=solid]
+ "8R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+  9 [label="State 9\n\l  4 start: empty_b 'b' .\l"]
+  9 -> "9R4" [style=solid]
+ "9R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
+  10 [label="State 10\n\l  6 start: empty_c 'c' .\l"]
+  10 -> "10R6" [style=solid]
+ "10R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
 ]])
 
 ## ---------------- ##
@@ -421,25 +421,25 @@ a: ;
 b: ;
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . exp $end\l  1 exp: . a\l  2    | . b\l  3 
a: .  [$end]\l  4 b: .  [$end]\l"]
-  0 -> "0R3e" [style = solid]
- "0R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  0 -> "0R4d" [label = "[$end]" style = solid]
- "0R4d" [style = filled, shape = diamond, fillcolor = 5, label = "R4"]
+  0 [label="State 0\n\l  0 $accept: . exp $end\l  1 exp: . a\l  2    | . b\l  
3 a: .  [$end]\l  4 b: .  [$end]\l"]
   0 -> 1 [style=dashed label="exp"]
   0 -> 2 [style=dashed label="a"]
   0 -> 3 [style=dashed label="b"]
-  1 [label="State 1\n  0 $accept: exp . $end\l"]
+  0 -> "0R3" [style=solid]
+ "0R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  0 -> "0R4d" [label="[$end]", style=solid]
+ "0R4d" [label="R4", fillcolor=5, shape=diamond, style=filled]
+  1 [label="State 1\n\l  0 $accept: exp . $end\l"]
   1 -> 4 [style=solid label="$end"]
-  2 [label="State 2\n  1 exp: a .\l"]
-  2 -> "2R1e" [style = solid]
- "2R1e" [style = filled, shape = diamond, fillcolor = 3, label = "R1"]
-  3 [label="State 3\n  2 exp: b .\l"]
-  3 -> "3R2e" [style = solid]
- "3R2e" [style = filled, shape = diamond, fillcolor = 3, label = "R2"]
-  4 [label="State 4\n  0 $accept: exp $end .\l"]
-  4 -> "4R0e" [style = solid]
- "4R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
+  2 [label="State 2\n\l  1 exp: a .\l"]
+  2 -> "2R1" [style=solid]
+ "2R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
+  3 [label="State 3\n\l  2 exp: b .\l"]
+  3 -> "3R2" [style=solid]
+ "3R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+  4 [label="State 4\n\l  0 $accept: exp $end .\l"]
+  4 -> "4R0" [style=solid]
+ "4R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
 ]])
 
 ## ---------------------------------------- ##
@@ -454,51 +454,51 @@ b: ;
 c: ;
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . exp $end\l  1 exp: . a ';'\l  2    | . a 
';'\l  3    | . a '.'\l  4    | . b '?'\l  5    | . b '!'\l  6    | . c '?'\l  
7    | . c ';'\l  8 a: .  [';', '.']\l  9 b: .  ['?', '!']\l 10 c: .  [';', 
'?']\l"]
-  0 -> "0R8e" [style = solid]
- "0R8e" [style = filled, shape = diamond, fillcolor = 3, label = "R8"]
-  0 -> "0R9e" [label = "['?', '!']" style = solid]
- "0R9e" [style = filled, shape = diamond, fillcolor = 3, label = "R9"]
-  0 -> "0R10d" [label = "[';', '?']" style = solid]
- "0R10d" [style = filled, shape = diamond, fillcolor = 5, label = "R10"]
+  0 [label="State 0\n\l  0 $accept: . exp $end\l  1 exp: . a ';'\l  2    | . a 
';'\l  3    | . a '.'\l  4    | . b '?'\l  5    | . b '!'\l  6    | . c '?'\l  
7    | . c ';'\l  8 a: .  [';', '.']\l  9 b: .  ['?', '!']\l 10 c: .  [';', 
'?']\l"]
   0 -> 1 [style=dashed label="exp"]
   0 -> 2 [style=dashed label="a"]
   0 -> 3 [style=dashed label="b"]
   0 -> 4 [style=dashed label="c"]
-  1 [label="State 1\n  0 $accept: exp . $end\l"]
+  0 -> "0R8" [style=solid]
+ "0R8" [label="R8", fillcolor=3, shape=diamond, style=filled]
+  0 -> "0R9" [label="['?', '!']", style=solid]
+ "0R9" [label="R9", fillcolor=3, shape=diamond, style=filled]
+  0 -> "0R10d" [label="[';', '?']", style=solid]
+ "0R10d" [label="R10", fillcolor=5, shape=diamond, style=filled]
+  1 [label="State 1\n\l  0 $accept: exp . $end\l"]
   1 -> 5 [style=solid label="$end"]
-  2 [label="State 2\n  1 exp: a . ';'\l  2    | a . ';'\l  3    | a . '.'\l"]
+  2 [label="State 2\n\l  1 exp: a . ';'\l  2    | a . ';'\l  3    | a . '.'\l"]
   2 -> 6 [style=solid label="';'"]
   2 -> 7 [style=solid label="'.'"]
-  3 [label="State 3\n  4 exp: b . '?'\l  5    | b . '!'\l"]
+  3 [label="State 3\n\l  4 exp: b . '?'\l  5    | b . '!'\l"]
   3 -> 8 [style=solid label="'?'"]
   3 -> 9 [style=solid label="'!'"]
-  4 [label="State 4\n  6 exp: c . '?'\l  7    | c . ';'\l"]
+  4 [label="State 4\n\l  6 exp: c . '?'\l  7    | c . ';'\l"]
   4 -> 10 [style=solid label="';'"]
   4 -> 11 [style=solid label="'?'"]
-  5 [label="State 5\n  0 $accept: exp $end .\l"]
-  5 -> "5R0e" [style = solid]
- "5R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
-  6 [label="State 6\n  1 exp: a ';' .  [$end]\l  2    | a ';' .  [$end]\l"]
-  6 -> "6R1e" [style = solid]
- "6R1e" [style = filled, shape = diamond, fillcolor = 3, label = "R1"]
-  6 -> "6R2d" [label = "[$end]" style = solid]
- "6R2d" [style = filled, shape = diamond, fillcolor = 5, label = "R2"]
-  7 [label="State 7\n  3 exp: a '.' .\l"]
-  7 -> "7R3e" [style = solid]
- "7R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  8 [label="State 8\n  4 exp: b '?' .\l"]
-  8 -> "8R4e" [style = solid]
- "8R4e" [style = filled, shape = diamond, fillcolor = 3, label = "R4"]
-  9 [label="State 9\n  5 exp: b '!' .\l"]
-  9 -> "9R5e" [style = solid]
- "9R5e" [style = filled, shape = diamond, fillcolor = 3, label = "R5"]
-  10 [label="State 10\n  7 exp: c ';' .\l"]
-  10 -> "10R7e" [style = solid]
- "10R7e" [style = filled, shape = diamond, fillcolor = 3, label = "R7"]
-  11 [label="State 11\n  6 exp: c '?' .\l"]
-  11 -> "11R6e" [style = solid]
- "11R6e" [style = filled, shape = diamond, fillcolor = 3, label = "R6"]
+  5 [label="State 5\n\l  0 $accept: exp $end .\l"]
+  5 -> "5R0" [style=solid]
+ "5R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+  6 [label="State 6\n\l  1 exp: a ';' .  [$end]\l  2    | a ';' .  [$end]\l"]
+  6 -> "6R1" [style=solid]
+ "6R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
+  6 -> "6R2d" [label="[$end]", style=solid]
+ "6R2d" [label="R2", fillcolor=5, shape=diamond, style=filled]
+  7 [label="State 7\n\l  3 exp: a '.' .\l"]
+  7 -> "7R3" [style=solid]
+ "7R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  8 [label="State 8\n\l  4 exp: b '?' .\l"]
+  8 -> "8R4" [style=solid]
+ "8R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
+  9 [label="State 9\n\l  5 exp: b '!' .\l"]
+  9 -> "9R5" [style=solid]
+ "9R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
+  10 [label="State 10\n\l  7 exp: c ';' .\l"]
+  10 -> "10R7" [style=solid]
+ "10R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
+  11 [label="State 11\n\l  6 exp: c '?' .\l"]
+  11 -> "11R6" [style=solid]
+ "11R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
 ]])
 
 ## ------------------------------------------------------ ##
@@ -514,85 +514,85 @@ opexp: exp '+' exp;
 imm: '0';
 ]],
 [[
-  0 [label="State 0\n  0 $accept: . exp $end\l  1 exp: . ifexp\l  2    | . 
opexp\l  3    | . imm\l  4 ifexp: . \"if\" exp \"then\" exp elseexp\l  7 opexp: 
. exp '+' exp\l  8 imm: . '0'\l"]
+  0 [label="State 0\n\l  0 $accept: . exp $end\l  1 exp: . ifexp\l  2    | . 
opexp\l  3    | . imm\l  4 ifexp: . \"if\" exp \"then\" exp elseexp\l  7 opexp: 
. exp '+' exp\l  8 imm: . '0'\l"]
   0 -> 1 [style=solid label="\"if\""]
   0 -> 2 [style=solid label="'0'"]
   0 -> 3 [style=dashed label="exp"]
   0 -> 4 [style=dashed label="ifexp"]
   0 -> 5 [style=dashed label="opexp"]
   0 -> 6 [style=dashed label="imm"]
-  1 [label="State 1\n  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  4      | \"if\" . exp \"then\" exp 
elseexp\l  7 opexp: . exp '+' exp\l  8 imm: . '0'\l"]
+  1 [label="State 1\n\l  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  4      | \"if\" . exp \"then\" exp 
elseexp\l  7 opexp: . exp '+' exp\l  8 imm: . '0'\l"]
   1 -> 1 [style=solid label="\"if\""]
   1 -> 2 [style=solid label="'0'"]
   1 -> 7 [style=dashed label="exp"]
   1 -> 4 [style=dashed label="ifexp"]
   1 -> 5 [style=dashed label="opexp"]
   1 -> 6 [style=dashed label="imm"]
-  2 [label="State 2\n  8 imm: '0' .\l"]
-  2 -> "2R8e" [style = solid]
- "2R8e" [style = filled, shape = diamond, fillcolor = 3, label = "R8"]
-  3 [label="State 3\n  0 $accept: exp . $end\l  7 opexp: exp . '+' exp\l"]
+  2 [label="State 2\n\l  8 imm: '0' .\l"]
+  2 -> "2R8" [style=solid]
+ "2R8" [label="R8", fillcolor=3, shape=diamond, style=filled]
+  3 [label="State 3\n\l  0 $accept: exp . $end\l  7 opexp: exp . '+' exp\l"]
   3 -> 8 [style=solid label="$end"]
   3 -> 9 [style=solid label="'+'"]
-  4 [label="State 4\n  1 exp: ifexp .\l"]
-  4 -> "4R1e" [style = solid]
- "4R1e" [style = filled, shape = diamond, fillcolor = 3, label = "R1"]
-  5 [label="State 5\n  2 exp: opexp .\l"]
-  5 -> "5R2e" [style = solid]
- "5R2e" [style = filled, shape = diamond, fillcolor = 3, label = "R2"]
-  6 [label="State 6\n  3 exp: imm .\l"]
-  6 -> "6R3e" [style = solid]
- "6R3e" [style = filled, shape = diamond, fillcolor = 3, label = "R3"]
-  7 [label="State 7\n  4 ifexp: \"if\" exp . \"then\" exp elseexp\l  7 opexp: 
exp . '+' exp\l"]
+  4 [label="State 4\n\l  1 exp: ifexp .\l"]
+  4 -> "4R1" [style=solid]
+ "4R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
+  5 [label="State 5\n\l  2 exp: opexp .\l"]
+  5 -> "5R2" [style=solid]
+ "5R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
+  6 [label="State 6\n\l  3 exp: imm .\l"]
+  6 -> "6R3" [style=solid]
+ "6R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
+  7 [label="State 7\n\l  4 ifexp: \"if\" exp . \"then\" exp elseexp\l  7 
opexp: exp . '+' exp\l"]
   7 -> 10 [style=solid label="\"then\""]
   7 -> 9 [style=solid label="'+'"]
-  8 [label="State 8\n  0 $accept: exp $end .\l"]
-  8 -> "8R0e" [style = solid]
- "8R0e" [style = filled, shape = diamond, fillcolor = 1, label = "Acc"]
-  9 [label="State 9\n  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  7 opexp: . exp '+' exp\l  7      | 
exp '+' . exp\l  8 imm: . '0'\l"]
+  8 [label="State 8\n\l  0 $accept: exp $end .\l"]
+  8 -> "8R0" [style=solid]
+ "8R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
+  9 [label="State 9\n\l  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  7 opexp: . exp '+' exp\l  7      | 
exp '+' . exp\l  8 imm: . '0'\l"]
   9 -> 1 [style=solid label="\"if\""]
   9 -> 2 [style=solid label="'0'"]
   9 -> 11 [style=dashed label="exp"]
   9 -> 4 [style=dashed label="ifexp"]
   9 -> 5 [style=dashed label="opexp"]
   9 -> 6 [style=dashed label="imm"]
-  10 [label="State 10\n  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  4      | \"if\" exp \"then\" . exp 
elseexp\l  7 opexp: . exp '+' exp\l  8 imm: . '0'\l"]
+  10 [label="State 10\n\l  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  
4 ifexp: . \"if\" exp \"then\" exp elseexp\l  4      | \"if\" exp \"then\" . 
exp elseexp\l  7 opexp: . exp '+' exp\l  8 imm: . '0'\l"]
   10 -> 1 [style=solid label="\"if\""]
   10 -> 2 [style=solid label="'0'"]
   10 -> 12 [style=dashed label="exp"]
   10 -> 4 [style=dashed label="ifexp"]
   10 -> 5 [style=dashed label="opexp"]
   10 -> 6 [style=dashed label="imm"]
-  11 [label="State 11\n  7 opexp: exp . '+' exp\l  7      | exp '+' exp .  
[$end, \"then\", \"else\", '+']\l"]
-  11 -> "11R7e" [style = solid]
- "11R7e" [style = filled, shape = diamond, fillcolor = 3, label = "R7"]
-  11 -> "11R7d" [label = "['+']" style = solid]
- "11R7d" [style = filled, shape = diamond, fillcolor = 5, label = "R7"]
+  11 [label="State 11\n\l  7 opexp: exp . '+' exp\l  7      | exp '+' exp .  
[$end, \"then\", \"else\", '+']\l"]
   11 -> 9 [style=solid label="'+'"]
-  12 [label="State 12\n  4 ifexp: \"if\" exp \"then\" exp . elseexp\l  5 
elseexp: . \"else\" exp\l  6        | .  [$end, \"then\", \"else\", '+']\l  7 
opexp: exp . '+' exp\l"]
-  12 -> "12R6e" [style = solid]
- "12R6e" [style = filled, shape = diamond, fillcolor = 3, label = "R6"]
-  12 -> "12R6d" [label = "[\"else\", '+']" style = solid]
- "12R6d" [style = filled, shape = diamond, fillcolor = 5, label = "R6"]
+  11 -> "11R7d" [label="['+']", style=solid]
+ "11R7d" [label="R7", fillcolor=5, shape=diamond, style=filled]
+  11 -> "11R7" [style=solid]
+ "11R7" [label="R7", fillcolor=3, shape=diamond, style=filled]
+  12 [label="State 12\n\l  4 ifexp: \"if\" exp \"then\" exp . elseexp\l  5 
elseexp: . \"else\" exp\l  6        | .  [$end, \"then\", \"else\", '+']\l  7 
opexp: exp . '+' exp\l"]
   12 -> 13 [style=solid label="\"else\""]
   12 -> 9 [style=solid label="'+'"]
   12 -> 14 [style=dashed label="elseexp"]
-  13 [label="State 13\n  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  4 
ifexp: . \"if\" exp \"then\" exp elseexp\l  5 elseexp: \"else\" . exp\l  7 
opexp: . exp '+' exp\l  8 imm: . '0'\l"]
+  12 -> "12R6d" [label="[\"else\", '+']", style=solid]
+ "12R6d" [label="R6", fillcolor=5, shape=diamond, style=filled]
+  12 -> "12R6" [style=solid]
+ "12R6" [label="R6", fillcolor=3, shape=diamond, style=filled]
+  13 [label="State 13\n\l  1 exp: . ifexp\l  2    | . opexp\l  3    | . imm\l  
4 ifexp: . \"if\" exp \"then\" exp elseexp\l  5 elseexp: \"else\" . exp\l  7 
opexp: . exp '+' exp\l  8 imm: . '0'\l"]
   13 -> 1 [style=solid label="\"if\""]
   13 -> 2 [style=solid label="'0'"]
   13 -> 15 [style=dashed label="exp"]
   13 -> 4 [style=dashed label="ifexp"]
   13 -> 5 [style=dashed label="opexp"]
   13 -> 6 [style=dashed label="imm"]
-  14 [label="State 14\n  4 ifexp: \"if\" exp \"then\" exp elseexp .\l"]
-  14 -> "14R4e" [style = solid]
- "14R4e" [style = filled, shape = diamond, fillcolor = 3, label = "R4"]
-  15 [label="State 15\n  5 elseexp: \"else\" exp .  [$end, \"then\", \"else\", 
'+']\l  7 opexp: exp . '+' exp\l"]
-  15 -> "15R5e" [style = solid]
- "15R5e" [style = filled, shape = diamond, fillcolor = 3, label = "R5"]
-  15 -> "15R5d" [label = "['+']" style = solid]
- "15R5d" [style = filled, shape = diamond, fillcolor = 5, label = "R5"]
+  14 [label="State 14\n\l  4 ifexp: \"if\" exp \"then\" exp elseexp .\l"]
+  14 -> "14R4" [style=solid]
+ "14R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
+  15 [label="State 15\n\l  5 elseexp: \"else\" exp .  [$end, \"then\", 
\"else\", '+']\l  7 opexp: exp . '+' exp\l"]
   15 -> 9 [style=solid label="'+'"]
+  15 -> "15R5d" [label="['+']", style=solid]
+ "15R5d" [label="R5", fillcolor=5, shape=diamond, style=filled]
+  15 -> "15R5" [style=solid]
+ "15R5" [label="R5", fillcolor=3, shape=diamond, style=filled]
 ]])
 
 m4_popdef([AT_TEST])
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]