[antlr-interest] How does one suppress 'no viable alternative at character' warning messages

Tim Halloran hallorant at gmail.com
Wed Sep 17 12:23:52 PDT 2008


On Wed, Sep 17, 2008 at 3:16 PM, Terence Parr <parrt at cs.usfca.edu> wrote:

> Or,Overrides the reporting method to do nothing :)
> Ter


I tried this with

@lexer::members {
@Override
public void reportError(RecognitionException e) {
    throw e;
}
}

but this is unhappy because I can't change the method signature to add
"throws RecognitionException."

Doing nothing, as Terrence suggested above, works but still accepts
sentences that are not in my language,  for example if I accept (hide) and I
give the string (***hide) where * is not accepted by my lexer the parser
views them as the same sentence.  This appears to be because the recover by
single symbol deletion is going on and I have not figured out how to turn it
off.  Am I correct?

Regards,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080917/02c94292/attachment.html 


More information about the antlr-interest mailing list