Package org.gjt.sp.jedit.syntax
Class Token
- java.lang.Object
-
- org.gjt.sp.jedit.syntax.Token
-
- Direct Known Subclasses:
Chunk
public class Token extends java.lang.Object
A linked list of syntax tokens.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description Token(byte id, int offset, int length, ParserRuleSet rules)
Creates a new token.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
TOKEN_TYPES
public static final java.lang.String[] TOKEN_TYPES
-
NULL
public static final byte NULL
- See Also:
- Constant Field Values
-
COMMENT1
public static final byte COMMENT1
- See Also:
- Constant Field Values
-
COMMENT2
public static final byte COMMENT2
- See Also:
- Constant Field Values
-
COMMENT3
public static final byte COMMENT3
- See Also:
- Constant Field Values
-
COMMENT4
public static final byte COMMENT4
- See Also:
- Constant Field Values
-
DIGIT
public static final byte DIGIT
- See Also:
- Constant Field Values
-
FUNCTION
public static final byte FUNCTION
- See Also:
- Constant Field Values
-
INVALID
public static final byte INVALID
- See Also:
- Constant Field Values
-
KEYWORD1
public static final byte KEYWORD1
- See Also:
- Constant Field Values
-
KEYWORD2
public static final byte KEYWORD2
- See Also:
- Constant Field Values
-
KEYWORD3
public static final byte KEYWORD3
- See Also:
- Constant Field Values
-
KEYWORD4
public static final byte KEYWORD4
- See Also:
- Constant Field Values
-
LABEL
public static final byte LABEL
- See Also:
- Constant Field Values
-
LITERAL1
public static final byte LITERAL1
- See Also:
- Constant Field Values
-
LITERAL2
public static final byte LITERAL2
- See Also:
- Constant Field Values
-
LITERAL3
public static final byte LITERAL3
- See Also:
- Constant Field Values
-
LITERAL4
public static final byte LITERAL4
- See Also:
- Constant Field Values
-
MARKUP
public static final byte MARKUP
- See Also:
- Constant Field Values
-
OPERATOR
public static final byte OPERATOR
- See Also:
- Constant Field Values
-
ID_COUNT
public static final byte ID_COUNT
- See Also:
- Constant Field Values
-
END
public static final byte END
- See Also:
- Constant Field Values
-
id
public byte id
The id of this token.
-
offset
public int offset
The start offset of this token.
-
length
public int length
The length of this token.
-
rules
public ParserRuleSet rules
The rule set of this token.
-
next
public Token next
The next token in the linked list.
-
-
Constructor Detail
-
Token
public Token(byte id, int offset, int length, ParserRuleSet rules)
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 Detail
-
stringToToken
public static byte stringToToken(java.lang.String value)
Converts a token type string to a token type constant.- Parameters:
value
- The token type- Since:
- jEdit 4.1pre1
-
tokenToString
public static java.lang.String tokenToString(byte token)
Converts a token type constant to a token type string.- Since:
- jEdit 4.2pre1
-
toString
public java.lang.String toString()
Returns a string representation of this token.- Overrides:
toString
in classjava.lang.Object
-
isCommentOrLiteral
public static boolean isCommentOrLiteral(byte id)
- Returns:
- true for COMMENTx and LITERALx tokens
-
-