[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: <reductions>
From: |
Joel E. Denny |
Subject: |
Re: <reductions> |
Date: |
Sun, 28 Oct 2007 12:02:39 -0400 (EDT) |
On Sun, 28 Oct 2007, Akim Demaille wrote:
>
> > Can someone explain what was intended by the following code in reduce.c?
> >
> > static void
> > reduce_print (void)
> > {
> > if (yacc_flag && nuseless_productions)
> > fprintf (stderr, ngettext ("%d rule never reduced\n",
> > "%d rules never reduced\n",
> > nuseless_productions),
> > nuseless_productions);
> >
> > That is, why does -y cause Bison to report the count of grammatically
> > useless rules as "rules never reduced"? Later in this function, Bison
> > reports the count again but as "useless rules". Surely this is wrong, but
> > I'm not sure what was intended.
>
> I might be wrong, but ISTR that that message
> was forged by Paul to follow POSIX. At that time
> there was not such emphasis on the fact that there
> were both grammar- and parser- useless rules.
I traced this back to revision 1.1 of reduce.c as committed by RMS on
12-Jul-94. Even then, Bison reported the same count twice: once as "rules
never reduced" and once as "useless rules". I haven't found anything in
SUSv3 that discusses this. Did I miss it? In revision 1.1 of reduce.c,
yacc_flag was called fixed_outfiles, but that doesn't make any more sense
to me.
So, I still don't understand why the above code is needed. I'm inclined
to remove it.