* 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

@@ -90,26 +90,24 @@ print_core (struct obstack *oout, state_t *state)
&& state->nlookaheads)
{
int j, k;
bitset_iterator biter;
int nlookaheads = 0;
/* Look for 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)
nlookaheads++;
});
if (nlookaheads)
{
obstack_sgrow (oout, " [");
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)
obstack_fgrow2 (oout, "%s%s",
symbols[k]->tag,
--nlookaheads ? ", " : "");
});
obstack_sgrow (oout, "]");
}
}