Class ErrorCollector

java.lang.Object
org.apache.cassandra.cql3.ErrorCollector
All Implemented Interfaces:
ErrorListener

public final class ErrorCollector extends Object implements ErrorListener
ErrorListener that collect and enhance the errors send by the CQL lexer and parser.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new ErrorCollector instance to collect the syntax errors associated to the specified CQL query.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    syntaxError(org.antlr.runtime.BaseRecognizer recognizer, String errorMsg)
    Invoked when a syntax error with a specified message occurs.
    void
    syntaxError(org.antlr.runtime.BaseRecognizer recognizer, String[] tokenNames, org.antlr.runtime.RecognitionException e)
    Invoked when a syntax error occurs.
    void
    Throws the first syntax error found by the lexer or the parser if it exists.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ErrorCollector

      public ErrorCollector(String query)
      Creates a new ErrorCollector instance 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:
      syntaxError in interface ErrorListener
      Parameters:
      recognizer - the parser or lexer that emitted the error
      tokenNames - the token names
      e - the exception
    • syntaxError

      public void syntaxError(org.antlr.runtime.BaseRecognizer recognizer, String errorMsg)
      Invoked when a syntax error with a specified message occurs.
      Specified by:
      syntaxError in interface ErrorListener
      Parameters:
      recognizer - the parser or lexer that emitted the error
      errorMsg - 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.