* 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:
Akim Demaille
2001-12-27 18:11:06 +00:00
parent 2cec70b9f1
commit 80dac38c5e
7 changed files with 49 additions and 26 deletions

View File

@@ -326,7 +326,6 @@ action_row (state_t *state)
int i;
int default_rule = 0;
reductions *redp = state->reductions;
int nreds = redp ? redp->nreds : 0;
shifts *shiftp = state->shifts;
errs *errp = state->errs;
/* set nonzero to inhibit having any default reduction */
@@ -335,7 +334,7 @@ action_row (state_t *state)
for (i = 0; i < ntokens; i++)
actrow[i] = 0;
if (nreds >= 1)
if (redp->nreds >= 1)
{
int j;
/* loop over all the rules available here which require
@@ -384,7 +383,7 @@ action_row (state_t *state)
/* Now find the most common reduction and make it the default action
for this state. */
if (nreds >= 1 && !nodefault)
if (redp->nreds >= 1 && !nodefault)
{
if (state->consistent)
default_rule = redp->rules[0];