Re: Error Recovery

Michael Roach <mcr@visi.com>
31 May 1997 23:51:44 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Error recovery gvcormac@plg.uwaterloo.ca (Gord Cormack) (1997-03-22)
Re: Error recovery P.Whillance@ncl.ac.uk (Peter Whillance) (1997-03-27)
Error Recovery markagr@aol.com (1997-05-12)
Re: Error Recovery nandu@longs.dr.lucent.com (1997-05-25)
Re: Error Recovery tc@charlie.cns.iit.edu (Thomas W. Christopher) (1997-05-25)
Re: Error Recovery mag01@jvcam.northern.co.uk (Mark Gregory) (1997-05-27)
Re: Error Recovery mcr@visi.com (Michael Roach) (1997-05-31)
| List of all articles for this month |

From: Michael Roach <mcr@visi.com>
Newsgroups: comp.compilers
Date: 31 May 1997 23:51:44 -0400
Organization: Compilers Central
References: 97-05-153 97-05-293 97-05-307
Keywords: errors, parse

Hi Mark,


This system is already in use by VisualParse++ v2 from Sand-Stone.
I'm currently waiting for the source code so I can port it, but when I
do get a hold of it I'll see about getting permission to post the
relavent parts.


VP++ allows you to define error tokens, such as %error ';' as well as
using what it calls synchronization tokens. Basically what it does is
it searches the stack for the tokens that can follow either a
synchronization token (%), or an %error token (; in this
example). This is then termed the valid token set. Next it skips all
the tokens in the input stream until it finds a token matching one in
the valid token set. If one is found, it then pops states off the
stack until the matched token is valid. Parsing then continues from
this point. Its enough for my needs. (above almost verbatum from the
manual, pgs 23-27)


-Mike


Mark Gregory wrote:
>
> Thomas W. Christopher wrote:
> >
> > A fiducial symbol is a terminal symbol that ends or separates
> > significant sections of program, e.g. ";", "end", "else".
>
> Hello Thomas ...
>
> I'm MarkAGr ( when I'm at home )
>
> The LL(k) generator I'm building needs a little more than the error
> recovery function ( "exit(-1);" ) that it already has ... and the
> system you described is the closest to that that I have already
> envisaged ... ie. when an error occurs ... the input stream is
> absorbed until a "guardian production" ( instead of "fiducial symbol"
> ) is found. The parser then continues from a given production as if no
> error has occured. This type of error recovery can ( relatively easily
> ) be generated automatically, by pushing the
> "end-of-current-production" production onto a "guardian
> production-stack" prior to any sub-production being entered, and
> popped if the sub-production resolves successfully. ( However an
> implementation is possible with no stack required for a
> recursive-descent parser. ) Finding a way to incorporate this
> guardian-production into the meta-syntax is another problem. My first
> attempt will be in the production declatation ...
--


Post a followup to this message

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