net.esper.eql.parse
Class EPStatementSyntaxException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.esper.client.EPException
                  extended by net.esper.client.EPStatementException
                      extended by net.esper.eql.parse.EPStatementSyntaxException
All Implemented Interfaces:
Serializable

public class EPStatementSyntaxException
extends EPStatementException

This exception is thrown to indicate a problem in statement creation.

See Also:
Serialized Form

Constructor Summary
EPStatementSyntaxException(String message, String expression)
          Ctor.
 
Method Summary
static EPStatementSyntaxException convert(antlr.RecognitionException e, String expression)
          Converts from a syntax error to a nice statement exception.
static EPStatementSyntaxException convert(antlr.TokenStreamException e, String expression)
          Converts from a syntax (token stream) error to a nice statement exception.
static EPStatementSyntaxException convertEndOfInput(antlr.RecognitionException e, String expression)
          Converts end-of-input error from a syntax error to a nice statement exception.
static EPStatementSyntaxException convertEndOfInput(antlr.RecognitionException e, String tokenNameExpected, String expression)
          Converts end-of-input error from a syntax error to a nice statement exception.
static String getPositionInfo(antlr.RecognitionException e)
          Returns the position information string for a parser exception.
 
Methods inherited from class net.esper.client.EPStatementException
getExpression, getMessage, setExpression
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EPStatementSyntaxException

public EPStatementSyntaxException(String message,
                                  String expression)
Ctor.

Parameters:
message - - error message
expression - - expression text
Method Detail

convert

public static EPStatementSyntaxException convert(antlr.RecognitionException e,
                                                 String expression)
Converts from a syntax error to a nice statement exception.

Parameters:
e - is the syntax error
expression - is the expression text
Returns:
syntax exception

convertEndOfInput

public static EPStatementSyntaxException convertEndOfInput(antlr.RecognitionException e,
                                                           String tokenNameExpected,
                                                           String expression)
Converts end-of-input error from a syntax error to a nice statement exception.

Parameters:
e - is the syntax error
expression - is the expression text
tokenNameExpected - is the name or paraphrase of the expected token
Returns:
syntax exception

convertEndOfInput

public static EPStatementSyntaxException convertEndOfInput(antlr.RecognitionException e,
                                                           String expression)
Converts end-of-input error from a syntax error to a nice statement exception.

Parameters:
e - is the syntax error
expression - is the expression text
Returns:
syntax exception

getPositionInfo

public static String getPositionInfo(antlr.RecognitionException e)
Returns the position information string for a parser exception.

Parameters:
e - is the parser exception
Returns:
is a string with line and column information

convert

public static EPStatementSyntaxException convert(antlr.TokenStreamException e,
                                                 String expression)
Converts from a syntax (token stream) error to a nice statement exception.

Parameters:
e - is the syntax error
expression - is the expression text
Returns:
syntax exception