http://www.eteks.com

com.eteks.parser
Class CompilationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.eteks.parser.CompilationException
All Implemented Interfaces:
java.io.Serializable

public class CompilationException
extends java.lang.Exception

Exception thrown during the parsing of functions and expressions. This class stores the number of an error matching the type of the detected error, the character index in the parsed string where the error was found and eventually the lexical that caused the exception.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
Serialized Form

Field Summary
static int ASSIGN_OPERATOR_EXPECTED
           
static int CLOSING_BRACKET_EXPECTED
           
static int CLOSING_BRACKET_WITHOUT_OPENING_BRACKET
           
static int DUPLICATED_PARAMETER_NAME
           
static int ELSE_OPERATOR_EXPECTED
           
static int ELSE_OPERATOR_WITHOUT_IF_THEN_OPERATORS
           
static int FUNCTION_NAME_ALREADY_EXISTS
           
static int INVALID_FUNCTION_NAME
           
static int INVALID_PARAMETER_NAME
           
static int INVALID_PARAMETERS_COUNT_IN_FUNCTION_CALL
           
static int MISSING_PARAMETERS_IN_FUNCTION_CALL
           
static int OPENING_BRACKET_EXPECTED
           
static int RESERVED_WORD
           
static int SYNTAX_ERROR
           
static int THEN_OPERATOR_EXPECTED
           
static int THEN_OPERATOR_WITHOUT_IF_OPERATOR
           
static int UNKOWN_IDENTIFIER
           
 
Constructor Summary
CompilationException(int errorNumber, int characterIndex)
          Creates a compilation exception with a message describing this exception.
CompilationException(int errorNumber, int characterIndex, java.lang.String extractedString)
          Creates a compilation exception with a message describing this exception.
 
Method Summary
 int getCharacterIndex()
          Returns the character index in the parsed string where the error happened.
 java.lang.String getError()
          Returns the description of this exception.
 int getErrorNumber()
          Returns the number of the error of this exception.
 java.lang.String getExtractedString()
          Returns the invalid string (an invalid identifier or an other string) of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPENING_BRACKET_EXPECTED

public static final int OPENING_BRACKET_EXPECTED

INVALID_FUNCTION_NAME

public static final int INVALID_FUNCTION_NAME

RESERVED_WORD

public static final int RESERVED_WORD

FUNCTION_NAME_ALREADY_EXISTS

public static final int FUNCTION_NAME_ALREADY_EXISTS

CLOSING_BRACKET_EXPECTED

public static final int CLOSING_BRACKET_EXPECTED

ASSIGN_OPERATOR_EXPECTED

public static final int ASSIGN_OPERATOR_EXPECTED

INVALID_PARAMETER_NAME

public static final int INVALID_PARAMETER_NAME

DUPLICATED_PARAMETER_NAME

public static final int DUPLICATED_PARAMETER_NAME

SYNTAX_ERROR

public static final int SYNTAX_ERROR

CLOSING_BRACKET_WITHOUT_OPENING_BRACKET

public static final int CLOSING_BRACKET_WITHOUT_OPENING_BRACKET

UNKOWN_IDENTIFIER

public static final int UNKOWN_IDENTIFIER

MISSING_PARAMETERS_IN_FUNCTION_CALL

public static final int MISSING_PARAMETERS_IN_FUNCTION_CALL

INVALID_PARAMETERS_COUNT_IN_FUNCTION_CALL

public static final int INVALID_PARAMETERS_COUNT_IN_FUNCTION_CALL

THEN_OPERATOR_EXPECTED

public static final int THEN_OPERATOR_EXPECTED

ELSE_OPERATOR_EXPECTED

public static final int ELSE_OPERATOR_EXPECTED

THEN_OPERATOR_WITHOUT_IF_OPERATOR

public static final int THEN_OPERATOR_WITHOUT_IF_OPERATOR

ELSE_OPERATOR_WITHOUT_IF_THEN_OPERATORS

public static final int ELSE_OPERATOR_WITHOUT_IF_THEN_OPERATORS
Constructor Detail

CompilationException

public CompilationException(int errorNumber,
                            int characterIndex)
Creates a compilation exception with a message describing this exception.
Parameters:
errorNumber - the detected error (one of the contants of this class).
characterIndex - the character index in the parsed string where the error was detected.

CompilationException

public CompilationException(int errorNumber,
                            int characterIndex,
                            java.lang.String extractedString)
Creates a compilation exception with a message describing this exception.
Parameters:
errorNumber - the detected error (one of the contants of this class).
characterIndex - the character index in the parsed string where the error was detected.
extractedString - the invalid string.
Method Detail

getError

public java.lang.String getError()
Returns the description of this exception.
Returns:
a string describing this exception.

getErrorNumber

public int getErrorNumber()
Returns the number of the error of this exception.
Returns:
the number of the error of this exception (one of of the contants of this class).

getCharacterIndex

public int getCharacterIndex()
Returns the character index in the parsed string where the error happened.
Returns:
the character index of this exception.

getExtractedString

public java.lang.String getExtractedString()
Returns the invalid string (an invalid identifier or an other string) of this exception.
Returns:
the invalid string or null if no string is involved for this exception.

&cp; 1998-2003 eTeks - All rights reserved