[antlr-interest] How to stop lexer reporting errors to standard output?
Vaclav Barta
vbar at comp.cz
Thu Aug 16 01:10:51 PDT 2007
Thomas Brandon wrote:
> On 8/16/07, Vaclav Barta <vbar at comp.cz> wrote:
>> I'm writing a library (parsing SQL, among other things) using ANTLR
>> (3.0, C# target), and I'd like it not to try any error recovery, but
>> just throw an exception on invalid input (so that the library user can
>> decide what to do about the error). I've managed to suppress error
>> recovery by specifying an empty @rulecatch, but I still occasionally get
>> warnings on standard output, i.e.
> Override reportError in your lexer and do general handling there.
Err, how?
@lexer::override {
public override void ReportError(RecognitionException e)
{
}
}
(method signature taken from Antlr.Runtime.BaseRecognizer) compiles OK
but makes no difference.
Bye
Vasek
More information about the antlr-interest
mailing list