org.wsmo.wsml
Class ParserException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.wsmo.wsml.ParserException
All Implemented Interfaces:
java.io.Serializable

public class ParserException
extends java.lang.Exception

This is a checked exception thrown when the stream being parsed contains syntax errors or is invalid w.r.t. the predefined grammar

Version:
$Revision: 1.7 $ $Date: 2005/10/17 14:57:00 $
Author:
not attributable
See Also:
Serialized Form

Field Summary
static java.lang.String ANONYMOUS_ID_AS_ATOM
           
private  java.lang.String expectedToken
           
private  java.lang.String foundToken
           
static java.lang.String FUNCTION_SYMBOL_AS_ATOM
           
private  int line
           
static java.lang.String NAMESPACE_PREFIX_NOT_FOUND
           
static java.lang.String NB_ANONYMOUS_ID_AS_ATOM
           
static java.lang.String NO_NAMESPACE
           
static java.lang.String NOT_VALID_PARSETREE
           
private  int pos
           
private static long serialVersionUID
           
static java.lang.String VALUE_AS_ATOM
           
static java.lang.String VARIABLE_AS_ATOM
           
static java.lang.String WRONG_ARG_SIMPLE_DT
           
 
Constructor Summary
ParserException(java.lang.String msg, java.lang.Throwable cause)
          Creates a Parser Exception indicating a problem found when processing an InputStream.
 
Method Summary
 int getErrorLine()
          Indicates the line where the parsing error occured.
 int getErrorPos()
          inicates the position where the parsing error occured.
 java.lang.String getExpectedToken()
          Indicates which token was expecting when parsing error occured
 java.lang.String getFoundToken()
          returns the token that was expected.
 java.lang.String getMessage()
          Returns human readable description of error.
 void setErrorLine(int line)
          Sets the line where the error occured.
 void setErrorPos(int pos)
          sets the position (column) where the error occured.
 void setExpectedToken(java.lang.String token)
          sets the token that was expected when parsing error occured.
 void setFoundToken(java.lang.String token)
          set the token that was found during parsing.
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

NO_NAMESPACE

public static final java.lang.String NO_NAMESPACE
See Also:
Constant Field Values

NAMESPACE_PREFIX_NOT_FOUND

public static final java.lang.String NAMESPACE_PREFIX_NOT_FOUND
See Also:
Constant Field Values

NOT_VALID_PARSETREE

public static final java.lang.String NOT_VALID_PARSETREE
See Also:
Constant Field Values

ANONYMOUS_ID_AS_ATOM

public static final java.lang.String ANONYMOUS_ID_AS_ATOM
See Also:
Constant Field Values

NB_ANONYMOUS_ID_AS_ATOM

public static final java.lang.String NB_ANONYMOUS_ID_AS_ATOM
See Also:
Constant Field Values

VALUE_AS_ATOM

public static final java.lang.String VALUE_AS_ATOM
See Also:
Constant Field Values

FUNCTION_SYMBOL_AS_ATOM

public static final java.lang.String FUNCTION_SYMBOL_AS_ATOM
See Also:
Constant Field Values

VARIABLE_AS_ATOM

public static final java.lang.String VARIABLE_AS_ATOM
See Also:
Constant Field Values

WRONG_ARG_SIMPLE_DT

public static final java.lang.String WRONG_ARG_SIMPLE_DT
See Also:
Constant Field Values

line

private int line

pos

private int pos

expectedToken

private java.lang.String expectedToken

foundToken

private java.lang.String foundToken
Constructor Detail

ParserException

public ParserException(java.lang.String msg,
                       java.lang.Throwable cause)
Creates a Parser Exception indicating a problem found when processing an InputStream.

Parameters:
msg - message indicating the error that occured. Note that this class appends some exta information (if given) like the line and position of the error when "getMessage()" is called.
cause - the initial cause of the error. In case the problem is caused by the underlying parser (e.g. sableCC it will contain this Exception
Method Detail

getErrorLine

public int getErrorLine()
Indicates the line where the parsing error occured.

Returns:
line with parsing error or -1 if not known.

setErrorLine

public void setErrorLine(int line)
Sets the line where the error occured.

Parameters:
line - where the error occured.

getErrorPos

public int getErrorPos()
inicates the position where the parsing error occured.

Returns:
position where parsing error occured or -1 if not known.

setErrorPos

public void setErrorPos(int pos)
sets the position (column) where the error occured.

Parameters:
pos - of error.

getFoundToken

public java.lang.String getFoundToken()
returns the token that was expected.

Returns:
the token that was expected or null if not known.

setFoundToken

public void setFoundToken(java.lang.String token)
set the token that was found during parsing.

Parameters:
token - the token that was found during parsing.

getExpectedToken

public java.lang.String getExpectedToken()
Indicates which token was expecting when parsing error occured

Returns:
list of token (comma sperated) that are expecting at the position with parsing error, null if not known.

setExpectedToken

public void setExpectedToken(java.lang.String token)
sets the token that was expected when parsing error occured.

Parameters:
token - the toke that was expected when parsing error occured.

getMessage

public java.lang.String getMessage()
Returns human readable description of error.

Overrides:
getMessage in class java.lang.Throwable
Returns:
message indicating the error that occured. Note that this class appends some exta information (if given) like the line and position of the error when "getMessage()" is called.
See Also:
Throwable.getMessage()