static void
nonterminals_reduce (void)
{
- symbol_number i, n;
-
/* Map the nonterminals to their new index: useful first, useless
afterwards. Kept for later report. */
symbol_number *nontermmap = xnmalloc (nvars, sizeof *nontermmap);
- n = ntokens;
+ symbol_number n = ntokens;
+ symbol_number i;
for (i = ntokens; i < nsyms; i++)
if (bitset_test (V, i))
nontermmap[i - ntokens] = n++;
if (!bitset_test (V, i))
{
nontermmap[i - ntokens] = n++;
- warn_at (symbols[i]->location, _("nonterminal useless in grammar: %s"),
- symbols[i]->tag);
+ if (symbols[i]->status != used)
+ warn_at (symbols[i]->location,
+ _("nonterminal useless in grammar: %s"),
+ symbols[i]->tag);
}