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
ErrorListener
that collect and enhance the errors send by the CQL lexer and parser.
-
-
Constructor Summary
Constructors Constructor Description ErrorCollector(java.lang.String query)
Creates a newErrorCollector
instance to collect the syntax errors associated to the specified CQL query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String errorMsg)
Invoked when a syntax error with a specified message occurs.void
syntaxError(org.antlr.runtime.BaseRecognizer recognizer, java.lang.String[] tokenNames, org.antlr.runtime.RecognitionException e)
Invoked when a syntax error occurs.void
throwFirstSyntaxError()
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:
syntaxError
in 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:
syntaxError
in interfaceErrorListener
- Parameters:
recognizer
- the parser or lexer that emitted the errorerrorMsg
- the error message
-
throwFirstSyntaxError
public void throwFirstSyntaxError() throws SyntaxException
Throws the first syntax error found by the lexer or the parser if it exists.- Throws:
SyntaxException
- the syntax error.
-
-