|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.grammatica.parser.Node | +--net.percederberg.grammatica.parser.Token
A token node. This class represents a token (i.e. a set of adjacent characters) in a parse tree. The tokens are created by a tokenizer, that groups characters together into tokens according to a set of token patterns.
Constructor Summary | |
Token(TokenPattern pattern,
java.lang.String image,
int line,
int col)
Creates a new token. |
Method Summary | |
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 (i.e. the characters). |
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. |
Methods inherited from class net.percederberg.grammatica.parser.Node |
addValue, addValues, getAllValues, getChildAt, getChildCount, getParent, getValue, getValueCount, printTo, printTo, removeAllValues |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
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 characterMethod Detail |
public int getId()
getId
in class Node
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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toShortString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |