public class Token
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
COMMENT1 |
static byte |
COMMENT2 |
static byte |
COMMENT3 |
static byte |
COMMENT4 |
static byte |
DIGIT |
static byte |
END |
static byte |
FUNCTION |
byte |
id
The id of this token.
|
static byte |
ID_COUNT |
static byte |
INVALID |
static byte |
KEYWORD1 |
static byte |
KEYWORD2 |
static byte |
KEYWORD3 |
static byte |
KEYWORD4 |
static byte |
LABEL |
int |
length
The length of this token.
|
static byte |
LITERAL1 |
static byte |
LITERAL2 |
static byte |
LITERAL3 |
static byte |
LITERAL4 |
static byte |
MARKUP |
Token |
next
The next token in the linked list.
|
static byte |
NULL |
int |
offset
The start offset of this token.
|
static byte |
OPERATOR |
ParserRuleSet |
rules
The rule set of this token.
|
static java.lang.String[] |
TOKEN_TYPES |
Constructor and Description |
---|
Token(byte id,
int offset,
int length,
ParserRuleSet rules)
Creates a new token.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isCommentOrLiteral(byte id) |
static byte |
stringToToken(java.lang.String value)
Converts a token type string to a token type constant.
|
static java.lang.String |
tokenToString(byte token)
Converts a token type constant to a token type string.
|
java.lang.String |
toString()
Returns a string representation of this token.
|
public static final java.lang.String[] TOKEN_TYPES
public static final byte NULL
public static final byte COMMENT1
public static final byte COMMENT2
public static final byte COMMENT3
public static final byte COMMENT4
public static final byte DIGIT
public static final byte FUNCTION
public static final byte INVALID
public static final byte KEYWORD1
public static final byte KEYWORD2
public static final byte KEYWORD3
public static final byte KEYWORD4
public static final byte LABEL
public static final byte LITERAL1
public static final byte LITERAL2
public static final byte LITERAL3
public static final byte LITERAL4
public static final byte MARKUP
public static final byte OPERATOR
public static final byte ID_COUNT
public static final byte END
public byte id
public int offset
public int length
public ParserRuleSet rules
public Token next
public Token(byte id, int offset, int length, ParserRuleSet rules)
id
- The id of the tokenoffset
- The start offset of the tokenlength
- The length of the tokenrules
- The parser rule set that generated this tokenpublic static byte stringToToken(java.lang.String value)
value
- The token typepublic static java.lang.String tokenToString(byte token)
public java.lang.String toString()
toString
in class java.lang.Object
public static boolean isCommentOrLiteral(byte id)