From: Juan Carlos Arevalo-Baeza (jcab.lists_at_[hidden])
Date: 2002-10-19 22:22:56
On Sat, 19 Oct 2002 11:02:04 -0700, Carl Daniel wrote:
>One concern I have, which I belive is based mostly in ignorance, is the
>ability of a Spirit-generated parser to perform error recovery and issue
>good error messages. I didn't have time to experiment with the exceptions
>and guards mechanism, so perhaps my concern is unfounded.
Try the cpp_grammar test/thingy that I have here:
There's a pre-built Windows executable, and source. It has a pretty nice working compiler-error framework using exceptions and guards. It uses the position_iterator so it points at the place in the source where the error (or warning) happened, and it provides for display of the parser call-stack, so to speak, as in:
cpp_grammar.cpp:285:9: Error: Expecting '}'
cpp_grammar.cpp:284:5: While parsing the member declarator
cpp_grammar.cpp:282:14: While parsing member template declaration
cpp_grammar.cpp:275:10: While parsing template declaration
It's all proof-of-concept/work-in-progress/prototype, but it does work. And it also can be used for inserting trace statements in the parser.
>Great work Joel, Dan, Harmut, Martin, JCAB, and everyone else!
ICQ: 10913692 @WORK: 101728263
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk