com.puppycrawl.tools.checkstyle

Class TreeWalker.SilentJavaRecognizer

private static final class TreeWalker.SilentJavaRecognizer extends GeneratedJavaRecognizer

Overrides ANTLR error reporting so we completely control checkstyle's output during parsing. This is important because we try parsing with several grammers (with/without support for assert). We must not write any error messages when parsing fails because with the next grammar it might succeed and the user will be confused.
Constructor Summary
SilentJavaRecognizer(TokenStream aLexer)
Creates a new SilentJavaRecognizer instance.
Method Summary
voidreportError(RecognitionException aRex)
Parser error-reporting function, does nothing.
voidreportError(String aMsg)
Parser error-reporting function, does nothing.
voidreportWarning(String aMsg)
Parser warning-reporting function, does nothing.

Constructor Detail

SilentJavaRecognizer

public SilentJavaRecognizer(TokenStream aLexer)
Creates a new SilentJavaRecognizer instance.

Parameters: aLexer the tokenstream the recognizer operates on.

Method Detail

reportError

public void reportError(RecognitionException aRex)
Parser error-reporting function, does nothing.

Parameters: aRex the exception to be reported

reportError

public void reportError(String aMsg)
Parser error-reporting function, does nothing.

Parameters: aMsg the error message

reportWarning

public void reportWarning(String aMsg)
Parser warning-reporting function, does nothing.

Parameters: aMsg the error message