* 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:
Akim Demaille
2001-12-13 11:01:51 +00:00
parent 107f7dfbd0
commit 2e729273d6
4 changed files with 38 additions and 42 deletions

View File

@@ -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)