* src/state.h (state_number_t, STATE_NUMBER_MAX): New.

* src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
* src/output.c, src/print.c, src/print_graph.c: Propagate.
* src/LR0.h, src/LR0.h (final_state): Is a state_t*.
This commit is contained in:
Akim Demaille
2002-06-30 17:27:34 +00:00
parent 5a08f1ce21
commit d57650a5ff
10 changed files with 115 additions and 88 deletions

View File

@@ -113,7 +113,7 @@ print_shifts (FILE *out, state_t *state)
for (i = 0; i < shiftp->nshifts && SHIFT_IS_SHIFT (shiftp, i); i++)
if (!SHIFT_IS_DISABLED (shiftp, i))
{
int state1 = shiftp->shifts[i];
state_number_t state1 = shiftp->shifts[i];
symbol_number_t symbol = states[state1]->accessing_symbol;
fprintf (out,
_(" %-4s\tshift, and go to state %d\n"),
@@ -155,7 +155,7 @@ print_gotos (FILE *out, state_t *state)
for (; i < shiftp->nshifts; i++)
if (!SHIFT_IS_DISABLED (shiftp, i))
{
int state1 = shiftp->shifts[i];
state_number_t state1 = shiftp->shifts[i];
symbol_number_t symbol = states[state1]->accessing_symbol;
fprintf (out, _(" %-4s\tgo to state %d\n"),
symbol_tag_get (symbols[symbol]), state1);
@@ -309,7 +309,7 @@ print_actions (FILE *out, state_t *state)
if (shiftp->nshifts == 0 && redp->nreds == 0)
{
if (final_state == state->number)
if (state->number == final_state->number)
fprintf (out, _(" $default\taccept\n"));
else
fprintf (out, _(" NO ACTIONS\n"));
@@ -449,7 +449,7 @@ print_grammar (FILE *out)
void
print_results (void)
{
size_t i;
state_number_t i;
/* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but
that conflicts with Posix. */