Re: yacc error handling

"Ajay Kalhan" <ajayk@microsoft.com>
21 Nov 1999 23:27:02 -0500

          From comp.compilers

Related articles
Re: YACC error handling heirich@cs.ucsd.edu (1989-07-29)
yacc error handling ajayk@microsoft.com (Ajay Kalhan) (1999-11-19)
Re: yacc error handling ajayk@microsoft.com (Ajay Kalhan) (1999-11-21)
Re: yacc error handling ewbank@lucent.com (Bryan Ewbank) (1999-11-23)
Re: yacc error handling zalman@netcom11.netcom.com (Zalman Stern) (1999-11-28)
Re: yacc error handling mschweis@u.arizona.edu (Michael C Schweisguth) (1999-12-07)
Re: yacc error handling wfahle@bigfoot.com (Bill Fahle) (1999-12-24)
| List of all articles for this month |
From: "Ajay Kalhan" <ajayk@microsoft.com>
Newsgroups: comp.compilers
Date: 21 Nov 1999 23:27:02 -0500
Organization: Microsoft Corp.
References: 99-11-117
Keywords: yacc, errors

(I can see I am extending the original question here)


What if besides memory I wanted to invoke destructors of created objects?


Is there any way to gain control of yacc stack unwinding on error?


thank you.


"Ajay Kalhan" <ajayk@microsoft.com> wrote
> Objective is to cleanup memory allocations on parse errors. One
> solution - Supplement rules with error rules in whose actions one can
> do cleanup. Another solution - thread all allocated memory off a
> global structure that can be destroyed at end of parsing.


> [I thread the allocated memory, it's more robust since it doesn't depend
> on writing perfectly correct error rules. -John]


[Same answer. If you want to call destrictors, stick function
pointers in with your thread info. -John]







Post a followup to this message

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