[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %destructor declared by semantic type
From: |
Paul Eggert |
Subject: |
Re: %destructor declared by semantic type |
Date: |
Tue, 20 Jun 2006 23:42:41 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
"Joel E. Denny" <address@hidden> 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.