+/*----------------------------------------------------------------.
+| Print this RULE's number and lhs on OUT. If a PREVIOUS_LHS was |
+| already displayed (by a previous call for another rule), avoid |
+| useless repetitions. |
+`----------------------------------------------------------------*/
+
+void
+rule_lhs_print (rule_t *rule, symbol_t *previous_lhs, FILE *out)
+{
+ fprintf (out, " %3d ", rule->number - 1);
+ if (previous_lhs != rule->lhs)
+ {
+ fprintf (out, "%s:", symbol_tag_get (rule->lhs));
+ }
+ else
+ {
+ int n;
+ for (n = strlen (symbol_tag_get (previous_lhs)); n > 0; --n)
+ fputc (' ', out);
+ fputc ('|', out);
+ }
+}
+
+