Absimpa v196

absimpa
Class ParseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by absimpa.ParseException
All Implemented Interfaces:
java.io.Serializable

public class ParseException
extends java.lang.Exception

The parser may throw a ParseException, but it does not create it itself. Rather it will call Lexer.parseException(Set) to rely on the lexer to create it with the necessary bits of information.

Strictly speaking this exception should be yet another generic parameter to all the classes in this package, but that would make writing code that uses them even more ugly.

See Also:
Serialized Form

Constructor Summary
ParseException(java.util.Set<?> expected, java.lang.Enum<?> found)
           
 
Method Summary
 int getColumn()
           
 java.util.Set<?> getExpectedTokenCodes()
           
 java.lang.Enum<?> getFoundTokenCode()
           
 int getLine()
           
 java.lang.String getMessage()
          creates a message from the fields set in this exception.
 java.lang.String getMoreInfo()
           
 java.lang.String getSourceName()
           
 java.lang.String getTokenText()
           
 void setColumn(int column)
           set number of the input column within the input line on which the parse error occurred.
 void setLine(int line)
           set number of the input line (or anything resembling a line) on which the parse error occurred.
 void setMoreInfo(java.lang.String moreInfo)
           
 void setSourceName(java.lang.String sourceName)
           set the name of the source from which the line with the parse error was read.
 void setTokenText(java.lang.String tokenText)
          sets a string representation of the token that caused the error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParseException

public ParseException(java.util.Set<?> expected,
                      java.lang.Enum<?> found)
Method Detail

getMessage

public java.lang.String getMessage()
creates a message from the fields set in this exception.

Overrides:
getMessage in class java.lang.Throwable

getExpectedTokenCodes

public java.util.Set<?> getExpectedTokenCodes()

getFoundTokenCode

public java.lang.Enum<?> getFoundTokenCode()

getColumn

public int getColumn()

setColumn

public void setColumn(int column)

set number of the input column within the input line on which the parse error occurred.


getLine

public int getLine()

setLine

public void setLine(int line)

set number of the input line (or anything resembling a line) on which the parse error occurred.


getSourceName

public java.lang.String getSourceName()

setSourceName

public void setSourceName(java.lang.String sourceName)

set the name of the source from which the line with the parse error was read.


getTokenText

public java.lang.String getTokenText()

setTokenText

public void setTokenText(java.lang.String tokenText)

sets a string representation of the token that caused the error.


setMoreInfo

public void setMoreInfo(java.lang.String moreInfo)

getMoreInfo

public java.lang.String getMoreInfo()

Absimpa v196