mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
Now that states have a complete set of members, the linked list of
reductions is useless: just fill directly the state's reductions member. * src/state.h (struct reductions): Remove member `number' and `next'. * src/LR0.c (first_reduction, last_reduction): Remove. (save_reductions): Don't link the new reductions, store them in this_state. * src/lalr.c (set_state_table): No need to attach reductions to states, it's already done. * src/output.c (output_actions): No longer free the shifts, then the reductions, then the states: free all the states and their members.
This commit is contained in:
12
src/output.c
12
src/output.c
@@ -885,6 +885,7 @@ output_check (void)
|
||||
static void
|
||||
output_actions (void)
|
||||
{
|
||||
int i;
|
||||
nvectors = nstates + nvars;
|
||||
|
||||
froms = XCALLOC (short *, nvectors);
|
||||
@@ -893,8 +894,6 @@ output_actions (void)
|
||||
width = XCALLOC (short, nvectors);
|
||||
|
||||
token_actions ();
|
||||
LIST_FREE (shifts, first_shift);
|
||||
LIST_FREE (reductions, first_reduction);
|
||||
XFREE (LA);
|
||||
XFREE (LAruleno);
|
||||
|
||||
@@ -910,7 +909,14 @@ output_actions (void)
|
||||
output_table ();
|
||||
|
||||
output_check ();
|
||||
LIST_FREE (state_t, first_state);
|
||||
|
||||
for (i = 0; i < nstates; ++i)
|
||||
{
|
||||
XFREE (state_table[i]->shifts);
|
||||
XFREE (state_table[i]->reductions);
|
||||
XFREE (state_table[i]->errs);
|
||||
free (state_table[i]);
|
||||
}
|
||||
XFREE (state_table);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user