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.
This commit is contained in:
Joel E. Denny
2007-10-28 00:24:22 +00:00
parent 255a6b901a
commit 32f19b6b47
4 changed files with 21 additions and 7 deletions

View File

@@ -298,7 +298,7 @@
<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>
@@ -315,7 +315,7 @@
<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>