+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (LA): New macro to access to the variable LA.
+ * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
+ * src/lalr.c: Adjust.
+
2001-11-19 Akim Demaille <akim@epita.fr>
* src/lalr.c (initialize_LA): Only initialize LA. Let...
redprec = rprec[LAruleno[lookaheadnum]];
mask = 1;
- fp1 = LA + lookaheadnum * tokensetsize;
+ fp1 = LA (lookaheadnum);
fp2 = lookaheadset;
for (i = 0; i < ntokens; i++)
{
for (i = state_table[state].lookaheads; i < k; i++)
if (rprec[LAruleno[i]])
{
- fp1 = LA + i * tokensetsize;
+ fp1 = LA (i);
fp2 = fp1;
fp3 = lookaheadset;
for conflicts not resolved above. */
for (i = state_table[state].lookaheads; i < k; i++)
{
- fp1 = LA + i * tokensetsize;
+ fp1 = LA (i);
fp2 = fp1;
fp3 = lookaheadset;
for (i = state_table[state].lookaheads; i < k; i++)
{
- fp1 = LA + i * tokensetsize;
+ fp1 = LA (i);
fp2 = lookaheadset;
while (fp2 < fp3)
return 0;
mask = 1;
- baseword = LA + m * tokensetsize;
+ baseword = LA (m);
for (i = 0; i < ntokens; i++)
{
unsigned *wordp = baseword;
{
default_rule = LAruleno[m];
- fp1 = LA + m * tokensetsize;
+ fp1 = LA (m);
fp2 = shiftset;
fp3 = lookaheadset;
fp4 = lookaheadset + tokensetsize;
if (!nodefault)
for (i = m; i < n; i++)
{
- fp1 = LA + i * tokensetsize;
+ fp1 = LA (i);
fp2 = shiftset;
fp3 = lookaheadset;
}
mask = 1;
- fp1 = LA + m * tokensetsize;
+ fp1 = LA (m);
fp2 = shiftset;
for (i = 0; i < ntokens; i++)
{
XFREE (VERTICES);
}
+
+/*--------------------.
+| Build STATE_TABLE. |
+`--------------------*/
+
static void
set_state_table (void)
{
unsigned *fp2;
unsigned *fp3;
shorts *sp;
- unsigned *rowp;
shorts *sptmp; /* JF */
- rowp = LA;
for (i = 0; i < state_table[nstates].lookaheads; i++)
{
- fp3 = rowp + tokensetsize;
+ fp3 = LA (i + 1);
for (sp = lookback[i]; sp; sp = sp->next)
{
- fp1 = rowp;
+ fp1 = LA (i);
fp2 = F + tokensetsize * sp->value;
while (fp1 < fp3)
*fp1++ |= *fp2++;
}
-
- rowp = fp3;
}
for (i = 0; i < state_table[nstates].lookaheads; i++)
for (i = n - 1; i >= m; i--)
{
rule = -LAruleno[i];
- wordp = LA + i * tokensetsize;
+ wordp = LA (i);
mask = 1;
/* and find each token which the rule finds acceptable