[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: destruct object when is popped from bison stack?
From: |
Hans Aberg |
Subject: |
Re: destruct object when is popped from bison stack? |
Date: |
Mon, 20 Jun 2011 10:18:25 +0200 |
On 19 Jun 2011, at 12:38, Jakub M wrote:
> I allocate a new object for each token, and i would like to delete the
> object when the token is not used anymore. Is there any directive that
> would run the delete code every time a token is popped from the stack?
> I thought %destructor is the one, but now I am not sure...
If you use the C-parser, you will have to delete the objects in the actions;
%destructor is for deleting during error recovery. One might instead use say
the Hans Boehm GC.
Hans