|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A token, which is a part of a parsed text.
A token is a leaf of an abstract syntax tree.
Method Summary | |
int |
getColumn()
Returns the one-based column number in the source where this token begins. |
String |
getImage()
Returns the string this token corresponds to. |
int |
getIndex()
Returns the zero-based index number in the source where this token begins. |
int |
getLine()
Returns the one-based line number in the source where this token begins. |
String |
getSourceName()
Returns the source name this token coressponds to. |
int |
getSymbolID()
Returns the kind of this token. |
String |
toString()
Returns the image and the parenthesized position of this token if supported. |
Methods inherited from interface parser.ExpressionParser.Node |
accept, getChildNodes, getParentNode, setParentNode |
Method Detail |
public int getSymbolID()
this
token.
The result value should be one of the followings:
value | described token |
---|---|
EOF_TOKEN |
<EOF> |
TOKEN_WHITE_SPACES |
WHITE_SPACES |
TOKEN_TRADITIONAL_COMMENT |
TRADITIONAL_COMMENT |
TOKEN_END_OF_LINE_COMMENT |
END_OF_LINE_COMMENT |
TOKEN_INTEGER |
INTEGER |
5 |
"(" |
6 |
")" |
7 |
"*" |
8 |
"+" |
9 |
"-" |
10 |
"/" |
this
token.public String getImage()
this
token corresponds to.
this
token corresponds to.public String getSourceName() throws UnsupportedOperationException
this
token coressponds to.
this
token coressponds to. E.g. the canonical name of the file.
UnsupportedOperationException
- if the method is not suported.public int getIndex() throws UnsupportedOperationException
this
token begins.
this
token begins.
UnsupportedOperationException
- if the method is not suported.public int getLine() throws UnsupportedOperationException
this
token begins.
this
token begins.
UnsupportedOperationException
- if the method is not suported.public int getColumn() throws UnsupportedOperationException
this
token begins.
this
token begins.
UnsupportedOperationException
- if the method is not suported.public String toString()
this
token if supported.
E.g. "'identifier' (line 2, column 3)"
or "'identifier'"
.
toString
in class Object
this
token.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |