[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %destructor feedback

From: Joel E. Denny
Subject: Re: %destructor feedback
Date: Sat, 22 Oct 2005 11:03:35 -0400 (EDT)

On Sat, 22 Oct 2005, Frank Heckenbach wrote:

Joel E. Denny wrote:

On Fri, 21 Oct 2005, Frank Heckenbach wrote:

Akim Demaille wrote:

Maybe that does not deserve that much attention: it seems pretty weird
not to use a value.  A warning seems a better feature.

I sometimes attach some kinds of flags (integer type) to some
symbols that I need in some, but not all, rules that use that
symbol. So, if you go for the warning, could you please make it
optional? (I think it would be a useful feature in general,
including several of my grammars, but in some cases I'd probably
prefer to turn it off.)

If your semantic value is just an integer, then you probably won't declare
a destructor.  In that case, I should think there's no reason for bison to
generate a warning.  Would that resolve your issue?

That would probably work. However, I'm considering whether such a
warning might not be useful even in absence of destructors in many
cases (not the above-mentioned grammar, of course, but many others),
as not using a semantic value is often, as Akim said, pretty weird.
I can't really tell off-hand. I guess I'd have to check the effects
of such a warning on my grammars (which usually don't have
destructors, yet), but I suppose it would be useful in a number of

Yeah, I think I agree. However, instead of a global switch, I still argue that something like YYUSE($5); in the semantic actions would be cleaner. That way, when looking at a semantic action, you'd be able to tell exactly which semantic values were intentionally not used. Of course, for old grammars, going back and adding these might be a bit of work... but I'd find it worthwhile.

It seems the thread lost bug-bison again, so I quoted everything and CC'ed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]