#include "system.h"
#include "bitset.h"
+#include "bitsetv.h"
#include "reader.h"
#include "types.h"
#include "LR0.h"
state_t **states = NULL;
short *LAruleno = NULL;
-bitset *LA = NULL;
+bitsetv LA = NULL;
size_t nLA;
static int ngotos;
/* And for the famous F variable, which name is so descriptive that a
comment is hardly needed. <grin>. */
-static bitset *F = NULL;
+static bitsetv F = NULL;
static short **includes;
static shorts **lookback;
if (!nLA)
nLA = 1;
- LA = XCALLOC (bitset, nLA);
- for (i = 0; i < nLA; ++i)
- LA[i] = bitset_create (ntokens, BITSET_FIXED);
+ LA = bitsetv_create (nLA, ntokens, BITSET_FIXED);
LAruleno = XCALLOC (short, nLA);
lookback = XCALLOC (shorts *, nLA);
int i;
- F = XCALLOC (bitset, ngotos);
- for (i = 0; i < ngotos; ++i)
- F[i] = bitset_create (ntokens, BITSET_FIXED);
+ F = bitsetv_create (ngotos, ntokens, BITSET_FIXED);
for (i = 0; i < ngotos; i++)
{
state_t *state = states[from_state[i]];
states1[0] = state->number;
- for (rp = &ritem[rules[*rulep].rhs]; *rp >= 0; rp++)
+ for (rp = rules[*rulep].rhs; *rp >= 0; rp++)
{
shifts *sp = state->shifts;
int j;
LIST_FREE (shorts, lookback[i]);
XFREE (lookback);
- for (i = 0; i < (unsigned) ngotos; ++i)
- bitset_free (F[i]);
- XFREE (F);
+ bitsetv_free (F);
}