Package org.apache.cassandra.cql3
Class ErrorCollector
java.lang.Object
org.apache.cassandra.cql3.ErrorCollector
- All Implemented Interfaces:
ErrorListener
ErrorListener that collect and enhance the errors send by the CQL lexer and parser.-
Constructor Summary
ConstructorsConstructorDescriptionErrorCollector(String query) Creates a newErrorCollectorinstance to collect the syntax errors associated to the specified CQL query. -
Method Summary
Modifier and TypeMethodDescriptionvoidsyntaxError(org.antlr.runtime.BaseRecognizer recognizer, String errorMsg) Invoked when a syntax error with a specified message occurs.voidsyntaxError(org.antlr.runtime.BaseRecognizer recognizer, String[] tokenNames, org.antlr.runtime.RecognitionException e) Invoked when a syntax error occurs.voidThrows the first syntax error found by the lexer or the parser if it exists.
-
Constructor Details
-
ErrorCollector
Creates a newErrorCollectorinstance to collect the syntax errors associated to the specified CQL query.- Parameters:
query- the CQL query that will be parsed
-
-
Method Details
-
syntaxError
public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer, 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
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
Throws the first syntax error found by the lexer or the parser if it exists.- Throws:
SyntaxException- the syntax error.
-