Re: Memory leaks upon error recovery in Yacc

kapland@starfleet.com (David Kaplan)
18 Dec 2000 00:34:42 -0500

          From comp.compilers

Related articles
Memory leaks upon error recovery in Yacc davidpereira@home.com (David Pereira) (2000-11-18)
Re: Memory leaks upon error recovery in Yacc timur@lantel.ru (Timur Safin) (2000-12-01)
Re: Memory leaks upon error recovery in Yacc hannah@mamba.pond.sub.org (2000-12-18)
Re: Memory leaks upon error recovery in Yacc kapland@starfleet.com (2000-12-18)
| List of all articles for this month |

From: kapland@starfleet.com (David Kaplan)
Newsgroups: comp.compilers
Date: 18 Dec 2000 00:34:42 -0500
Organization: Compilers Central
References: 00-11-132
Keywords: yacc, storage
Posted-Date: 18 Dec 2000 00:34:42 EST

Hi,


I'D Suggest Using A Memory Pool. That Way, Once You're done, regardless
of the results of the parse, you can just kill all the memory in one
Shot. Of Course, You'Ll Need A Pool For Each Data Type You'Re Using,
but either templates in c++ or careful void* use in c should take care
of that.


regards,
dave


On 18 Nov 2000 00:55:16 -0500, "David Pereira" <davidpereira@home.com>
wrote:


>I am building a syntax tree with Bison, using the following
>method. For example,
>...


>The problem is error productions. When an error occurs, the yacc/bison
>parser pops state/semantic-value pairs off the top of the stack until it
>reaches a state whose underlying set of items contains the error keyword.





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.