help-bison
[Top][All Lists]
Advanced

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

Re: %destructor feedback


From: Wolfgang Spraul
Subject: Re: %destructor feedback
Date: Thu, 20 Oct 2005 20:41:29 +0200
User-agent: KMail/1.8.1

Akim -

> We need no %destructor-param etc., we need to fix yydestructor and
> yysymprint so that %parse-param are passed to them, just like yyerror.

That would be perfectly fine for me. It's imaginable that someone wants to 
have different parameters for the different functions, but unless you see a 
lot of user demand for that, I absolutely understand you don't want to have 
%destructor-param, %error-param, %symprint-param etc.
In fact, since I am using the same parameter for yyparse() and yydestructor(), 
in my case making the %parse-param also apply to yydestructor() is even 
_better_ (!) than introducing a new %destructor-param.
I just didn't dare to suggest that because I thought someone might think that 
%PARSE-param is for the yyPARSE() function only :-)
But I guess that concern was unjustified.

I would be an even happier bison user if you would change this, then I could 
retire my sed fix.
Regards,
Wolfgang

On Thursday 20 October 2005 18:38, you wrote:
> >>> "Wolfgang" == Wolfgang Spraul <address@hidden> writes:
>  >
>  > Akim -
>
> Hey,
>
>  >> I'm not sure about %param-destructor, it is not very clean, but just
>  >> like there is %initial-action, we could introduce a %final-action
>  >> always run when leaving yyparse (whether on failure or not).
>  >
>  > When you say %param-destructor, do you mean the %destructor-param I was
>  > talking about?
>
> Yep, sorry for the M-t, but actually it is thanks to the sed snippet
> that I finally understood your point.  I thought you wanted that
> yyparse take care of freeing the %parse-params!  And indeed, it made
> little sense :)
>
> But it seems that you are pointing out a bug: when I made
> %parse-param, I had very clearly in mind that it should be available
> everywhere where user code is called.  That's what happens in C++, for
> free (since these are members).
>
> We need no %destructor-param etc., we need to fix yydestructor and
> yysymprint so that %parse-param are passed to them, just like yyerror.




reply via email to

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