mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53: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:
@@ -167,6 +167,9 @@ print_reductions (FILE *out, state_t *state)
|
||||
errs *errp = state->errs;
|
||||
int nodefault = 0;
|
||||
|
||||
if (redp->nreds == 0)
|
||||
return;
|
||||
|
||||
if (state->consistent)
|
||||
{
|
||||
int rule = redp->rules[0];
|
||||
@@ -302,7 +305,7 @@ print_actions (FILE *out, state_t *state)
|
||||
reductions *redp = state->reductions;
|
||||
shifts *shiftp = state->shifts;
|
||||
|
||||
if (!shiftp->nshifts && !redp)
|
||||
if (shiftp->nshifts == 0 && redp->nreds == 0)
|
||||
{
|
||||
if (final_state == state->number)
|
||||
fprintf (out, _(" $default\taccept\n"));
|
||||
@@ -313,8 +316,7 @@ print_actions (FILE *out, state_t *state)
|
||||
|
||||
print_shifts (out, state);
|
||||
print_errs (out, state);
|
||||
if (redp)
|
||||
print_reductions (out, state);
|
||||
print_reductions (out, state);
|
||||
print_gotos (out, state);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user