44 |
Each core contains a vector of NITEMS items which are the indices |
Each core contains a vector of NITEMS items which are the indices |
45 |
in the RITEMS vector of the items that are selected in this state. |
in the RITEMS vector of the items that are selected in this state. |
46 |
|
|
|
The link field is used for chaining symbols that hash states by |
|
|
their itemsets. This is for recognizing equivalent states and |
|
|
combining them when the states are generated. |
|
|
|
|
47 |
The two types of transitions are shifts (push the lookahead token |
The two types of transitions are shifts (push the lookahead token |
48 |
and read another) and reductions (combine the last n things on the |
and read another) and reductions (combine the last n things on the |
49 |
stack via a rule, replace them with the symbol that the rule |
stack via a rule, replace them with the symbol that the rule |
176 |
typedef struct state_s |
typedef struct state_s |
177 |
{ |
{ |
178 |
struct state_s *next; |
struct state_s *next; |
|
struct state_s *link; |
|
179 |
|
|
180 |
state_number_t number; |
state_number_t number; |
181 |
symbol_number_t accessing_symbol; |
symbol_number_t accessing_symbol; |
215 |
void state_rule_lookaheads_print PARAMS ((state_t *state, rule_t *rule, |
void state_rule_lookaheads_print PARAMS ((state_t *state, rule_t *rule, |
216 |
FILE *out)); |
FILE *out)); |
217 |
|
|
218 |
|
/* Create/destroy the states hash table. */ |
219 |
|
void state_hash_new PARAMS ((void)); |
220 |
|
void state_hash_free PARAMS ((void)); |
221 |
|
|
222 |
|
/* Find the state associated to the CORE, and return it. If it does |
223 |
|
not exist yet, return NULL. */ |
224 |
|
state_t *state_hash_lookup PARAMS ((size_t core_size, item_number_t *core)); |
225 |
|
|
226 |
|
/* Insert STATE in the state hash table. */ |
227 |
|
void state_hash_insert PARAMS ((state_t *state)); |
228 |
|
|
229 |
|
/* All the states, indexed by the state number. */ |
230 |
|
extern state_t **states; |
231 |
|
|
232 |
|
/* Free all the states. */ |
233 |
|
void states_free PARAMS ((void)); |
234 |
#endif /* !STATE_H_ */ |
#endif /* !STATE_H_ */ |