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

@@ -87,6 +87,17 @@ struct symbol_s
#define NUMBER_UNDEFINED ((symbol_number_t) -1)
/* Return the tag of this SYMBOL in a printable form. Warning: uses
the QUOTEARG slot 0. */
const char *symbol_tag_get PARAMS ((symbol_t *symbol));
/* Return the tag of this SYMBOL in a printable form. Use the
QUOTEARG slot number N. */
const char *symbol_tag_get_n PARAMS ((symbol_t *symbol, int n));
/* Print the tag of this SYMBOL. */
void symbol_tag_print PARAMS ((symbol_t *symbol, FILE *out));
/* Fetch (or create) the symbol associated to KEY. */
symbol_t *getsym PARAMS ((const char *key, location_t location));