style: factor printing of rules

* src/gram.h, src/gram.c (rule_print): New.
Use it.
This commit is contained in:
Akim Demaille
2019-02-09 07:15:56 +01:00
parent f293345aa8
commit ad7d8af6d1
4 changed files with 15 additions and 7 deletions

View File

@@ -248,6 +248,9 @@ size_t rule_rhs_length (rule const *r);
/* Print this rule's RHS on OUT. */
void rule_rhs_print (rule const *r, FILE *out);
/* Print this rule on OUT. If a PREVIOUS_RULE was already displayed,
avoid useless repetitions of their LHS. */
void rule_print (rule const *r, rule const *prev_rule, FILE *out);