* 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:
Akim Demaille
2001-12-27 18:10:48 +00:00
parent 13ca549a75
commit 2cec70b9f1
7 changed files with 70 additions and 45 deletions

View File

@@ -375,12 +375,11 @@ action_row (state_t *state)
/* See which tokens are an explicit error in this state (due to
%nonassoc). For them, record MINSHORT as the action. */
if (errp)
for (i = 0; i < errp->nerrs; i++)
{
int symbol = errp->errs[i];
actrow[symbol] = MINSHORT;
}
for (i = 0; i < errp->nerrs; i++)
{
int symbol = errp->errs[i];
actrow[symbol] = MINSHORT;
}
/* Now find the most common reduction and make it the default action
for this state. */
@@ -903,9 +902,9 @@ output_actions (void)
for (i = 0; i < nstates; ++i)
{
XFREE (state_table[i]->shifts);
free (state_table[i]->shifts);
XFREE (state_table[i]->reductions);
XFREE (state_table[i]->errs);
free (state_table[i]->errs);
free (state_table[i]);
}
XFREE (state_table);