help-bison
[Top][All Lists]
Advanced

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

Re: A question about error recovery


From: Anthony DeRobertis
Subject: Re: A question about error recovery
Date: Wed, 3 Jul 2002 08:49:55 -0400

On Wednesday, July 3, 2002, at 05:38 , zhke wrote:

I allocate memory for Objects in yylex(),and return the pointers as yylval. Now if a parse error occurs,I want to abort from the yyparse() .How should I free memory of those objects remaining in the parse stack?Because my application is a deamon process,so the memory leaking is not endurable.
Could anybody give me any advice?Any reply would be appreciated.

One way would be to use an object factory that keeps track of all objects allocated during a parse and upon a parse error, tell it to deallocate all of them.

You could also use something like mark-and-sweep garbage collection.




reply via email to

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