public class Token extends Node
Constructor and Description |
---|
Token(TokenPattern pattern,
java.lang.String image,
int line,
int col)
Creates a new token.
|
Modifier and Type | Method and Description |
---|---|
int |
getEndColumn()
The column number of the last character in the token image.
|
int |
getEndLine()
The line number of the last character in the token image.
|
int |
getId()
Returns the token (pattern) id.
|
java.lang.String |
getImage()
Returns the token image.
|
java.lang.String |
getName()
Returns the token node name.
|
Token |
getNextToken()
Returns the next token.
|
Token |
getPreviousToken()
Returns the previuos token.
|
int |
getStartColumn()
The column number of the first character in the token image.
|
int |
getStartLine()
The line number of the first character in the token image.
|
java.lang.String |
toShortString()
Returns a short string representation of this token.
|
java.lang.String |
toString()
Returns a detailed string representation of this token.
|
addValue, addValues, addValues, getAllValues, getChildAt, getChildCount, getDescendantCount, getParent, getValue, getValueCount, printTo, printTo, removeAllValues
public Token(TokenPattern pattern, java.lang.String image, int line, int col)
pattern
- the token patternimage
- the token image (i.e. characters)line
- the line number of the first charactercol
- the column number of the first characterpublic int getId()
public java.lang.String getName()
public java.lang.String getImage()
public int getStartLine()
getStartLine
in class Node
public int getStartColumn()
getStartColumn
in class Node
public int getEndLine()
getEndLine
in class Node
public int getEndColumn()
getEndColumn
in class Node
public Token getPreviousToken()
getNextToken()
,
Tokenizer.getUseTokenList()
,
Tokenizer.setUseTokenList(boolean)
public Token getNextToken()
getPreviousToken()
,
Tokenizer.getUseTokenList()
,
Tokenizer.setUseTokenList(boolean)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toShortString()