* 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

@@ -93,16 +93,16 @@ print_core (struct obstack *oout, state_t *state)
/* Look for lookaheads corresponding to this rule. */
for (j = 0; j < state->nlookaheads; ++j)
for (k = 0; k < ntokens; ++k)
if (bitset_test (LA[state->lookaheadsp + j], k)
&& LArule[state->lookaheadsp + j]->number == rule)
if (bitset_test (state->lookaheads[j], k)
&& state->lookaheads_rule[j]->number == rule)
nlookaheads++;
if (nlookaheads)
{
obstack_sgrow (oout, " [");
for (j = 0; j < state->nlookaheads; ++j)
for (k = 0; k < ntokens; ++k)
if (bitset_test (LA[state->lookaheadsp + j], k)
&& LArule[state->lookaheadsp + j]->number == rule)
if (bitset_test (state->lookaheads[j], k)
&& state->lookaheads_rule[j]->number == rule)
obstack_fgrow2 (oout, "%s%s",
symbol_tag_get (symbols[k]),
--nlookaheads ? ", " : "");