mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
Improve handling of multiple S/R conflicts in the same state and of S/R
conflicts involving multiple reductions. * src/conflicts.c (resolve_sr_conflict): Don't assign the error action set for a state here or Bison will abort if it is reassigned on a later conflicted reduction in the same state. Similarly, don't finalize and assign the solved conflicts report here or it will be lost if it is reassigned on a later conflicted reduction in the same state. (set_conflicts): Instead, assign them both here after all S/R conflicts in the state have been fully examined. * src/print.c (shift_set): Rename to... (no_reduce_set): ... this. (print_reductions): Update for rename, and add %nonassoc error action tokens to no_reduce_set so that, when printing the first remaining reduction on an error action token, the reduction is enclosed in brackets. (print_results): Update for rename. * tests/conflicts.at (Solved conflicts report for multiple reductions in a state): New test case. (%nonassoc error actions for multiple reductions in a state): New test case. * src/main.c (main): Don't depend on C99 features.
This commit is contained in:
@@ -116,11 +116,12 @@ main (int argc, char *argv[])
|
||||
timevar_push (TV_CONFLICTS);
|
||||
conflicts_solve ();
|
||||
{
|
||||
state_number old_to_new[nstates];
|
||||
state_number *old_to_new = xnmalloc (nstates, sizeof *old_to_new);
|
||||
state_number nstates_old = nstates;
|
||||
state_remove_unreachable_states (old_to_new);
|
||||
lalr_update_state_numbers (old_to_new, nstates_old);
|
||||
conflicts_update_state_numbers (old_to_new, nstates_old);
|
||||
free (old_to_new);
|
||||
}
|
||||
conflicts_print ();
|
||||
timevar_pop (TV_CONFLICTS);
|
||||
|
||||
Reference in New Issue
Block a user