|
From: | Hans Aberg |
Subject: | Re: Memory Leaks |
Date: | Tue, 21 Nov 2006 15:59:19 +0100 |
On 21 Nov 2006, at 14:00, Paulo J. Matos wrote:
The C++ parser uses for parser stack a class like std::vector or std::deque, which invokes the class destructors when the stack is unwound. So if the classes of the objects on the parser stack are properly written, no special cleanup is needed.Which means that since I'm using a C generated parser I should use destructor. But destructor will be called after each successful action or after each failed parsing (to which an action never gets called but the given value is actually allocated)?
Only when the parser unwinds the stack in a parse error recovery attempt, or so I remember (it's easy to check the written C-parser). You still to do normal cleanup in the rule actions.
Hans Aberg
[Prev in Thread] | Current Thread | [Next in Thread] |