+ /* 1. Each reduction is possibly masked by the lookaheads on which
+ we shift (S/R conflicts)... */
+ bitset_zero (shiftset);
+ {
+ transitions_t *transitions = state->transitions;
+ for (i = 0; i < transitions->num && TRANSITION_IS_SHIFT (transitions, i); i++)
+ if (!TRANSITION_IS_DISABLED (transitions, i))
+ {
+ /* If this state has a shift for the error token, don't use a
+ default rule. */
+ if (TRANSITION_IS_ERROR (transitions, i))
+ return NULL;
+ bitset_set (shiftset, TRANSITION_SYMBOL (transitions, i));
+ }
+ }
+
+ /* 2. Each reduction is possibly masked by the lookaheads on which
+ we raise an error (due to %nonassoc). */
+ {
+ errs_t *errp = state->errs;
+ for (i = 0; i < errp->num; i++)
+ if (errp->symbols[i])
+ bitset_set (shiftset, errp->symbols[i]);
+ }
+
+ for (i = 0; i < state->nlookaheads; ++i)