mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
multistart: adjust computation of initial core and adjust reports
Currently the core of the initial state is limited to the single rule on $accept. * src/lr0.c (generate_states): There may now be several rules on $accept. * src/graphviz.c (conclude_red): Recognize "final" transitions by the fact that we reduce to "$accept". * src/print.c (print_reduction): Likewise. * src/print-xml.c (print_reduction): Likewise.
This commit is contained in:
@@ -216,17 +216,18 @@ static void
|
||||
print_reduction (FILE *out, int level, char const *lookahead,
|
||||
rule *r, bool enabled)
|
||||
{
|
||||
if (r->number)
|
||||
const bool final = r->lhs->symbol == acceptsymbol;
|
||||
if (final)
|
||||
xml_printf (out, level,
|
||||
"<reduction symbol=\"%s\" rule=\"accept\" enabled=\"%s\"/>",
|
||||
xml_escape (lookahead),
|
||||
enabled ? "true" : "false");
|
||||
else
|
||||
xml_printf (out, level,
|
||||
"<reduction symbol=\"%s\" rule=\"%d\" enabled=\"%s\"/>",
|
||||
xml_escape (lookahead),
|
||||
r->number,
|
||||
enabled ? "true" : "false");
|
||||
else
|
||||
xml_printf (out, level,
|
||||
"<reduction symbol=\"%s\" rule=\"accept\" enabled=\"%s\"/>",
|
||||
xml_escape (lookahead),
|
||||
enabled ? "true" : "false");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user