25 |
|
|
26 |
#include "system.h" |
#include "system.h" |
27 |
#include "bitset.h" |
#include "bitset.h" |
28 |
|
#include "bitsetv.h" |
29 |
#include "reader.h" |
#include "reader.h" |
30 |
#include "types.h" |
#include "types.h" |
31 |
#include "LR0.h" |
#include "LR0.h" |
41 |
state_t **states = NULL; |
state_t **states = NULL; |
42 |
|
|
43 |
short *LAruleno = NULL; |
short *LAruleno = NULL; |
44 |
bitset *LA = NULL; |
bitsetv LA = NULL; |
45 |
size_t nLA; |
size_t nLA; |
46 |
|
|
47 |
static int ngotos; |
static int ngotos; |
51 |
|
|
52 |
/* And for the famous F variable, which name is so descriptive that a |
/* And for the famous F variable, which name is so descriptive that a |
53 |
comment is hardly needed. <grin>. */ |
comment is hardly needed. <grin>. */ |
54 |
static bitset *F = NULL; |
static bitsetv F = NULL; |
55 |
|
|
56 |
static short **includes; |
static short **includes; |
57 |
static shorts **lookback; |
static shorts **lookback; |
140 |
if (!nLA) |
if (!nLA) |
141 |
nLA = 1; |
nLA = 1; |
142 |
|
|
143 |
LA = XCALLOC (bitset, nLA); |
LA = bitsetv_create (nLA, ntokens, BITSET_FIXED); |
|
for (i = 0; i < nLA; ++i) |
|
|
LA[i] = bitset_create (ntokens, BITSET_FIXED); |
|
144 |
LAruleno = XCALLOC (short, nLA); |
LAruleno = XCALLOC (short, nLA); |
145 |
lookback = XCALLOC (shorts *, nLA); |
lookback = XCALLOC (shorts *, nLA); |
146 |
|
|
252 |
|
|
253 |
int i; |
int i; |
254 |
|
|
255 |
F = XCALLOC (bitset, ngotos); |
F = bitsetv_create (ngotos, ntokens, BITSET_FIXED); |
|
for (i = 0; i < ngotos; ++i) |
|
|
F[i] = bitset_create (ntokens, BITSET_FIXED); |
|
256 |
|
|
257 |
for (i = 0; i < ngotos; i++) |
for (i = 0; i < ngotos; i++) |
258 |
{ |
{ |
497 |
LIST_FREE (shorts, lookback[i]); |
LIST_FREE (shorts, lookback[i]); |
498 |
|
|
499 |
XFREE (lookback); |
XFREE (lookback); |
500 |
for (i = 0; i < (unsigned) ngotos; ++i) |
bitsetv_free (F); |
|
bitset_free (F[i]); |
|
|
XFREE (F); |
|
501 |
} |
} |
502 |
|
|
503 |
|
|