- consistent = NEW2(nstates, char);
- lookaheads = NEW2(nstates + 1, short);
-
- count = 0;
- for (i = 0; i < nstates; i++)
- {
- register int k;
-
- lookaheads[i] = count;
-
- rp = reduction_table[i];
- sp = shift_table[i];
- if (rp && (rp->nreds > 1
- || (sp && ! ISVAR(accessing_symbol[sp->shifts[0]]))))
- count += rp->nreds;
- else
- consistent[i] = 1;
-
- if (sp)
- for (k = 0; k < sp->nshifts; k++)
- {
- if (accessing_symbol[sp->shifts[k]] == error_token_number)
- {
- consistent[i] = 0;
- break;
- }
- }
- }
-
- lookaheads[nstates] = count;
-
- if (count == 0)
- {
- LA = NEW2(1 * tokensetsize, unsigned);
- LAruleno = NEW2(1, short);
- lookback = NEW2(1, shorts *);
- }
- else
- {
- LA = NEW2(count * tokensetsize, unsigned);
- LAruleno = NEW2(count, short);
- lookback = NEW2(count, shorts *);
- }
-
- np = LAruleno;
- for (i = 0; i < nstates; i++)
- {
- if (!consistent[i])
- {
- if (rp = reduction_table[i])
- for (j = 0; j < rp->nreds; j++)
- *np++ = rp->rules[j];
- }
- }
-}
-
-
-void
-set_goto_map()
-{
- register shifts *sp;
- register int i;
- register int symbol;
- register int k;
- register short *temp_map;
- register int state2;
- register int state1;
-
- goto_map = NEW2(nvars + 1, short) - ntokens;
- temp_map = NEW2(nvars + 1, short) - ntokens;