137 |
int i; |
int i; |
138 |
int j; |
int j; |
139 |
short *np; |
short *np; |
|
reductions *rp; |
|
140 |
|
|
141 |
/* Avoid having to special case 0. */ |
/* Avoid having to special case 0. */ |
142 |
if (!nLA) |
if (!nLA) |
149 |
np = LAruleno; |
np = LAruleno; |
150 |
for (i = 0; i < nstates; i++) |
for (i = 0; i < nstates; i++) |
151 |
if (!state_table[i]->consistent) |
if (!state_table[i]->consistent) |
152 |
if ((rp = state_table[i]->reductions)) |
for (j = 0; j < state_table[i]->reductions->nreds; j++) |
153 |
for (j = 0; j < rp->nreds; j++) |
*np++ = state_table[i]->reductions->rules[j]; |
|
*np++ = rp->rules[j]; |
|
154 |
} |
} |
155 |
|
|
156 |
|
|
523 |
reductions *rp = state_table[i]->reductions; |
reductions *rp = state_table[i]->reductions; |
524 |
shifts *sp = state_table[i]->shifts; |
shifts *sp = state_table[i]->shifts; |
525 |
|
|
526 |
if (rp |
/* We need a lookahead either to distinguish different |
527 |
&& (rp->nreds > 1 || (sp->nshifts && SHIFT_IS_SHIFT (sp, 0)))) |
reductions (i.e., there are two or more), or to distinguish a |
528 |
|
reduction from a shift. Otherwise, it is straightforward, |
529 |
|
and the state is `consistent'. */ |
530 |
|
if (rp->nreds > 1 |
531 |
|
|| (rp->nreds == 1 && sp->nshifts && SHIFT_IS_SHIFT (sp, 0))) |
532 |
nlookaheads += rp->nreds; |
nlookaheads += rp->nreds; |
533 |
else |
else |
534 |
state_table[i]->consistent = 1; |
state_table[i]->consistent = 1; |