mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
* src/print.c (print_actions): Output the handling of `$' as the
traces do: shifting the token EOF. Before EOF was treated as a nonterminal. * tests/regression.at: Adjust some tests. * src/print_graph.c (print_core): Complete the set of items via closure. The next-to-final and final states are still unsatisfying, but that's to be addressed elsewhere. No longer output the rule numbers, but do output the state number. A single loop for the shifts + gotos is enough, but picked a distinct color for each. (print_graph): Initialize and finalize closure.
This commit is contained in:
15
src/print.c
15
src/print.c
@@ -111,21 +111,14 @@ print_actions (FILE *out, int state)
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < shiftp->nshifts; i++)
|
||||
for (i = 0; i < shiftp->nshifts && SHIFT_IS_SHIFT (shiftp, i); i++)
|
||||
if (!SHIFT_IS_DISABLED (shiftp, i))
|
||||
{
|
||||
int state1 = shiftp->shifts[i];
|
||||
int symbol = state_table[state1]->accessing_symbol;
|
||||
/* The following line used to be turned off. */
|
||||
if (ISVAR (symbol))
|
||||
break;
|
||||
if (symbol == 0) /* I.e. strcmp(tags[symbol],"$")==0 */
|
||||
fprintf (out,
|
||||
_(" $ \tgo to state %d\n"), state1);
|
||||
else
|
||||
fprintf (out,
|
||||
_(" %-4s\tshift, and go to state %d\n"),
|
||||
tags[symbol], state1);
|
||||
fprintf (out,
|
||||
_(" %-4s\tshift, and go to state %d\n"),
|
||||
tags[symbol], state1);
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
|
||||
Reference in New Issue
Block a user