247 |
|
|
248 |
ngotos = 0; |
ngotos = 0; |
249 |
for (sp = first_shift; sp; sp = sp->next) |
for (sp = first_shift; sp; sp = sp->next) |
250 |
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i) |
if (sp->nshifts) |
251 |
{ |
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i) |
252 |
symbol = state_table[sp->shifts[i]].accessing_symbol; |
{ |
253 |
|
symbol = state_table[sp->shifts[i]].accessing_symbol; |
254 |
if (ngotos == MAXSHORT) |
|
255 |
fatal (_("too many gotos (max %d)"), MAXSHORT); |
if (ngotos == MAXSHORT) |
256 |
|
fatal (_("too many gotos (max %d)"), MAXSHORT); |
257 |
ngotos++; |
|
258 |
goto_map[symbol]++; |
ngotos++; |
259 |
} |
goto_map[symbol]++; |
260 |
|
} |
261 |
|
|
262 |
k = 0; |
k = 0; |
263 |
for (i = ntokens; i < nsyms; i++) |
for (i = ntokens; i < nsyms; i++) |
278 |
for (sp = first_shift; sp; sp = sp->next) |
for (sp = first_shift; sp; sp = sp->next) |
279 |
{ |
{ |
280 |
state1 = sp->number; |
state1 = sp->number; |
281 |
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i) |
if (sp->nshifts) |
282 |
{ |
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i) |
283 |
state2 = sp->shifts[i]; |
{ |
284 |
symbol = state_table[state2].accessing_symbol; |
state2 = sp->shifts[i]; |
285 |
|
symbol = state_table[state2].accessing_symbol; |
286 |
k = temp_map[symbol]++; |
|
287 |
from_state[k] = state1; |
k = temp_map[symbol]++; |
288 |
to_state[k] = state2; |
from_state[k] = state1; |
289 |
} |
to_state[k] = state2; |
290 |
|
} |
291 |
} |
} |
292 |
|
|
293 |
XFREE (temp_map + ntokens); |
XFREE (temp_map + ntokens); |