94 |
ngotos = 0; |
ngotos = 0; |
95 |
for (state = 0; state < nstates; ++state) |
for (state = 0; state < nstates; ++state) |
96 |
{ |
{ |
97 |
transitions_t *sp = states[state]->shifts; |
transitions_t *sp = states[state]->transitions; |
98 |
int i; |
int i; |
99 |
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i) |
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i) |
100 |
{ |
{ |
127 |
|
|
128 |
for (state = 0; state < nstates; ++state) |
for (state = 0; state < nstates; ++state) |
129 |
{ |
{ |
130 |
transitions_t *sp = states[state]->shifts; |
transitions_t *sp = states[state]->transitions; |
131 |
int i; |
int i; |
132 |
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i) |
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i) |
133 |
{ |
{ |
189 |
for (i = 0; i < ngotos; i++) |
for (i = 0; i < ngotos; i++) |
190 |
{ |
{ |
191 |
state_number_t stateno = to_state[i]; |
state_number_t stateno = to_state[i]; |
192 |
transitions_t *sp = states[stateno]->shifts; |
transitions_t *sp = states[stateno]->transitions; |
193 |
|
|
194 |
int j; |
int j; |
195 |
for (j = 0; j < sp->num && TRANSITION_IS_SHIFT (sp, j); j++) |
for (j = 0; j < sp->num && TRANSITION_IS_SHIFT (sp, j); j++) |
266 |
|
|
267 |
for (rp = rules[*rulep].rhs; *rp >= 0; rp++) |
for (rp = rules[*rulep].rhs; *rp >= 0; rp++) |
268 |
{ |
{ |
269 |
state = transitions_to (state->shifts, |
state = transitions_to (state->transitions, |
270 |
item_number_as_symbol_number (*rp)); |
item_number_as_symbol_number (*rp)); |
271 |
states1[length++] = state->number; |
states1[length++] = state->number; |
272 |
} |
} |
273 |
|
|
360 |
int k; |
int k; |
361 |
int nlookaheads = 0; |
int nlookaheads = 0; |
362 |
reductions_t *rp = states[i]->reductions; |
reductions_t *rp = states[i]->reductions; |
363 |
transitions_t *sp = states[i]->shifts; |
transitions_t *sp = states[i]->transitions; |
364 |
|
|
365 |
/* We need a lookahead either to distinguish different |
/* We need a lookahead either to distinguish different |
366 |
reductions (i.e., there are two or more), or to distinguish a |
reductions (i.e., there are two or more), or to distinguish a |