316 |
save_shifts (void) |
save_shifts (void) |
317 |
{ |
{ |
318 |
shifts *p = shifts_new (nshifts); |
shifts *p = shifts_new (nshifts); |
|
|
|
|
p->number = this_state->number; |
|
319 |
shortcpy (p->shifts, shiftset, nshifts); |
shortcpy (p->shifts, shiftset, nshifts); |
320 |
this_state->shifts = p; |
this_state->shifts = p; |
321 |
} |
} |
337 |
shifts *sp; |
shifts *sp; |
338 |
|
|
339 |
statep = STATE_ALLOC (0); |
statep = STATE_ALLOC (0); |
340 |
statep->number = nstates; |
statep->number = nstates++; |
341 |
|
|
342 |
/* The distinctive feature of this state from the |
/* The distinctive feature of this state from the |
343 |
eof_shifting_state, is that it is labeled as post-start-symbol |
eof_shifting_state, is that it is labeled as post-start-symbol |
352 |
/* Make a shift from this state to (what will be) the final state. */ |
/* Make a shift from this state to (what will be) the final state. */ |
353 |
sp = shifts_new (1); |
sp = shifts_new (1); |
354 |
statep->shifts = sp; |
statep->shifts = sp; |
|
sp->number = nstates++; |
|
355 |
sp->shifts[0] = nstates; |
sp->shifts[0] = nstates; |
356 |
} |
} |
357 |
|
|
372 |
next-to-final state. |
next-to-final state. |
373 |
The symbol for that shift is 0 (end-of-file). */ |
The symbol for that shift is 0 (end-of-file). */ |
374 |
statep = STATE_ALLOC (0); |
statep = STATE_ALLOC (0); |
375 |
statep->number = nstates; |
statep->number = nstates++; |
376 |
|
|
377 |
last_state->next = statep; |
last_state->next = statep; |
378 |
last_state = statep; |
last_state = statep; |
380 |
/* Make the shift from the final state to the termination state. */ |
/* Make the shift from the final state to the termination state. */ |
381 |
sp = shifts_new (1); |
sp = shifts_new (1); |
382 |
statep->shifts = sp; |
statep->shifts = sp; |
|
sp->number = nstates++; |
|
383 |
sp->shifts[0] = nstates; |
sp->shifts[0] = nstates; |
384 |
} |
} |
385 |
|
|
455 |
shifts *sp = statep->shifts; |
shifts *sp = statep->shifts; |
456 |
|
|
457 |
shifts *sp1 = shifts_new (sp->nshifts + 1); |
shifts *sp1 = shifts_new (sp->nshifts + 1); |
|
sp1->number = statep->number; |
|
458 |
statep->shifts = sp1; |
statep->shifts = sp1; |
459 |
sp1->shifts[0] = nstates; |
sp1->shifts[0] = nstates; |
460 |
for (i = sp->nshifts; i > 0; i--) |
for (i = sp->nshifts; i > 0; i--) |