In XML output, remove redundant class attribute on symbol element.

* data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
* data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
look up a symbol to determine whether it's a nonterminal or terminal.
* src/gram.c (rule_rhs_print_xml): Remove class attribute.
* src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.

Add prec/assoc information to XML output.
* src/gram.c (grammar_rules_print_xml): For each rule that has a
%prec, add a percent_prec attribute.
* src/print-xml.c (print_grammar): For each terminal that has a
precedence or associativity, add a prec or assoc attribute.
(xml_indent): New.
(xml_puts): Use xml_indent.
(xml_printf): Use xml_indent.
* src/print-xml.h (xml_indent): Prototype.

* tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
<http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
This commit is contained in:
Joel E. Denny
2007-12-15 02:08:02 +00:00
parent d4a26c4832
commit 408476bca9
8 changed files with 66 additions and 19 deletions

View File

@@ -1266,7 +1266,7 @@ element:
| LABEL ':' optional_separator element
| LABEL ':' optional_separator position_not_place
| LABEL ':' optional_separator place
| '{}'
| '{' {} element_list '}'
{}
optional_element
| placeless_element