Related articles |
---|
Is there an error correcting parser generator out there? hallmann@shiva.informatik.uni-dortmund.de (1994-09-26) |
Re: Is there an error correcting parser generator out there? parrt@everest.ee.umn.edu (Terence Parr) (1994-09-30) |
Re: Re: Is there an error correcting parser generator out there? rockwell@nova.umd.edu (Raul Deluth Miller) (1994-10-03) |
Re: Re: Is there an error correcting parser generator out there? bburshte@us.oracle.com (Boris Burshteyn) (1994-10-04) |
Re: Re: Is there an error correcting parser generator out there? rfg@netcom.com (1994-10-05) |
Newsgroups: | comp.compilers |
From: | Raul Deluth Miller <rockwell@nova.umd.edu> |
Keywords: | errors, parse, tools |
Organization: | Compilers Central |
References: | 94-09-142 94-10-005 |
Date: | Mon, 3 Oct 1994 12:45:49 GMT |
Terence Parr:
: Let's consider a simple example. Assuming an input of
: if 3+* then ...
: for some rule:
: stat: IF expr THEN stat | ... ;
: we would like to see a nice error message like:
: file(line): error at "*": bad conditional of IF
: I argue that, while an automatic mechanism might be able to recover
: from this error, the error reporting facility could only generate
: something like
: file(line): error at "*" in expression
To generate the "nice" error message using yacc, the error recovery
could be structured like this:
[1] Build error recovery into your expression syntax.
[2] Keep a data structure to record the details of the form of the
error recovery.
[3] Defer reporting of error recovery to the statement level.
Basically, at each significant production, begin by checking for
errors which would have occurred during the text which lead to
recognition of that production.
Then again, perhaps the use of programmer defined data structures
implies that this is "outside the scope of yacc"?
--
Raul D. Miller
<rockwell@nova.umd.edu>
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.