52 |
} goto_list_t; |
} goto_list_t; |
53 |
|
|
54 |
|
|
55 |
rule_t **LArule = NULL; |
/* LARULE is a vector which records the rules that need lookahead in |
56 |
bitsetv LA = NULL; |
various states. The elements of LARULE that apply to state S are |
57 |
|
those from LOOKAHEADS[S] through LOOKAHEADS[S+1]-1. |
58 |
|
|
59 |
|
If LR is the length of LArule, then a number from 0 to LR-1 can |
60 |
|
specify both a rule and a state where the rule might be applied. |
61 |
|
*/ |
62 |
|
|
63 |
|
static rule_t **LArule = NULL; |
64 |
|
|
65 |
|
/* LA is a LR by NTOKENS matrix of bits. LA[l, i] is 1 if the rule |
66 |
|
LArule[l] is applicable in the appropriate state when the next |
67 |
|
token is symbol i. If LA[l, i] and LA[l, j] are both 1 for i != j, |
68 |
|
it is a conflict. */ |
69 |
|
|
70 |
|
static bitsetv LA = NULL; |
71 |
size_t nLA; |
size_t nLA; |
72 |
|
|
73 |
|
|
474 |
if (trace_flag & trace_sets) |
if (trace_flag & trace_sets) |
475 |
lookaheads_print (stderr); |
lookaheads_print (stderr); |
476 |
} |
} |
477 |
|
|
478 |
|
|
479 |
|
void |
480 |
|
lalr_free (void) |
481 |
|
{ |
482 |
|
state_number_t s; |
483 |
|
for (s = 0; s < nstates; ++s) |
484 |
|
{ |
485 |
|
states[s]->lookaheads = NULL; |
486 |
|
states[s]->lookaheads_rule = NULL; |
487 |
|
} |
488 |
|
bitsetv_free (LA); |
489 |
|
free (LArule); |
490 |
|
} |