* src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,

* src/reduce.c: Remove the `bitset_zero's following the
`bitset_create's, as now it is performed by the latter.
This commit is contained in:
Akim Demaille
2002-03-04 13:56:41 +00:00
parent ef01750240
commit f0250de62e
6 changed files with 10 additions and 25 deletions

View File

@@ -1,3 +1,10 @@
2002-03-04 Akim Demaille <akim@epita.fr>
* src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
* src/reduce.c: Remove the `bitset_zero's following the
`bitset_create's, as now it is performed by the latter.
2002-03-04 Akim Demaille <akim@epita.fr> 2002-03-04 Akim Demaille <akim@epita.fr>
* lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h, * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,

View File

@@ -124,7 +124,6 @@ set_firsts (void)
for (i = ntokens; i < nsyms; i++) for (i = ntokens; i < nsyms; i++)
{ {
FIRSTS (i) = bitset_create (nvars, BITSET_FIXED); FIRSTS (i) = bitset_create (nvars, BITSET_FIXED);
bitset_zero (FIRSTS (i));
for (j = 0; derives[i][j] >= 0; ++j) for (j = 0; derives[i][j] >= 0; ++j)
{ {
int symbol = ritem[rules[derives[i][j]].rhs]; int symbol = ritem[rules[derives[i][j]].rhs];
@@ -157,10 +156,7 @@ set_fderives (void)
fderives = XCALLOC (bitset, nvars); fderives = XCALLOC (bitset, nvars);
bitset_stats_init (); bitset_stats_init ();
for (i = 0 ; i < nvars; ++i) for (i = 0 ; i < nvars; ++i)
{ fderives[i] = bitset_create (nrules + 1, BITSET_FIXED);
fderives[i] = bitset_create (nrules + 1, BITSET_FIXED);
bitset_zero (fderives[i]);
}
set_firsts (); set_firsts ();
@@ -185,7 +181,6 @@ new_closure (int n)
itemset = XCALLOC (short, n); itemset = XCALLOC (short, n);
ruleset = bitset_create (nrules + 1, BITSET_FIXED); ruleset = bitset_create (nrules + 1, BITSET_FIXED);
bitset_zero (ruleset);
set_fderives (); set_fderives ();
} }

View File

@@ -203,9 +203,7 @@ solve_conflicts (void)
conflicts = XCALLOC (char, nstates); conflicts = XCALLOC (char, nstates);
shiftset = bitset_create (ntokens, BITSET_FIXED); shiftset = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (shiftset);
lookaheadset = bitset_create (ntokens, BITSET_FIXED); lookaheadset = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (lookaheadset);
for (i = 0; i < nstates; i++) for (i = 0; i < nstates; i++)
set_conflicts (states[i]); set_conflicts (states[i]);

View File

@@ -141,10 +141,7 @@ initialize_LA (void)
LA = XCALLOC (bitset, nLA); LA = XCALLOC (bitset, nLA);
for (i = 0; i < nLA; ++i) for (i = 0; i < nLA; ++i)
{ LA[i] = bitset_create (ntokens, BITSET_FIXED);
LA[i] = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (LA[i]);
}
LAruleno = XCALLOC (short, nLA); LAruleno = XCALLOC (short, nLA);
lookback = XCALLOC (shorts *, nLA); lookback = XCALLOC (shorts *, nLA);
@@ -258,10 +255,7 @@ initialize_F (void)
F = XCALLOC (bitset, ngotos); F = XCALLOC (bitset, ngotos);
for (i = 0; i < ngotos; ++i) for (i = 0; i < ngotos; ++i)
{ F[i] = bitset_create (ntokens, BITSET_FIXED);
F[i] = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (F[i]);
}
for (i = 0; i < ngotos; i++) for (i = 0; i < ngotos; i++)
{ {

View File

@@ -492,9 +492,7 @@ print_results (void)
new_closure (nritems); new_closure (nritems);
/* Storage for print_reductions. */ /* Storage for print_reductions. */
shiftset = bitset_create (ntokens, BITSET_FIXED); shiftset = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (shiftset);
lookaheadset = bitset_create (ntokens, BITSET_FIXED); lookaheadset = bitset_create (ntokens, BITSET_FIXED);
bitset_zero (lookaheadset);
for (i = 0; i < nstates; i++) for (i = 0; i < nstates; i++)
print_state (out, states[i]); print_state (out, states[i]);
bitset_free (shiftset); bitset_free (shiftset);

View File

@@ -103,7 +103,6 @@ useless_nonterminals (void)
set of all productions which have a RHS all in N. */ set of all productions which have a RHS all in N. */
Np = bitset_create (nvars, BITSET_FIXED); Np = bitset_create (nvars, BITSET_FIXED);
bitset_zero (Np);
/* The set being computed is a set of nonterminals which can derive /* The set being computed is a set of nonterminals which can derive
@@ -175,9 +174,7 @@ inaccessable_symbols (void)
user can know. */ user can know. */
Vp = bitset_create (nsyms, BITSET_FIXED); Vp = bitset_create (nsyms, BITSET_FIXED);
bitset_zero (Vp);
Pp = bitset_create (nrules + 1, BITSET_FIXED); Pp = bitset_create (nrules + 1, BITSET_FIXED);
bitset_zero (Pp);
/* If the start symbol isn't useful, then nothing will be useful. */ /* If the start symbol isn't useful, then nothing will be useful. */
if (bitset_test (N, start_symbol - ntokens)) if (bitset_test (N, start_symbol - ntokens))
@@ -495,13 +492,9 @@ reduce_grammar (void)
/* Allocate the global sets used to compute the reduced grammar */ /* Allocate the global sets used to compute the reduced grammar */
N = bitset_create (nvars, BITSET_FIXED); N = bitset_create (nvars, BITSET_FIXED);
bitset_zero (N);
P = bitset_create (nrules + 1, BITSET_FIXED); P = bitset_create (nrules + 1, BITSET_FIXED);
bitset_zero (P);
V = bitset_create (nsyms, BITSET_FIXED); V = bitset_create (nsyms, BITSET_FIXED);
bitset_zero (V);
V1 = bitset_create (nsyms, BITSET_FIXED); V1 = bitset_create (nsyms, BITSET_FIXED);
bitset_zero (V1);
useless_nonterminals (); useless_nonterminals ();
inaccessable_symbols (); inaccessable_symbols ();