Package org.apache.cassandra.cql3
Class ErrorCollector
- java.lang.Object
-
- org.apache.cassandra.cql3.ErrorCollector
-
- All Implemented Interfaces:
ErrorListener
public final class ErrorCollector extends java.lang.Object implements ErrorListener
ErrorListenerthat collect and enhance the errors send by the CQL lexer and parser.
-
-
Constructor Summary
Constructors Constructor Description ErrorCollector(java.lang.String query)Creates a newErrorCollectorinstance to collect the syntax errors associated to the specified CQL query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsyntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String errorMsg)Invoked when a syntax error with a specified message occurs.voidsyntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e)Invoked when a syntax error occurs.voidthrowFirstSyntaxError()Throws the first syntax error found by the lexer or the parser if it exists.
-
-
-
Method Detail
-
syntaxError
public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e)Invoked when a syntax error occurs.- Specified by:
syntaxErrorin interfaceErrorListener- Parameters:
recognizer- the parser or lexer that emitted the errortokenNames- the token namese- the exception
-
syntaxError
public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String errorMsg)Invoked when a syntax error with a specified message occurs.- Specified by:
syntaxErrorin interfaceErrorListener- Parameters:
recognizer- the parser or lexer that emitted the errorerrorMsg- the error message
-
throwFirstSyntaxError
public void throwFirstSyntaxError() throws SyntaxExceptionThrows the first syntax error found by the lexer or the parser if it exists.- Throws:
SyntaxException- the syntax error.
-
-