82 |
#ifndef STATE_H_ |
#ifndef STATE_H_ |
83 |
# define STATE_H_ |
# define STATE_H_ |
84 |
|
|
85 |
# include "bitsetv.h" |
# include "bitset.h" |
86 |
|
|
87 |
|
|
88 |
/*-------------------. |
/*-------------------. |
178 |
typedef struct reductions_s |
typedef struct reductions_s |
179 |
{ |
{ |
180 |
short num; |
short num; |
181 |
|
bitset *lookaheads; |
182 |
rule_t *rules[1]; |
rule_t *rules[1]; |
183 |
} reductions_t; |
} reductions_t; |
184 |
|
|
199 |
/* Nonzero if no lookahead is needed to decide what to do in state S. */ |
/* Nonzero if no lookahead is needed to decide what to do in state S. */ |
200 |
char consistent; |
char consistent; |
201 |
|
|
|
/* Used in LALR, not LR(0). |
|
|
|
|
|
When a state is not consistent (there is an S/R or R/R conflict), |
|
|
lookaheads are needed to enable the reductions. NLOOKAHEADS is |
|
|
the number of lookahead guarded reductions of the |
|
|
LOOKAHEADS_RULE. For each rule LOOKAHEADS_RULE[R], LOOKAHEADS[R] |
|
|
is the bitset of the lookaheads enabling this reduction. */ |
|
|
int nlookaheads; |
|
|
bitsetv lookaheads; |
|
|
rule_t **lookaheads_rule; |
|
|
|
|
202 |
/* If some conflicts were solved thanks to precedence/associativity, |
/* If some conflicts were solved thanks to precedence/associativity, |
203 |
a human readable description of the resolution. */ |
a human readable description of the resolution. */ |
204 |
const char *solved_conflicts; |
const char *solved_conflicts; |
224 |
void state_reductions_set PARAMS ((state_t *state, |
void state_reductions_set PARAMS ((state_t *state, |
225 |
int num, rule_t **reductions)); |
int num, rule_t **reductions)); |
226 |
|
|
227 |
|
int state_reduction_find PARAMS ((state_t *state, rule_t *rule)); |
228 |
|
|
229 |
/* Set the errs of STATE. */ |
/* Set the errs of STATE. */ |
230 |
void state_errs_set PARAMS ((state_t *state, |
void state_errs_set PARAMS ((state_t *state, |
231 |
int num, symbol_t **errs)); |
int num, symbol_t **errs)); |