* lib/libiberty.h: New.

* lib: Update the bitset implementation from upstream.
* src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
* src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
* src/main.c: Adjust bitset stats calls.
This commit is contained in:
Akim Demaille
2002-07-02 13:51:27 +00:00
parent 524346a3a3
commit 613f5e1a89
22 changed files with 1009 additions and 809 deletions

View File

@@ -195,27 +195,24 @@ void
state_rule_lookaheads_print (state_t *state, rule_t *rule, FILE *out)
{
int j, k;
bitset_iterator biter;
int nlookaheads = 0;
/* Count the number of lookaheads corresponding to this rule. */
for (j = 0; j < state->nlookaheads; ++j)
BITSET_EXECUTE (state->lookaheads[j], 0, k,
{
BITSET_FOR_EACH (biter, state->lookaheads[j], k, 0)
if (state->lookaheads_rule[j]->number == rule->number)
nlookaheads++;
});
/* Print them if there are. */
if (nlookaheads)
{
fprintf (out, " [");
for (j = 0; j < state->nlookaheads; ++j)
BITSET_EXECUTE (state->lookaheads[j], 0, k,
{
BITSET_FOR_EACH (biter, state->lookaheads[j], k, 0)
if (state->lookaheads_rule[j]->number == rule->number)
fprintf (out, "%s%s",
symbols[k]->tag,
--nlookaheads ? ", " : "");
});
fprintf (out, "]");
}
}