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

@@ -168,15 +168,24 @@ extern int max_user_token_number;
extern int pure_parser;
/* Report the length of the RHS. */
/* Return the length of the RHS. */
int rule_rhs_length PARAMS ((rule_t *rule));
/* Print this RULE's RHS on OUT. */
void rule_rhs_print PARAMS ((rule_t *rule, FILE *out));
/* Print this RULE on OUT. */
void rule_print PARAMS ((rule_t *rule, FILE *out));
/* Dump RITEM for traces. */
void ritem_print PARAMS ((FILE *out));
/* Return the size of the longest rule RHS. */
size_t ritem_longest_rhs PARAMS ((void));
/* Print the grammar's rules on OUT. */
void grammar_rules_print PARAMS ((FILE *out));
/* Dump the grammar. */
void grammar_dump PARAMS ((FILE *out, const char *title));