multistart: introduce and use rule_is_initial

* src/gram.h (rule_is_initial): New.
* src/graphviz.c, src/print-xml.c, src/print.c, src/lalr.c: Use it.
Some of these occurrences were incorrect (checking whether this is
rule 0), and not behaving properly in the case of multistart.
This commit is contained in:
Akim Demaille
2020-11-08 17:50:46 +01:00
parent 4b0cd01fb7
commit a38d0b9145
6 changed files with 20 additions and 26 deletions

View File

@@ -135,7 +135,7 @@ conclude_red (struct obstack *out, int source, rule_number ruleno,
/* Build the associated diamond representation of the target rule. */
fprintf (fout, " \"%dR%d%s\" [label=\"",
source, ruleno, ed);
bool final = rules[ruleno].lhs->symbol == acceptsymbol;
bool const final = rule_is_initial (&rules[ruleno]);
if (final)
fprintf (fout, "Acc");
else