All the hacks using a final pseudo state are now useless.

* src/LR0.c (set_state_table): state_table holds exactly nstates.
* src/lalr.c (nLA): New.
(initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
instead of lookaheadsp from the pseudo state (nstate + 1).
This commit is contained in:
Akim Demaille
2001-12-27 18:05:30 +00:00
parent f9507c28ae
commit d200e455d0
3 changed files with 19 additions and 18 deletions

View File

@@ -541,10 +541,7 @@ save_reductions (void)
static void
set_state_table (void)
{
/* NSTATES + 1 because lookahead for the pseudo state number NSTATES
might be used (see conflicts.c). It is too opaque for me to
provide a probably less hacky implementation. --akim */
state_table = XCALLOC (state_t *, nstates + 1);
state_table = XCALLOC (state_t *, nstates);
{
state_t *sp;