Error handling with ANTLR 13320 (C++)
1 posts in topic
Flat View  Flat View

Posted By:   Gwenael_Chailleu
Posted On:   Wednesday, September 12, 2001 07:04 AM


I'm a ANTLR absolute beginer trying to implement
his own error handling procedures. But the generated C++
code throws no exception and grammar expressions of this
kind :

default : < <..>>

don't even compile.
Rewriting the syn function (parser) and erraction (lexer)
must not be the best way...What can be done with ANTLR 13320 ?
What about more recent ANTLR versions (generating C++)?

Thanks !

Re: Error handling with ANTLR 13320 (C++)

Posted By:   Dan_Haxell  
Posted On:   Friday, September 14, 2001 12:33 PM

Haven't used the older version much but the C++ exception handling in antlr-2.7.1 is good. You can catch the errors with catch[ some_exception ] { ...code... }

However, I did find a problem with exceptions generated by the lexical analyser during evaluation of a parser syntactic predicate - for some reason the exception handling code in the parser is skipped. Is this a bug? I don't know but I'm sure someone does. :)

About | Sitemap | Contact