Copy BYacc's nice way to report the grammar.

* src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
New.
Don't print the rules' location, it is confusing and useless.
(rule_print): Use grammar_rhs_print.
* src/print.c (print_grammar): Use grammar_rules_print.
This commit is contained in:
Akim Demaille
2002-06-15 18:23:12 +00:00
parent ee000ba4fc
commit 6b98e4b563
16 changed files with 328 additions and 151 deletions

View File

@@ -235,11 +235,11 @@ prepare_tokens (void)
int j = 0;
for (i = 0; i < nsyms; i++)
{
/* Be sure not to use twice the same quotearg slot. */
/* Be sure not to use twice the same QUOTEARG slot:
SYMBOL_TAG_GET uses slot 0. */
const char *cp =
quotearg_n_style (1, c_quoting_style,
quotearg_style (escape_quoting_style,
symbols[i]->tag));
symbol_tag_get (symbols[i]));
/* Width of the next token, including the two quotes, the coma
and the space. */
int strsize = strlen (cp) + 2;