help-bison
[Top][All Lists]
Advanced

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

Re: [Fwd: question about error handling]


From: Hans Aberg
Subject: Re: [Fwd: question about error handling]
Date: Tue, 12 Jun 2001 21:28:06 +0200

At 13:16 -0500 2001/06/12, David Durham wrote:
>I'm not following you, but I'll respond anyway  ;)
...
>in fact I do use the %union feature... All (most really) of the
>elements in the union are pointers to derivations of that base class,
>that because, of course, I need parse tree nodes to have a certain
>semantic value.

What I am saying is that if one does not use the %union feature, which the
parser implements as a C/C++ union, then one can instead use a C++ class as
the YYSTYPE, and it can take care of the memory management via its
destructor.

If one does use the %union feature, then it is clear that pointers must be
cleaned up separately by some method if one wants to avoid memory leaks, as
the C/C++ unions do not have any user defineable destructors and only
accept data without user defined destructors.

  Hans Aberg





reply via email to

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