mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
* src/state.h, src/state.c (reductions_new): New.
* src/LR0.c (set_state_table): Let all the states have a `reductions', even if reduced to 0. (save_reductions): Adjust. * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust. * src/print.c (print_reductions, print_actions): Adjust. * src/output.c (action_row): Adjust.
This commit is contained in:
16
src/state.c
16
src/state.c
@@ -64,3 +64,19 @@ errs_dup (errs *src)
|
||||
memcpy (res->errs, src->errs, src->nerrs);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*-------------------------------------.
|
||||
| Create a new array of N reductions. |
|
||||
`-------------------------------------*/
|
||||
|
||||
#define REDUCTIONS_ALLOC(Nreductions) \
|
||||
(reductions *) xcalloc ((unsigned) (sizeof (reductions) \
|
||||
+ (Nreductions - 1) * sizeof (short)), 1)
|
||||
|
||||
reductions *
|
||||
reductions_new (int n)
|
||||
{
|
||||
reductions *res = REDUCTIONS_ALLOC (n);
|
||||
res->nreds = n;
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user