>>> "Joel" == Joel E Denny <[EMAIL PROTECTED]> writes:
> I prefer that the clean-up *not* happen automatically for either > YYABORT or YYERROR -- as in GLR parsing. This would allow for a > simple consistent rule: if the user's semantic action executes, > then the user's semantic action is responsible for cleaning up RHS > semantic values... regardless of how the user's semantic action > terminates. That's also what I had in mind when I first implemented this, but since Paul's changes, that's no longer what happens in yacc.c. I tend to think that usually, when an error is found, you will most probably get rid of all the RHS, so "let bison do it" seems the right default value. It is for YYACCEPT that I find it weird. But the full symmetry has value too. > I've also noticed that the bison documentation says: > Note that in the future, Bison might also consider that right hand > side members that are not mentioned in the action can be destroyed. > If this is implemented, I copied this idea from Lemon, another parser generator. But there's a huge difference bw Lemon and Bison: the latter is bound by the past, including that thingy called PO(*#&$(*#$SIX Yacc. And in that tradition, no action means $$ = $1;. So that would mean free everyone but $1? Gee, not beautiful. I still dunno how to do that nicely. Also, we have that "nice" feature: $-1 etc. and I have not sorted out all the details. Maybe that does not deserve that much attention: it seems pretty weird not to use a value. A warning seems a better feature. > 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. > What does everyone else think? In the present case, I was thinking about clearing even before running the user action, so that would not matter. Or rather, it would be fine. _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison