Re: Memory leaks upon error recovery in Yacc

hannah@mamba.pond.sub.org (Hannah Schroeter)
18 Dec 2000 00:32:11 -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: hannah@mamba.pond.sub.org (Hannah Schroeter)
Newsgroups: comp.compilers
Date: 18 Dec 2000 00:32:11 -0500
Organization: Chaos
References: 00-11-132
Keywords: yacc, errors
Posted-Date: 18 Dec 2000 00:32:11 EST

Hello!


David Pereira <davidpereira@home.com> wrote:
>[...]


>The problem is error productions. When an error occurs, the yacc/bison
>[...]
>into a bigger subtree, had the parse gone smoothly at that level. Therefore,
>I have memory leaks and I would like to deallocate those subtrees. One
>[...]


>[You can try to free memory by using error rules to avoid the implicit
>pops, but this is definitely one of yacc's weaker areas. -John]


There have been suggestions by John and in another response.


However, a valid choice, especially nowadays, could be just using some
kind of garbage collection. Maybe Boehm's GC could help, but maybe
even a language switch, e.g. to a ML dialect; especially ML seems to
have some history of writing compilers or code generators in that
language family among the strongly typed (mostly) functional
languages.


Kind regards,


Hannah.


Post a followup to this message

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