mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
Pessimize the code to simplify it: from now on, all the states
have a valid SHIFTS, which NSHIFTS is possibly 0. * src/LR0.c (shifts_new): Be global and move to.. * src/state.c, src/state.h: here. * src/conflicts, src/lalr.c, src/output.c, src/print.c, * src/print_graph: Adjust.
This commit is contained in:
35
src/output.c
35
src/output.c
@@ -587,40 +587,33 @@ action_row (int state)
|
||||
}
|
||||
}
|
||||
|
||||
shiftp = state_table[state].shift_table;
|
||||
|
||||
/* Now see which tokens are allowed for shifts in this state. For
|
||||
them, record the shift as the thing to do. So shift is preferred
|
||||
to reduce. */
|
||||
shiftp = state_table[state].shift_table;
|
||||
|
||||
if (shiftp)
|
||||
for (i = 0; i < shiftp->nshifts; i++)
|
||||
{
|
||||
k = shiftp->nshifts;
|
||||
shift_state = shiftp->shifts[i];
|
||||
if (!shift_state)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < k; i++)
|
||||
{
|
||||
shift_state = shiftp->shifts[i];
|
||||
if (!shift_state)
|
||||
continue;
|
||||
symbol = state_table[shift_state].accessing_symbol;
|
||||
|
||||
symbol = state_table[shift_state].accessing_symbol;
|
||||
if (ISVAR (symbol))
|
||||
break;
|
||||
|
||||
if (ISVAR (symbol))
|
||||
break;
|
||||
actrow[symbol] = shift_state;
|
||||
|
||||
actrow[symbol] = shift_state;
|
||||
|
||||
/* Do not use any default reduction if there is a shift for
|
||||
error */
|
||||
if (symbol == error_token_number)
|
||||
nodefault = 1;
|
||||
}
|
||||
/* Do not use any default reduction if there is a shift for
|
||||
error */
|
||||
if (symbol == error_token_number)
|
||||
nodefault = 1;
|
||||
}
|
||||
|
||||
errp = err_table[state];
|
||||
|
||||
/* See which tokens are an explicit error in this state (due to
|
||||
%nonassoc). For them, record MINSHORT as the action. */
|
||||
errp = err_table[state];
|
||||
|
||||
if (errp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user