mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -429,8 +429,9 @@ print_grammar (FILE *out, int level)
|
||||
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++)
|
||||
@@ -465,7 +466,7 @@ print_grammar (FILE *out, int level)
|
||||
}
|
||||
|
||||
xml_printf (out, level + 2,
|
||||
"<nonterminal number=\"%d\" name=\"%s\">",
|
||||
"<nonterminal symbol-number=\"%d\" name=\"%s\">",
|
||||
i, xml_escape (tag));
|
||||
|
||||
if (left_count > 0)
|
||||
|
||||
Reference in New Issue
Block a user