Related articles |
---|
Reporting errors from yacc/bison grammar... derekasaurus@excite.com (Derekasaurus Rex) (2001-01-26) |
From: | "Derekasaurus Rex" <derekasaurus@excite.com> |
Newsgroups: | comp.compilers |
Date: | 26 Jan 2001 17:03:23 -0500 |
Organization: | Compilers Central |
Keywords: | yacc, errors, question |
Posted-Date: | 26 Jan 2001 17:03:23 EST |
Hello,
I'm quite new to yacc/bison, but from what I've seen so far it leaves
much to be desired in its handling of errors. What is a good way to
produce meaningful errors?
I wrote a grammar for a file format I need to parse, but now I would
like to say, "hey, I expected this..." instead of a generic parser
error message. Is there a way to do this w/o enumerating errors as
grammar rules?
There have been a number of short threads about this, but I have not
found any good answers.
Thanks.
Derek
[If you look way back in the compilers archives, you'll see some work
on extracting follow sets from yacc parsers for error messages.
Personally, I don't find such messages very useful since for far too
many kinds of errors, the follow set is totally misleading. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.