198 |
int nlookaheads = 0; |
int nlookaheads = 0; |
199 |
/* Count the number of lookaheads corresponding to this rule. */ |
/* Count the number of lookaheads corresponding to this rule. */ |
200 |
for (j = 0; j < state->nlookaheads; ++j) |
for (j = 0; j < state->nlookaheads; ++j) |
201 |
for (k = 0; k < ntokens; ++k) |
BITSET_EXECUTE (state->lookaheads[j], 0, k, |
202 |
if (bitset_test (state->lookaheads[j], k) |
{ |
203 |
&& state->lookaheads_rule[j]->number == rule->number) |
if (state->lookaheads_rule[j]->number == rule->number) |
204 |
nlookaheads++; |
nlookaheads++; |
205 |
|
}); |
206 |
|
|
207 |
/* Print them if there are. */ |
/* Print them if there are. */ |
208 |
if (nlookaheads) |
if (nlookaheads) |
209 |
{ |
{ |
210 |
fprintf (out, " ["); |
fprintf (out, " ["); |
211 |
for (j = 0; j < state->nlookaheads; ++j) |
for (j = 0; j < state->nlookaheads; ++j) |
212 |
for (k = 0; k < ntokens; ++k) |
BITSET_EXECUTE (state->lookaheads[j], 0, k, |
213 |
if (bitset_test (state->lookaheads[j], k) |
{ |
214 |
&& state->lookaheads_rule[j]->number == rule->number) |
if (state->lookaheads_rule[j]->number == rule->number) |
215 |
fprintf (out, "%s%s", |
fprintf (out, "%s%s", |
216 |
symbol_tag_get (symbols[k]), |
symbol_tag_get (symbols[k]), |
217 |
--nlookaheads ? ", " : ""); |
--nlookaheads ? ", " : ""); |
218 |
|
}); |
219 |
fprintf (out, "]"); |
fprintf (out, "]"); |
220 |
} |
} |
221 |
} |
} |