* src/state.h, src/state.c (state_new): New, extracted from...

* src/LR0.c (new_state): here.
* src/state.h (STATE_ALLOC): Move to...
* src/state.c: here.
* src/LR0.h, src/LR0.c (nstates, final_state): Move to...
* src/state.h, src/state.c: here.
This commit is contained in:
Akim Demaille
2002-06-30 17:28:44 +00:00
parent 39f4191608
commit df0e7316a9
5 changed files with 87 additions and 28 deletions

View File

@@ -206,9 +206,13 @@ typedef struct state_s
item_number_t items[1];
} state_t;
#define STATE_ALLOC(Nitems) \
(state_t *) xcalloc ((unsigned) (sizeof (state_t) \
+ (Nitems - 1) * sizeof (item_number_t)), 1)
extern state_number_t nstates;
extern state_t *final_state;
/* Create a new state with ACCESSING_SYMBOL for those items. */
state_t *state_new PARAMS ((symbol_number_t accessing_symbol,
size_t core_size, item_number_t *core));
/* Print on OUT all the lookaheads such that this STATE wants to
reduce this RULE. */