* src/state.h, src/state.c (errs_new, errs_dup): New.

* src/LR0.c (set_state_table): Let all the states have an errs,
even if reduced to 0.
* src/print.c (print_errs, print_reductions): Adjust.
* src/output.c (output_actions, action_row): Adjust.
* src/conflicts.c (resolve_sr_conflict): Adjust.
This commit is contained in:
Akim Demaille
2001-12-27 18:10:48 +00:00
parent 13ca549a75
commit 2cec70b9f1
7 changed files with 70 additions and 45 deletions

View File

@@ -541,22 +541,20 @@ save_reductions (void)
static void
set_state_table (void)
{
state_t *sp;
state_table = XCALLOC (state_t *, nstates);
{
state_t *sp;
for (sp = first_state; sp; sp = sp->next)
state_table[sp->number] = sp;
}
for (sp = first_state; sp; sp = sp->next)
{
/* Pessimization, but simplification of the code: make sure all
the states have a shifts and errs, even if reduced to 0. */
if (!sp->shifts)
sp->shifts = shifts_new (0);
if (!sp->errs)
sp->errs = errs_new (0);
/* Pessimization, but simplification of the code: make sure all the
states have a shifts, even if reduced to 0 shifts. */
{
int i;
for (i = 0; i < nstates; i++)
if (!state_table[i]->shifts)
state_table[i]->shifts = shifts_new (0);
}
state_table[sp->number] = sp;
}
}
/*-------------------------------------------------------------------.