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


_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to