[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14-fyi-more-shift-symbol.patch
From: |
Akim Demaille |
Subject: |
14-fyi-more-shift-symbol.patch |
Date: |
Thu, 27 Dec 2001 19:01:54 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
Index: src/lalr.c
--- src/lalr.c Wed, 26 Dec 2001 21:15:47 +0100 akim
+++ src/lalr.c Thu, 27 Dec 2001 10:27:39 +0100 akim
@@ -171,13 +171,11 @@
shifts *sp = state_table[state]->shifts;
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)
fatal (_("too many gotos (max %d)"), MAXSHORT);
ngotos++;
- goto_map[symbol]++;
+ goto_map[SHIFT_SYMBOL (sp, i)]++;
}
}
@@ -204,12 +202,9 @@
shifts *sp = state_table[state]->shifts;
for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
{
- int state2 = sp->shifts[i];
- int symbol = state_table[state2]->accessing_symbol;
-
- int k = temp_map[symbol]++;
+ int k = temp_map[SHIFT_SYMBOL (sp, i)]++;
from_state[k] = state;
- to_state[k] = state2;
+ to_state[k] = sp->shifts[i];
}
}
@@ -269,14 +264,11 @@
int j;
for (j = 0; j < sp->nshifts && SHIFT_IS_SHIFT (sp, j); j++)
- {
- int symbol = state_table[sp->shifts[j]]->accessing_symbol;
- SETBIT (F (i), symbol);
- }
+ SETBIT (F (i), SHIFT_SYMBOL (sp, j));
for (; j < sp->nshifts; j++)
{
- int symbol = state_table[sp->shifts[j]]->accessing_symbol;
+ int symbol = SHIFT_SYMBOL (sp, j);
if (nullable[symbol])
edge[nedges++] = map_goto (stateno, symbol);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 14-fyi-more-shift-symbol.patch,
Akim Demaille <=