shiftset = XCALLOC (short, nsyms);
redset = XCALLOC (short, nrules + 1);
state_hash = XCALLOC (state_t *, STATE_HASH_SIZE);
+ shift_symbol = XCALLOC (short, nsyms);
}
for (i = 0; i < nsyms; i++)
kernel_size[i] = 0;
- shift_symbol = XCALLOC (short, nsyms);
nshifts = 0;
for (i = 0; i < nitemset; ++i)
if (trace_flag)
fprintf (stderr, "Entering new_state, state = %d, symbol = %d (%s)\n",
- this_state->number, symbol, tags[symbol]);
+ this_state->number, symbol, symbols[symbol]->tag);
if (nstates >= MAXSHORT)
fatal (_("too many states (max %d)"), MAXSHORT);
if (trace_flag)
fprintf (stderr, "Entering get_state, state = %d, symbol = %d (%s)\n",
- this_state->number, symbol, tags[symbol]);
+ this_state->number, symbol, symbols[symbol]->tag);
/* Add up the target state's active item numbers to get a hash key.
*/
\f
/*--------------------.
-| Build STATE_TABLE. |
+| Build STATES. |
`--------------------*/
static void
-set_state_table (void)
+set_states (void)
{
state_t *sp;
- state_table = XCALLOC (state_t *, nstates);
+ states = XCALLOC (state_t *, nstates);
for (sp = first_state; sp; sp = sp->next)
{
if (!sp->reductions)
sp->reductions = reductions_new (0);
- state_table[sp->number] = sp;
+ states[sp->number] = sp;
}
}
{
if (trace_flag)
fprintf (stderr, "Processing state %d (reached by %s)\n",
- this_state->number, tags[this_state->accessing_symbol]);
+ this_state->number,
+ symbols[this_state->accessing_symbol]->tag);
/* Set up ruleset and itemset for the transitions out of this
state. ruleset gets a 1 bit for each rule that could reduce
now. itemset gets a vector of all the items that could be
free_closure ();
free_storage ();
- /* Set up STATE_TABLE. */
- set_state_table ();
+ /* Set up STATES. */
+ set_states ();
}