java.lang.Object
org.gjt.sp.jedit.syntax.Token
- Direct Known Subclasses:
Chunk
A linked list of syntax tokens.
- Version:
- $Id: Token.java 25244 2020-04-15 15:14:49Z kpouer $
- Author:
- Slava Pestov
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
byte
The id of this token.static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
int
The length of this token.static final byte
static final byte
static final byte
static final byte
static final byte
The next token in the linked list.static final byte
int
The start offset of this token.static final byte
The rule set of this token.static final String[]
-
Constructor Summary
ConstructorDescriptionToken
(byte id, int offset, int length, ParserRuleSet rules) Creates a new token. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isCommentOrLiteral
(byte id) static byte
stringToToken
(String value) Converts a token type string to a token type constant.static String
tokenToString
(byte token) Converts a token type constant to a token type string.toString()
Returns a string representation of this token.
-
Field Details
-
TOKEN_TYPES
-
NULL
public static final byte NULL- See Also:
-
COMMENT1
public static final byte COMMENT1- See Also:
-
COMMENT2
public static final byte COMMENT2- See Also:
-
COMMENT3
public static final byte COMMENT3- See Also:
-
COMMENT4
public static final byte COMMENT4- See Also:
-
DIGIT
public static final byte DIGIT- See Also:
-
FUNCTION
public static final byte FUNCTION- See Also:
-
INVALID
public static final byte INVALID- See Also:
-
KEYWORD1
public static final byte KEYWORD1- See Also:
-
KEYWORD2
public static final byte KEYWORD2- See Also:
-
KEYWORD3
public static final byte KEYWORD3- See Also:
-
KEYWORD4
public static final byte KEYWORD4- See Also:
-
LABEL
public static final byte LABEL- See Also:
-
LITERAL1
public static final byte LITERAL1- See Also:
-
LITERAL2
public static final byte LITERAL2- See Also:
-
LITERAL3
public static final byte LITERAL3- See Also:
-
LITERAL4
public static final byte LITERAL4- See Also:
-
MARKUP
public static final byte MARKUP- See Also:
-
OPERATOR
public static final byte OPERATOR- See Also:
-
ID_COUNT
public static final byte ID_COUNT- See Also:
-
END
public static final byte END- See Also:
-
id
public byte idThe id of this token. -
offset
public int offsetThe start offset of this token. -
length
public int lengthThe length of this token. -
rules
The rule set of this token. -
next
The next token in the linked list.
-
-
Constructor Details
-
Token
Creates a new token.- Parameters:
id
- The id of the tokenoffset
- The start offset of the tokenlength
- The length of the tokenrules
- The parser rule set that generated this token
-
-
Method Details
-
stringToToken
Converts a token type string to a token type constant.- Parameters:
value
- The token type- Since:
- jEdit 4.1pre1
-
tokenToString
Converts a token type constant to a token type string.- Since:
- jEdit 4.2pre1
-
toString
Returns a string representation of this token. -
isCommentOrLiteral
public static boolean isCommentOrLiteral(byte id) - Returns:
- true for COMMENTx and LITERALx tokens
-