/* Grammar reduction for Bison.
- Copyright (C) 1988-1989, 2000-2003, 2005-2011 Free Software
+ Copyright (C) 1988-1989, 2000-2003, 2005-2012 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
#include "system.h"
#include <bitset.h>
-#include <quotearg.h>
#include "complain.h"
#include "files.h"
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);
}