Re: yacc error handling

"Ajay Kalhan" <>
21 Nov 1999 23:27:02 -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: "Ajay Kalhan" <>
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" <> 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.