protected static class AbstractLexer.DefaultLexerToken extends java.lang.Object implements LexerToken
DefaultLexerToken just implements a basic
LexerToken which stores a token and start/end offsets.| Modifier and Type | Field and Description |
|---|---|
protected int |
endOffset
The ending offset in the text buffer of this token.
|
protected int |
startOffset
The starting offset in the text buffer of this token.
|
protected int |
token
The token that was found.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultLexerToken() |
| Modifier and Type | Method and Description |
|---|---|
int |
getEndOffset()
Fetches the end offset of the token (offset relative to the original
ReadTextBuffer being lexed. |
int |
getStartOffset()
Fetches the start offset of the token (offset relative to the
original
ReadTextBuffer being lexed. |
int |
getToken()
Fetches the (language-specific) token represented by this
LexerToken. |
void |
setEndOffset(int end)
Sets the end offset for this token.
|
void |
setStartOffset(int start)
Sets the starting offset for this token.
|
void |
setToken(int token)
Set the token of this object.
|
protected int token
protected int startOffset
protected int endOffset
public int getToken()
LexerToken. You must refer to the language-specific
Lexer that was responsible for filling this
LexerToken instance to interpret the token.getToken in interface LexerTokenpublic void setToken(int token)
token - the token to setpublic int getStartOffset()
ReadTextBuffer being lexed. Note that the
start offset is inclusive (compare to end offset which is
exclusive), to match the behavior in the String
class.getStartOffset in interface LexerTokenpublic void setStartOffset(int start)
start - the starting offsetpublic int getEndOffset()
ReadTextBuffer being lexed. Note that the end offset is
exclusive (similar to end offsets in the String class.)getEndOffset in interface LexerTokenpublic void setEndOffset(int end)
end - the ending offset