541 |
static void |
static void |
542 |
set_state_table (void) |
set_state_table (void) |
543 |
{ |
{ |
544 |
|
state_t *sp; |
545 |
state_table = XCALLOC (state_t *, nstates); |
state_table = XCALLOC (state_t *, nstates); |
546 |
|
|
547 |
{ |
for (sp = first_state; sp; sp = sp->next) |
548 |
state_t *sp; |
{ |
549 |
for (sp = first_state; sp; sp = sp->next) |
/* Pessimization, but simplification of the code: make sure all |
550 |
state_table[sp->number] = sp; |
the states have a shifts and errs, even if reduced to 0. */ |
551 |
} |
if (!sp->shifts) |
552 |
|
sp->shifts = shifts_new (0); |
553 |
|
if (!sp->errs) |
554 |
|
sp->errs = errs_new (0); |
555 |
|
|
556 |
/* Pessimization, but simplification of the code: make sure all the |
state_table[sp->number] = sp; |
557 |
states have a shifts, even if reduced to 0 shifts. */ |
} |
|
{ |
|
|
int i; |
|
|
for (i = 0; i < nstates; i++) |
|
|
if (!state_table[i]->shifts) |
|
|
state_table[i]->shifts = shifts_new (0); |
|
|
} |
|
558 |
} |
} |
559 |
|
|
560 |
/*-------------------------------------------------------------------. |
/*-------------------------------------------------------------------. |