42 |
short *LAruleno; |
short *LAruleno; |
43 |
unsigned *LA; |
unsigned *LA; |
44 |
|
|
|
char *consistent; |
|
45 |
short *goto_map; |
short *goto_map; |
46 |
short *from_state; |
short *from_state; |
47 |
short *to_state; |
short *to_state; |
207 |
shifts *sp; |
shifts *sp; |
208 |
short *np; |
short *np; |
209 |
|
|
|
consistent = XCALLOC (char, nstates); |
|
210 |
lookaheads = XCALLOC (short, nstates + 1); |
lookaheads = XCALLOC (short, nstates + 1); |
211 |
|
|
212 |
count = 0; |
count = 0; |
223 |
|| (sp && !ISVAR (state_table[sp->shifts[0]].accessing_symbol)))) |
|| (sp && !ISVAR (state_table[sp->shifts[0]].accessing_symbol)))) |
224 |
count += rp->nreds; |
count += rp->nreds; |
225 |
else |
else |
226 |
consistent[i] = 1; |
state_table[i].consistent = 1; |
227 |
|
|
228 |
if (sp) |
if (sp) |
229 |
for (k = 0; k < sp->nshifts; k++) |
for (k = 0; k < sp->nshifts; k++) |
230 |
if (state_table[sp->shifts[k]].accessing_symbol |
if (state_table[sp->shifts[k]].accessing_symbol |
231 |
== error_token_number) |
== error_token_number) |
232 |
{ |
{ |
233 |
consistent[i] = 0; |
state_table[i].consistent = 0; |
234 |
break; |
break; |
235 |
} |
} |
236 |
} |
} |
253 |
np = LAruleno; |
np = LAruleno; |
254 |
for (i = 0; i < nstates; i++) |
for (i = 0; i < nstates; i++) |
255 |
{ |
{ |
256 |
if (!consistent[i]) |
if (!state_table[i].consistent) |
257 |
{ |
{ |
258 |
if ((rp = state_table[i].reduction_table)) |
if ((rp = state_table[i].reduction_table)) |
259 |
for (j = 0; j < rp->nreds; j++) |
for (j = 0; j < rp->nreds; j++) |
578 |
states[length++] = stateno; |
states[length++] = stateno; |
579 |
} |
} |
580 |
|
|
581 |
if (!consistent[stateno]) |
if (!state_table[stateno].consistent) |
582 |
add_lookback_edge (stateno, *rulep, i); |
add_lookback_edge (stateno, *rulep, i); |
583 |
|
|
584 |
length--; |
length--; |