Class ExceptionToken

All Implemented Interfaces:, Token

public class ExceptionToken
extends java.lang.Exception
implements Token

When the lexical tokenizer cannot match a token, and the input buffer is not empty, then this exception should be thrown. The exception simply contains the position in teh buffer at which the tokenizer could not match any more tokens. Note that "pattern" will be null (as no pattern was matched), and "lexeme" is null (as it is simply the input buffer from "location" to "end")

See Also:
Serialized Form

Constructor Summary
ExceptionToken(int location)
          Creates new ExceptionToken without detail message.
ExceptionToken(java.lang.String msg, int location)
          Constructs an ExceptionToken with the specified detail message.
Method Summary
 java.util.List getLexeme()
 int getLocation()
 RegularExpression getPattern()
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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


public ExceptionToken(int location)
Creates new ExceptionToken without detail message.


public ExceptionToken(java.lang.String msg,
                      int location)
Constructs an ExceptionToken with the specified detail message.

msg - the detail message.
Method Detail


public RegularExpression getPattern()
Specified by:
getPattern in interface Token


public java.util.List getLexeme()
Specified by:
getLexeme in interface Token


public int getLocation()
Specified by:
getLocation in interface Token