bug-bison
[Top][All Lists]
Advanced

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

Re: %destructor feedback


From: Akim Demaille
Subject: Re: %destructor feedback
Date: Mon, 19 Dec 2005 17:43:00 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

>>> "Joel" == Joel E Denny <address@hidden> writes:

 > On Wed, 7 Dec 2005, Akim Demaille wrote:
 >>>>> "Joel" == Joel E Denny <address@hidden> writes:
 >> 
 >> > On Wed, 7 Dec 2005, Akim Demaille wrote:
 >> >>>>> "Paul" == Paul Eggert <address@hidden> writes:
 >> >>
 >> >> > Why can't we simply rewrite the code so that it doesn't declare
 >> >> > unused variables?
 >> >>
 >> >> Because you don't know whether yyerror, for instance, will use the
 >> >> location, or the %parse-param.  But some users need them there.
 >> 
 >> > But the user writes yyerror, and I don't believe YYUSE is documented for
 >> > the user to invoke.
 >> 
 >> Right :)  Consider the %printers and %destructors for instance.

 > In those cases, it also seems reasonable to leave it in the hands of the 
 > user.  That is, if the user doesn't reference a semantic value in its 
 > printer or destructor, why did he declare its printer or destructor?  Is 
 > this a legitimate usage?  Shouldn't he be warned *somehow*?  Maybe even by 
 > bison?  Whether $$ occurs can be computed.

In the case of %printer the issue is a bit different: if you use
%parse-param, these additional arguments are available in the printers
and dtors.  So is the location: you might be willing to use it for
instance of log something.  So it makes sense to provide them in all
the cases.





reply via email to

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