|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.metasyntactic.math.automata.tool.BaseToken
The most basic token that a lexical analyzer can pass to the parser. This class should be subclassed to add functionality such as: Keyword, Storing
| Field Summary | |
protected java.util.List |
lexeme
The actual elements matched |
protected int |
location
The position in the original input where the first element of the lexeme was matched |
protected RegularExpression |
pattern
The pattern that matched this token |
| Constructor Summary | |
protected |
BaseToken()
Only for subclasses to call |
|
BaseToken(RegularExpression pattern,
java.util.List lexeme,
int location)
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Token t)
|
java.util.List |
getLexeme()
|
int |
getLocation()
|
RegularExpression |
getPattern()
|
int |
hashCode()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected RegularExpression pattern
protected java.util.List lexeme
protected int location
| Constructor Detail |
protected BaseToken()
public BaseToken(RegularExpression pattern,
java.util.List lexeme,
int location)
| Method Detail |
public RegularExpression getPattern()
getPattern in interface Tokenpublic java.util.List getLexeme()
getLexeme in interface Tokenpublic int getLocation()
getLocation in interface Tokenpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean equals(Token t)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||