mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
Add %define lr.keep_unreachable_states.
* NEWS (2.3a+): Mention it in the entry for unreachable state removal. * doc/bison.texinfo (Decl Summary): Mention it in the %define entry. * src/main.c (main): Implement it. * tests/conflicts.at (Unreachable States After Conflict Resolution): Extend to test it, and fix a typo.
This commit is contained in:
18
src/main.c
18
src/main.c
@@ -114,14 +114,16 @@ main (int argc, char *argv[])
|
||||
declarations. */
|
||||
timevar_push (TV_CONFLICTS);
|
||||
conflicts_solve ();
|
||||
{
|
||||
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);
|
||||
}
|
||||
muscle_percent_define_default ("lr.keep_unreachable_states", "false");
|
||||
if (!muscle_percent_define_flag_if ("lr.keep_unreachable_states"))
|
||||
{
|
||||
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