mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
* src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2001-12-27 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
|
||||||
|
|
||||||
2001-12-27 Akim Demaille <akim@epita.fr>
|
2001-12-27 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/conflicts.c, src/conflicts.h (print_reductions): Move to...
|
* src/conflicts.c, src/conflicts.h (print_reductions): Move to...
|
||||||
|
|||||||
18
src/lalr.c
18
src/lalr.c
@@ -171,13 +171,11 @@ set_goto_map (void)
|
|||||||
shifts *sp = state_table[state]->shifts;
|
shifts *sp = state_table[state]->shifts;
|
||||||
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
|
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
|
||||||
{
|
{
|
||||||
int symbol = state_table[sp->shifts[i]]->accessing_symbol;
|
|
||||||
|
|
||||||
if (ngotos == MAXSHORT)
|
if (ngotos == MAXSHORT)
|
||||||
fatal (_("too many gotos (max %d)"), MAXSHORT);
|
fatal (_("too many gotos (max %d)"), MAXSHORT);
|
||||||
|
|
||||||
ngotos++;
|
ngotos++;
|
||||||
goto_map[symbol]++;
|
goto_map[SHIFT_SYMBOL (sp, i)]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,12 +202,9 @@ set_goto_map (void)
|
|||||||
shifts *sp = state_table[state]->shifts;
|
shifts *sp = state_table[state]->shifts;
|
||||||
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
|
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
|
||||||
{
|
{
|
||||||
int state2 = sp->shifts[i];
|
int k = temp_map[SHIFT_SYMBOL (sp, i)]++;
|
||||||
int symbol = state_table[state2]->accessing_symbol;
|
|
||||||
|
|
||||||
int k = temp_map[symbol]++;
|
|
||||||
from_state[k] = state;
|
from_state[k] = state;
|
||||||
to_state[k] = state2;
|
to_state[k] = sp->shifts[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,14 +264,11 @@ initialize_F (void)
|
|||||||
|
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < sp->nshifts && SHIFT_IS_SHIFT (sp, j); j++)
|
for (j = 0; j < sp->nshifts && SHIFT_IS_SHIFT (sp, j); j++)
|
||||||
{
|
SETBIT (F (i), SHIFT_SYMBOL (sp, j));
|
||||||
int symbol = state_table[sp->shifts[j]]->accessing_symbol;
|
|
||||||
SETBIT (F (i), symbol);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; j < sp->nshifts; j++)
|
for (; j < sp->nshifts; j++)
|
||||||
{
|
{
|
||||||
int symbol = state_table[sp->shifts[j]]->accessing_symbol;
|
int symbol = SHIFT_SYMBOL (sp, j);
|
||||||
if (nullable[symbol])
|
if (nullable[symbol])
|
||||||
edge[nedges++] = map_goto (stateno, symbol);
|
edge[nedges++] = map_goto (stateno, symbol);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user