X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f693ad146e6e4951662d60903b8512d518cb09da..e9f87b5b7df2e328d2e4196d276c0d96594c906b:/src/state.h?ds=sidebyside diff --git a/src/state.h b/src/state.h index b407e886..c2d66f3f 100644 --- a/src/state.h +++ b/src/state.h @@ -95,18 +95,11 @@ typedef struct shifts { - struct shifts *next; - short number; short nshifts; short shifts[1]; } shifts; - -#define SHIFTS_ALLOC(Nshifts) \ - (shifts *) xcalloc ((unsigned) (sizeof (shifts) \ - + (Nshifts - 1) * sizeof (short)), 1) - -shifts * shifts_new PARAMS ((int n)); +shifts *shifts_new PARAMS ((int n)); /* What is the symbol which is shifted by SHIFTS->shifts[Shift]? Can @@ -114,7 +107,7 @@ shifts * shifts_new PARAMS ((int n)); case of gotos. */ #define SHIFT_SYMBOL(Shifts, Shift) \ - (state_table[Shifts->shifts[Shift]]->accessing_symbol) + (states[Shifts->shifts[Shift]]->accessing_symbol) /* Is the SHIFTS->shifts[Shift] a real shift? (as opposed to gotos.) */ @@ -151,9 +144,8 @@ typedef struct errs short errs[1]; } errs; -#define ERRS_ALLOC(Nerrs) \ - (errs *) xcalloc ((unsigned) (sizeof (errs) \ - + (Nerrs - 1) * sizeof (short)), 1) +errs *errs_new PARAMS ((int n)); +errs *errs_dup PARAMS ((errs *src)); /*-------------. @@ -162,16 +154,11 @@ typedef struct errs typedef struct reductions { - struct reductions *next; - short number; short nreds; short rules[1]; } reductions; -#define REDUCTIONS_ALLOC(Nreductions) \ - (reductions *) xcalloc ((unsigned) (sizeof (reductions) \ - + (Nreductions - 1) * sizeof (short)), 1) - +reductions *reductions_new PARAMS ((int n)); /*----------. @@ -193,7 +180,9 @@ typedef struct state_s char consistent; /* Used in LALR, not LR(0). */ - short lookaheads; + /* Pseudo pointer into LA. */ + short lookaheadsp; + int nlookaheads; /* Its items. */ short nitems;