[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to abort when token are discarded
From: |
Joel E. Denny |
Subject: |
Re: how to abort when token are discarded |
Date: |
Sat, 19 Feb 2011 12:26:47 -0500 (EST) |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Sat, 12 Feb 2011, Bill Allombert wrote:
> I have a grammar that handles errors.
Do you mean you're using Bison's error token? Or do you mean that you've
written grammar rules that match syntactically incorrect input?
> However, in this contest, discarding
> tokens is highly undesirable, much more so than aborting.
Do you mean that you've declared destructors with %destructor? Do you
mean that you don't want the parser to execute them when it encounters
syntax errors in certain contexts?
> What is the proper way to prevent bison from discarding token and
> instead abort ?
If you can write grammar rules that catch the syntax errors, you could add
semantic actions that set a flag to tell your destructors not to execute.