* src/state.h, src/state.c (shifts_to): New.

* src/lalr.c (build_relations): Use it.
This commit is contained in:
Akim Demaille
2002-06-30 17:31:37 +00:00
parent 9222837b27
commit 24c7d80020
4 changed files with 26 additions and 10 deletions

View File

@@ -420,16 +420,8 @@ build_relations (void)
for (rp = rules[*rulep].rhs; *rp >= 0; rp++)
{
shifts_t *sp = state->shifts;
int j;
for (j = 0; j < sp->nshifts; j++)
{
state = states[sp->shifts[j]];
if (state->accessing_symbol
== item_number_as_symbol_number (*rp))
break;
}
state = shifts_to (state->shifts,
item_number_as_symbol_number (*rp));
states1[length++] = state->number;
}