- state_t *p;
-
- if (trace_flag)
- fprintf (stderr, "Entering new_state, state = %d, symbol = %d (%s)\n",
- this_state->number, 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]);
-
- last_state->next = p;
- last_state = p;
- nstates++;
-
- /* If this is the eoftoken, then this is the final state. */
- if (symbol == 0)
- final_state = p->number;
-
- return p;
-}
-
-
-/*--------------------------------------------------------------.
-| Find the state number for the state we would get to (from the |
-| current state) by shifting symbol. Create a new state if no |
-| equivalent one exists already. Used by append_states. |
-`--------------------------------------------------------------*/
-
-static int
-get_state (int symbol)
-{
- int key;
- int i;