* src/state.h (state_t): Replace the `lookaheadsp' member, a

short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
Adjust all dependencies.
* src/lalr.c (initialize_lookaheads): Split into...
(states_lookaheads_count, states_lookaheads_initialize): these.
(lalr): Adjust.
This commit is contained in:
Akim Demaille
2002-06-15 18:23:50 +00:00
parent 9757c359ef
commit c026349221
7 changed files with 83 additions and 46 deletions

View File

@@ -380,8 +380,8 @@ action_row (state_t *state)
for (j = 0; j < ntokens; j++)
/* and record this rule as the rule to use if that
token follows. */
if (bitset_test (LA[state->lookaheadsp + i], j))
actrow[j] = -LArule[state->lookaheadsp + i]->number;
if (bitset_test (state->lookaheads[i], j))
actrow[j] = -state->lookaheads_rule[i]->number;
}
/* Now see which tokens are allowed for shifts in this state. For
@@ -428,7 +428,7 @@ action_row (state_t *state)
for (i = 0; i < state->nlookaheads; i++)
{
int count = 0;
int rule = -LArule[state->lookaheadsp + i]->number;
int rule = -state->lookaheads_rule[i]->number;
int j;
for (j = 0; j < ntokens; j++)