static int nuseful_nonterminals;
int nuseless_nonterminals;
\f
-static int
-bits_size (bitset S)
-{
- int i, count = 0;
-
- BITSET_EXECUTE (S, 0, i, { ++count; });
- return count;
-}
-\f
/*-------------------------------------------------------------------.
| Another way to do this would be with a set for each production and |
| then do subset tests against N0, but even for the C grammar the |
in the set of useful nonterminals. */
for (r = &ritem[rules[i].rhs]; *r >= 0; r++)
- if (ISVAR (n = *r))
- if (!bitset_test (N0, n - ntokens))
- return FALSE;
+ if (ISVAR (n = *r) && !bitset_test (N0, n - ntokens))
+ return FALSE;
return TRUE;
}
bitset_free (P);
P = Pp;
- nuseful_productions = bits_size (P);
+ nuseful_productions = bitset_count (P);
nuseless_productions = nrules - nuseful_productions;
nuseful_nonterminals = 0;