mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 22:03:02 +00:00
* 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:
24
src/LR0.c
24
src/LR0.c
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------.
|
||||
|
||||
Reference in New Issue
Block a user