"Joel E. Denny" <[EMAIL PROTECTED]> writes:

>   http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00067.html

That looks reasonable to me.  Some questions (hope they're minor):

What about grammars without %union, but where the program defines
YYSTYPE?  Do you still allow "%destructor { free ($$); }"?

For "%destructor { free ($$); } <type1> <type2>" do Bison generate
just one copy of the "free ($$);", or one for each type?

For (3), suppose a midrule action has both $<T1>$ and $<T2>$, and <T1>
has a destructor but T2 does not.  Shouldn't this generate a
warning/error too?

Again for (3), if $<T1>$ and $<T2>$ have the same destructor, which
type is used to call the destructor?

Also, I don't understand the last two sentences of the above URL:

  $<T>n appears after the time when bison might actually generate
  destructor calls on the semantic value.  So, the user can play with
  whatever union members he wants here.

Can you please give an example of this?  It sounds dangerous to let
the user play with destroyed members.


Reply via email to