help-bison
[Top][All Lists]
Advanced

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

default action in yydestruct


From: Z Liu
Subject: default action in yydestruct
Date: Wed, 21 Jun 2006 13:15:21 -0700 (PDT)

Is it possible to add a default action to yydestruct?

Two reasons:
1. For most of the tokens, the action is the same, e.g
free the memory. Only for a few tokens one want to
customize the behavior - that's where %destructor can
be put to best use.
2. In a large grammar, forgetting to add a token to
the %destructor directive can cause a lot of
grievance. A default action can serve as a safety net.

I'm thinking about an optional macro, similar to
YYPRINT. The default is do nothing. User can define
their own. It's probably cheap to add, only the m4
files need to be touched.

Thanks, -zl




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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