mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-28 13:43:02 +00:00
tables: scope reduction
* src/tables.c (token_actions): here.
This commit is contained in:
12
src/tables.c
12
src/tables.c
@@ -424,10 +424,6 @@ save_row (state_number s)
|
||||
static void
|
||||
token_actions (void)
|
||||
{
|
||||
state_number i;
|
||||
symbol_number j;
|
||||
rule_number r;
|
||||
|
||||
int nconflict = nondeterministic_parser ? conflicts_total_count () : 0;
|
||||
|
||||
yydefact = xnmalloc (nstates, sizeof *yydefact);
|
||||
@@ -441,9 +437,14 @@ token_actions (void)
|
||||
|
||||
/* Find the rules which are reduced. */
|
||||
if (!nondeterministic_parser)
|
||||
{
|
||||
rule_number r;
|
||||
for (r = 0; r < nrules; ++r)
|
||||
rules[r].useful = false;
|
||||
}
|
||||
|
||||
{
|
||||
state_number i;
|
||||
for (i = 0; i < nstates; ++i)
|
||||
{
|
||||
rule *default_reduction = action_row (states[i]);
|
||||
@@ -455,6 +456,7 @@ token_actions (void)
|
||||
conflicts. */
|
||||
if (!nondeterministic_parser)
|
||||
{
|
||||
symbol_number j;
|
||||
for (j = 0; j < ntokens; ++j)
|
||||
if (actrow[j] < 0 && actrow[j] != ACTION_NUMBER_MINIMUM)
|
||||
rules[item_number_as_rule_number (actrow[j])].useful = true;
|
||||
@@ -462,7 +464,7 @@ token_actions (void)
|
||||
rules[yydefact[i] - 1].useful = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
free (actrow);
|
||||
free (conflrow);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user