org.metasyntactic.math.automata.tool
Class ExceptionToken
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--org.metasyntactic.math.automata.tool.ExceptionToken
- All Implemented Interfaces:
- java.io.Serializable, 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. |
| 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 |
ExceptionToken
public ExceptionToken(int location)
- Creates new
ExceptionToken without detail message.
ExceptionToken
public ExceptionToken(java.lang.String msg,
int location)
- Constructs an
ExceptionToken with the specified detail message.
- Parameters:
msg - the detail message.
getPattern
public RegularExpression getPattern()
- Specified by:
getPattern in interface Token
getLexeme
public java.util.List getLexeme()
- Specified by:
getLexeme in interface Token
getLocation
public int getLocation()
- Specified by:
getLocation in interface Token