mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
In the XML output, list useless and unused symbols and rules with the
useful ones and add a "usefulness" attribute. Discussed starting at <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>. * src/gram.c (grammar_rules_partial_print_xml): Remove. (grammar_rules_print_xml): Print all rules instead of just those useful in the grammar, and add a "usefulness" attribute. * src/gram.h (grammar_rules_partial_print_xml): Remove prototype. * src/print-xml.c (print_rules_useless_in_parser): Remove. (print_grammar): Print all nonterminals instead of just useful ones, and add a "usefulness" attribute to nonterminals and terminals. (print_xml): Don't print a separate "reductions" or "rules-useless-in-parser" element. * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar. (reduce_xml): Remove. (reduce_token_unused_in_grammar): New. (reduce_nonterminal_useless_in_grammar): New. * src/reduce.h (reduce_xml): Remove prototype. (reduce_token_unused_in_grammar): Add prototype. (reduce_nonterminal_useless_in_grammar): Add prototype. * data/xslt/xml2text.xsl: Update for XML changes. * data/xslt/xml2xhtml.xsl: Update for XML changes. * tests/reduce.at (Useless Terminals): Update output. (Useless Rules): Update output. (Reduced Automaton): Update output. Say "Terminals unused in grammar" instead of "Unused terminals". * NEWS (2.3a+): Update. * doc/bison.texinfo (Understanding): Update example output. * src/reduce.c (reduce_output): Implement. * data/xslt/xml2text.xsl: Implement. * data/xslt/xml2xhtml.xsl: Implement.
This commit is contained in:
@@ -7197,14 +7197,14 @@ State 11 conflicts: 4 shift/reduce
|
||||
The next section reports useless tokens, nonterminal and rules. Useless
|
||||
nonterminals and rules are removed in order to produce a smaller parser,
|
||||
but useless tokens are preserved, since they might be used by the
|
||||
scanner (note the difference between ``useless'' and ``not used''
|
||||
scanner (note the difference between ``useless'' and ``unused''
|
||||
below):
|
||||
|
||||
@example
|
||||
Useless nonterminals:
|
||||
Nonterminals useless in grammar:
|
||||
useless
|
||||
|
||||
Terminals which are not used:
|
||||
Terminals unused in grammar:
|
||||
STR
|
||||
|
||||
Rules useless in grammar:
|
||||
|
||||
Reference in New Issue
Block a user