[Top][All Lists]
[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 17:33:39 +0200 |
User-agent: |
KMail/1.8.1 |
Akim -
> 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?
If so, I don't understand why it is 'not very clean'?
Bison has %parse-param and %lex-param already, adding a %destructor-param
would make it _more_ clean (consistent) in my view.
Even if there were a %final-action, how would that help me?
I am working with pure-parsers, and the cleanup functions I want to call in my
yydestructor() function are function pointers that are passed in through a
state object. So basically I need to pass that state object into yyparse() (I
am using %parse-param for that), and then on to yydestructor() (that's not
possible right now).
So what I'm doing is that I compile my .y file into a .cc file, and then do
sed -e 's/yydestruct (const char \*/yydestruct (wolfgangs_state_object *
state, const char \*/' -e 's/yydestruct ("/yydestruct (state, "/'
Now that is _not clean_ :-)
But it works. If there were a %destructor-param, I wouldn't need the sed
action.
Regards,
Wolfgang
- Re: %destructor feedback, (continued)
- Re: %destructor feedback, Akim Demaille, 2005/10/20
- Re: %destructor feedback, Joel E. Denny, 2005/10/20
- Re: %destructor feedback, Frank Heckenbach, 2005/10/21
- Re: %destructor feedback, Joel E. Denny, 2005/10/21
- Re: %destructor feedback, Frank Heckenbach, 2005/10/22
- Re: %destructor feedback, Joel E. Denny, 2005/10/22
- Re: %destructor feedback, Frank Heckenbach, 2005/10/22
- Re: %destructor feedback, Joel E. Denny, 2005/10/22
Re: %destructor feedback, Akim Demaille, 2005/10/20
- Re: %destructor feedback,
Wolfgang Spraul <=