- Copyright (C) 1988, 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
\f
/*-------------------------------------------------------------------.
| Another way to do this would be with a set for each production and |
\f
/*-------------------------------------------------------------------.
| Another way to do this would be with a set for each production and |
/* A production is useful if all of the nonterminals in its appear
in the set of useful nonterminals. */
/* A production is useful if all of the nonterminals in its appear
in the set of useful nonterminals. */
/* N is set as built. Np is set being built this iteration. P is
set of all productions which have a RHS all in N. */
/* N is set as built. Np is set being built this iteration. P is
set of all productions which have a RHS all in N. */
for (rhsp = rules[r].rhs; *rhsp >= 0; rhsp++)
if (ISTOKEN (*rhsp) || bitset_test (N, *rhsp - ntokens))
bitset_set (Vp, *rhsp);
for (rhsp = rules[r].rhs; *rhsp >= 0; rhsp++)
if (ISTOKEN (*rhsp) || bitset_test (N, *rhsp - ntokens))
bitset_set (Vp, *rhsp);
for (r = 0; r < nrules; ++r)
if (rules[r].precsym != 0)
bitset_set (V1, rules[r].precsym->number);
for (r = 0; r < nrules; ++r)
if (rules[r].precsym != 0)
bitset_set (V1, rules[r].precsym->number);
for (r = 0; r < nrules; r++)
rules[r].useful = bitset_test (P, r);
grammar_rules_never_reduced_report (_("useless rule"));
for (r = 0; r < nrules; r++)
rules[r].useful = bitset_test (P, r);
grammar_rules_never_reduced_report (_("useless rule"));
/* Map the nonterminals to their new index: useful first, useless
afterwards. Kept for later report. */
/* Map the nonterminals to their new index: useful first, useless
afterwards. Kept for later report. */