]> git.saurik.com Git - bison.git/commitdiff
For the XML output's terminal element, rename @number to @token-number,
authorJoel E. Denny <jdenny@ces.clemson.edu>
Sun, 28 Oct 2007 00:24:22 +0000 (00:24 +0000)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Sun, 28 Oct 2007 00:24:22 +0000 (00:24 +0000)
and add @symbol-number.  In the nonterminal element, rename @number to
@symbol-number.  Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
* data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
renames.
(xsl:template match="nonterminal"): Likewise.
* data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
(xsl:template match="nonterminal"): Likewise.
* src/print-xml.c (print_grammar): Implement.

ChangeLog
data/xslt/xml2text.xsl
data/xslt/xml2xhtml.xsl
src/print-xml.c

index d8e62d845ef420829a3d6912d419076e1ac78c6e..e666d5885f8356a6f91219fbda4f15decfb0c8f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-10-27  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       For the XML output's terminal element, rename @number to @token-number,
+       and add @symbol-number.  In the nonterminal element, rename @number to
+       @symbol-number.  Discussed starting at
+       <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
+       * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
+       renames.
+       (xsl:template match="nonterminal"): Likewise.
+       * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
+       (xsl:template match="nonterminal"): Likewise.
+       * src/print-xml.c (print_grammar): Implement.
+
 2007-10-21  Joel E. Denny  <jdenny@ces.clemson.edu>
 
        * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
 2007-10-21  Joel E. Denny  <jdenny@ces.clemson.edu>
 
        * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
index 291045ad92c55b5fa0dce256ecfeec7718b07a50..9271e8c7c72b73a9b733e883abc3e3e6adf1116b 100644 (file)
     </xsl:with-param>
     <xsl:with-param name="line-length" select="66" />
     <xsl:with-param name="text">
     </xsl:with-param>
     <xsl:with-param name="line-length" select="66" />
     <xsl:with-param name="text">
-      <xsl:value-of select="concat(' (', @number, ')')"/>
+      <xsl:value-of select="concat(' (', @token-number, ')')"/>
       <xsl:apply-templates select="rule" />
     </xsl:with-param>
   </xsl:call-template>
       <xsl:apply-templates select="rule" />
     </xsl:with-param>
   </xsl:call-template>
 
 <xsl:template match="nonterminal">
   <xsl:value-of select="@name"/>
 
 <xsl:template match="nonterminal">
   <xsl:value-of select="@name"/>
-  <xsl:value-of select="concat(' (', @number, ')')"/>
+  <xsl:value-of select="concat(' (', @symbol-number, ')')"/>
   <xsl:text>&#10;</xsl:text>
   <xsl:variable name="output">
     <xsl:call-template name="line-wrap">
   <xsl:text>&#10;</xsl:text>
   <xsl:variable name="output">
     <xsl:call-template name="line-wrap">
index 891aa68f719e69ddeaa7a9584a991b11aab6e6f8..ff8504550dbe7fe32716f4ada3a9603326f44295 100644 (file)
 
 <xsl:template match="terminal">
   <b><xsl:value-of select="@name"/></b>
 
 <xsl:template match="terminal">
   <b><xsl:value-of select="@name"/></b>
-  <xsl:value-of select="concat(' (', @number, ')')"/>
+  <xsl:value-of select="concat(' (', @token-number, ')')"/>
   <xsl:apply-templates select="rule"/>
   <xsl:text>&#10;</xsl:text>
 </xsl:template>
   <xsl:apply-templates select="rule"/>
   <xsl:text>&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="nonterminal">
   <b><xsl:value-of select="@name"/></b>
 
 <xsl:template match="nonterminal">
   <b><xsl:value-of select="@name"/></b>
-  <xsl:value-of select="concat(' (', @number, ')')"/>
+  <xsl:value-of select="concat(' (', @symbol-number, ')')"/>
   <xsl:text>&#10;    </xsl:text>
   <xsl:if test="left/rule">
     <xsl:text>on left:</xsl:text>
   <xsl:text>&#10;    </xsl:text>
   <xsl:if test="left/rule">
     <xsl:text>on left:</xsl:text>
index 73a18af5f74c8de54dc37a2f33b3edf6dedc3450..da8bfcabd8e1dae914e2e24355794fe1a78bbb82 100644 (file)
@@ -429,8 +429,9 @@ print_grammar (FILE *out, int level)
        item_number *rhsp;
 
        xml_printf (out, level + 2,
        item_number *rhsp;
 
        xml_printf (out, level + 2,
-                   "<terminal number=\"%d\" name=\"%s\">",
-                   i, xml_escape (tag));
+                   "<terminal symbol-number=\"%d\" token-number=\"%d\""
+                    " name=\"%s\">",
+                   token_translations[i], i, xml_escape (tag));
 
        for (r = 0; r < nrules; r++)
          for (rhsp = rules[r].rhs; *rhsp >= 0; rhsp++)
 
        for (r = 0; r < nrules; r++)
          for (rhsp = rules[r].rhs; *rhsp >= 0; rhsp++)
@@ -465,7 +466,7 @@ print_grammar (FILE *out, int level)
        }
 
       xml_printf (out, level + 2,
        }
 
       xml_printf (out, level + 2,
-                 "<nonterminal number=\"%d\" name=\"%s\">",
+                 "<nonterminal symbol-number=\"%d\" name=\"%s\">",
                  i, xml_escape (tag));
 
       if (left_count > 0)
                  i, xml_escape (tag));
 
       if (left_count > 0)