[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: Tue, 18 Oct 2005 16:56:52 -0400 (EDT)

On Tue, 18 Oct 2005, Paul Eggert wrote:

If this is implemented, I believe that it should be implemented
consistently for all three cases: the user's semantic action completes
successfully, it calls YYABORT, or it calls YYERROR.

Yes, that sounds right to me as well.

In other words, if you have an action that does nothing but invoke
YYABORT/YYERROR, clean-up would be automatic.

This sounds a little tricky to explain and/or implement; wouldn't it
be better to stick with the simpler rules?  Perhaps I'm missing

I'm not sure what you mean by `the simpler rules'.

As I see it, there would be one rule at first: in all cases (usual success, YYACCEPT, YYABORT, or YYERROR), the user must clean up RHS semantic values in any semantic action he provides.

Then there's the automatic destructor calls for unmentioned RHS semantic values. This feature is proposed in the bison documentation. If this feature is added, the user could avoid writing the destructor invocation for a particular RHS semantic value by simply not mentioning that semantic value in the semantic action. You seem to be agreeing to this feature for the case of YYABORT and YYERROR in your first response quoted above.

A logical result of this second rule is my second quote above. Does this make sense?

Please note that, later in this thread, Wolfgang and I pointed out a number of potential problems with this proposed unmentioned RHS semantic value feature. I wonder if it should be reconsidered.


reply via email to

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