X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/190c4f5f0a0dac47157adea6250cb88bf0ac39ff..e9f87b5b7df2e328d2e4196d276c0d96594c906b:/src/state.h?ds=inline diff --git a/src/state.h b/src/state.h index f7244b4b..c2d66f3f 100644 --- a/src/state.h +++ b/src/state.h @@ -95,17 +95,11 @@ typedef struct shifts { - 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 @@ -113,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.) */ @@ -150,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)); /*-------------. @@ -165,10 +158,7 @@ typedef struct reductions short rules[1]; } reductions; -#define REDUCTIONS_ALLOC(Nreductions) \ - (reductions *) xcalloc ((unsigned) (sizeof (reductions) \ - + (Nreductions - 1) * sizeof (short)), 1) - +reductions *reductions_new PARAMS ((int n)); /*----------. @@ -190,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;