In my experience, programs which use parser generators to parse domain-specific languages tend to spew cryptic and unhelpful "syntax errors" in case an input cannot be parsed correctly.
Now that I need to write a parser for a domain-specific data language myself (as part of a C++ program), I'd like to hold myself to a higher standard regarding user-friendly error reporting - and I'm hoping to find a parser generator/framework which can help me with that.
I'd like to avoid frameworks where the simple and elegant way to write a grammar comes with terrible error reporting, and where adding good error reporting entails so much unintuitive/unelegant refactoring and so much glue code, that it defeats the point of using a framework in the first place.
So I'm hoping that someone more experienced can tell me:
- Which parser generators/frameworks are built with good error reporting in mind?
- What facilities do they provide for error reporting?
(Examples or documentation links appreciated!)
Requirements for the generated parser:
- Callable from C++ code.
- Possible to include in an open-source project (license-wise).
- Cross-platform (Win/Mac/Linux).
- Able to parse a context-free language that could be parsed with a traditional recursive descent parser. (No need for fancy things like left-recursion.)