-/*-----------------------------------------------------------------.
-| Subroutine of get_state. Create a new state for those items, if |
-| necessary. |
-`-----------------------------------------------------------------*/
-
-static state_t *
-new_state (int symbol)
-{
- state_t *p;
-
- if (trace_flag)
- fprintf (stderr, "Entering new_state, state = %d, symbol = %d (%s)\n",
- nstates, symbol, symbols[symbol]->tag);
-
- if (nstates >= MAXSHORT)
- fatal (_("too many states (max %d)"), MAXSHORT);
-
- p = STATE_ALLOC (kernel_size[symbol]);
- p->accessing_symbol = symbol;
- p->number = nstates;
- p->nitems = kernel_size[symbol];
-
- shortcpy (p->items, kernel_base[symbol], kernel_size[symbol]);
-
- /* If this is the eoftoken, and this is not the initial state, then
- this is the final state. */
- if (symbol == 0 && first_state)
- final_state = p->number;
-
- if (!first_state)
- first_state = p;
- if (last_state)
- last_state->next = p;
- last_state = p;
-
- nstates++;
-
- return p;
-}
-
-