|Reporting errors from yacc/bison grammar... firstname.lastname@example.org (Derekasaurus Rex) (2001-01-26)|
|From:||"Derekasaurus Rex" <email@example.com>|
|Date:||26 Jan 2001 17:03:23 -0500|
|Keywords:||yacc, errors, question|
|Posted-Date:||26 Jan 2001 17:03:23 EST|
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
There have been a number of short threads about this, but I have not
found any good answers.
[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
Search the comp.compilers archives again.