mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
* src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
(count_sr_conflicts): Use bitset_count. * src/reduce.c (inaccessable_symbols): Ditto. (bits_size): Remove. * src/warshall.h, src/warshall.c: Convert to bitsetv.
This commit is contained in:
16
src/reduce.c
16
src/reduce.c
@@ -57,15 +57,6 @@ static int nuseless_productions;
|
||||
static int nuseful_nonterminals;
|
||||
int nuseless_nonterminals;
|
||||
|
||||
static int
|
||||
bits_size (bitset S)
|
||||
{
|
||||
int i, count = 0;
|
||||
|
||||
BITSET_EXECUTE (S, 0, i, { ++count; });
|
||||
return count;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------.
|
||||
| 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 |
|
||||
@@ -82,9 +73,8 @@ useful_production (int i, bitset N0)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -215,7 +205,7 @@ inaccessable_symbols (void)
|
||||
bitset_free (P);
|
||||
P = Pp;
|
||||
|
||||
nuseful_productions = bits_size (P);
|
||||
nuseful_productions = bitset_count (P);
|
||||
nuseless_productions = nrules - nuseful_productions;
|
||||
|
||||
nuseful_nonterminals = 0;
|
||||
|
||||
Reference in New Issue
Block a user