+/*--------------------------------------.
+| Initializing the lookaheads members. |
+`--------------------------------------*/
+
+static void
+initialize_lookaheads (void)
+{
+ int i;
+ nLA = 0;
+ for (i = 0; i < nstates; i++)
+ {
+ int k;
+ int nlookaheads = 0;
+ reductions *rp = state_table[i]->reductions;
+ shifts *sp = state_table[i]->shifts;
+
+ if (rp
+ && (rp->nreds > 1 || (sp->nshifts && SHIFT_IS_SHIFT (sp, 0))))
+ nlookaheads += rp->nreds;
+ else
+ state_table[i]->consistent = 1;
+
+ for (k = 0; k < sp->nshifts; k++)
+ if (SHIFT_IS_ERROR (sp, k))
+ {
+ state_table[i]->consistent = 0;
+ break;
+ }
+
+ state_table[i]->nlookaheads = nlookaheads;
+ state_table[i]->lookaheadsp = nLA;
+ nLA += nlookaheads;
+ }
+}
+