447 |
for (i = state->nlookaheads - 1; i >= 0; --i) |
for (i = state->nlookaheads - 1; i >= 0; --i) |
448 |
/* and find each token which the rule finds acceptable |
/* and find each token which the rule finds acceptable |
449 |
to come next */ |
to come next */ |
450 |
for (j = 0; j < ntokens; j++) |
BITSET_EXECUTE (state->lookaheads[i], 0, j, |
451 |
|
{ |
452 |
/* and record this rule as the rule to use if that |
/* and record this rule as the rule to use if that |
453 |
token follows. */ |
token follows. */ |
454 |
if (bitset_test (state->lookaheads[i], j)) |
if (actrow[j] != 0) |
455 |
{ |
conflicted = conflrow[j] = 1; |
456 |
if (actrow[j] != 0) |
actrow[j] = -state->lookaheads_rule[i]->number; |
457 |
conflicted = conflrow[j] = 1; |
}); |
|
actrow[j] = -state->lookaheads_rule[i]->number; |
|
|
} |
|
458 |
} |
} |
459 |
|
|
460 |
/* Now see which tokens are allowed for shifts in this state. For |
/* Now see which tokens are allowed for shifts in this state. For |
461 |
them, record the shift as the thing to do. So shift is preferred |
them, record the shift as the thing to do. So shift is preferred |
462 |
to reduce. */ |
to reduce. */ |
463 |
for (i = 0; i < shiftp->nshifts; i++) |
for (i = 0; i < shiftp->nshifts && SHIFT_IS_SHIFT (shiftp, i); i++) |
464 |
{ |
if (!SHIFT_IS_DISABLED (shiftp, i)) |
465 |
symbol_number_t symbol; |
{ |
466 |
state_number_t shift_state = shiftp->shifts[i]; |
symbol_number_t symbol = SHIFT_SYMBOL (shiftp, i); |
467 |
if (!shift_state) |
state_number_t shift_state = shiftp->shifts[i]; |
468 |
continue; |
|
469 |
|
if (actrow[symbol] != 0) |
470 |
symbol = states[shift_state]->accessing_symbol; |
conflicted = conflrow[symbol] = 1; |
471 |
|
actrow[symbol] = state_number_as_int (shift_state); |
472 |
if (ISVAR (symbol)) |
|
473 |
break; |
/* Do not use any default reduction if there is a shift for |
474 |
|
error */ |
475 |
if (actrow[symbol] != 0) |
if (symbol == errtoken->number) |
476 |
conflicted = conflrow[symbol] = 1; |
nodefault = 1; |
477 |
actrow[symbol] = state_number_as_int (shift_state); |
} |
|
|
|
|
/* Do not use any default reduction if there is a shift for |
|
|
error */ |
|
|
if (symbol == errtoken->number) |
|
|
nodefault = 1; |
|
|
} |
|
478 |
|
|
479 |
/* See which tokens are an explicit error in this state (due to |
/* See which tokens are an explicit error in this state (due to |
480 |
%nonassoc). For them, record SHRT_MIN as the action. */ |
%nonassoc). For them, record SHRT_MIN as the action. */ |