Re: yacc error handling

"Bill Fahle" <>
24 Dec 1999 00:31:42 -0500

          From comp.compilers

Related articles
Re: YACC error handling (1989-07-29)
yacc error handling (Ajay Kalhan) (1999-11-19)
Re: yacc error handling (Ajay Kalhan) (1999-11-21)
Re: yacc error handling (Bryan Ewbank) (1999-11-23)
Re: yacc error handling (Zalman Stern) (1999-11-28)
Re: yacc error handling (Michael C Schweisguth) (1999-12-07)
Re: yacc error handling (Bill Fahle) (1999-12-24)
| List of all articles for this month |

From: "Bill Fahle" <>
Newsgroups: comp.compilers
Date: 24 Dec 1999 00:31:42 -0500
Organization: Compilers Central
References: 99-11-117 99-11-128
Keywords: yacc, errors

Ajay Kalhan <> wrote
> (I can see I am extending the original question here)
> What if besides memory I wanted to invoke destructors of created objects?

What I would do is keep a list of allocated objects, all of which
descend from a common base class (make the list a list of that base
class). Give that base class a virtual destructor, and then just call
delete on each object in the list when finished. Of course this
assumes that no object frees another object, since they will be freed
later in the list (or might have already been freed earlier). You
might also look into garbage collection (e.g., reference counting w/
smart pointers) as a way to manage memory.

Post a followup to this message

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