After looking through the mailing archives I have had few things cleared. I am using C++ with bison 1.25, so it does not have %destructor. I cannot rely on garbage collecting, so I have to free everything myself. Also I do not have common base class for all parse tree nodes (so I can't have a storage for all parse tree nodes, and then call virtual destructor for everybody in case of error), and I cannot create such class, because objects stored in the parse tree are from different "groups" so to speak, that are not supposed to be linked together.
Is it hard to incorporate destructor functionality from 2.0 into 1.25? What kind of changes would that require? Any other ways people are taking care of deleting parse tree nodes after error? thanks in advance -----Original Message----- From: hz kto <[EMAIL PROTECTED]> To: help-bison@gnu.org Date: Tue, 07 Jun 2005 05:28:31 +0400 Subject: memory leaks > > > > Hi, all, > > in my parser, when a syntax error happens, all allocated parse tree > nodes are left dangling, and not freed. Does anybody try and clean up > allocated memory after parser error? > Even though it is not critical, since program terminates anyway, I'd like > to have no leaks in any case, so that leaks from the parser don't mask > leaks that happen during successful execution. > What's a good way to go about this? > > thanks in advance > > Alex > _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison