| java.lang.Object org.syntax.jedit.tokenmarker.Token
Token | public class Token (Code) | | A linked list of tokens. Each token has three fields - a token
identifier, which is a byte value that can be looked up in the
array returned by SyntaxDocument.getColors()
to get a color value, a length value which is the length of the
token in the text, and a pointer to the next token in the list.
author: Slava Pestov version: $Id$ |
Field Summary | |
final public static byte | COMMENT1 Comment 1 token id. | final public static byte | COMMENT2 Comment 2 token id. | final public static byte | END The token type, that along with a length of 0
marks the end of the token list. | final public static byte | ID_COUNT The total number of defined token ids. | final public static byte | INTERNAL_FIRST The first id that can be used for internal state
in a token marker. | final public static byte | INTERNAL_LAST The last id that can be used for internal state
in a token marker. | final public static byte | INVALID Invalid token id. | final public static byte | KEYWORD1 Keyword 1 token id. | final public static byte | KEYWORD2 Keyword 2 token id. | final public static byte | KEYWORD3 Keyword 3 token id. | final public static byte | LABEL Label token id. | final public static byte | LITERAL1 Literal 1 token id. | final public static byte | LITERAL2 Literal 2 token id. | final public static byte | NULL Normal text token id. | final public static byte | OPERATOR Operator token id. | public byte | id The id of this token. | public int | length The length of this token. | public Token | next The next token in the linked list. |
Constructor Summary | |
public | Token(int length, byte id) Creates a new token. |
Method Summary | |
public String | toString() Returns a string representation of this token. |
COMMENT1 | final public static byte COMMENT1(Code) | | Comment 1 token id. This can be used to mark a comment.
|
COMMENT2 | final public static byte COMMENT2(Code) | | Comment 2 token id. This can be used to mark a comment.
|
END | final public static byte END(Code) | | The token type, that along with a length of 0
marks the end of the token list.
|
ID_COUNT | final public static byte ID_COUNT(Code) | | The total number of defined token ids.
|
INTERNAL_FIRST | final public static byte INTERNAL_FIRST(Code) | | The first id that can be used for internal state
in a token marker.
|
INTERNAL_LAST | final public static byte INTERNAL_LAST(Code) | | The last id that can be used for internal state
in a token marker.
|
INVALID | final public static byte INVALID(Code) | | Invalid token id. This can be used to mark invalid
or incomplete tokens, so the user can easily spot
syntax errors.
|
KEYWORD1 | final public static byte KEYWORD1(Code) | | Keyword 1 token id. This can be used to mark a
keyword. This should be used for general language
constructs.
|
KEYWORD2 | final public static byte KEYWORD2(Code) | | Keyword 2 token id. This can be used to mark a
keyword. This should be used for preprocessor
commands, or variables.
|
KEYWORD3 | final public static byte KEYWORD3(Code) | | Keyword 3 token id. This can be used to mark a
keyword. This should be used for data types.
|
LABEL | final public static byte LABEL(Code) | | Label token id. This can be used to mark labels
(eg, C mode uses this to mark ...: sequences)
|
LITERAL1 | final public static byte LITERAL1(Code) | | Literal 1 token id. This can be used to mark a string
literal (eg, C mode uses this to mark "..." literals)
|
LITERAL2 | final public static byte LITERAL2(Code) | | Literal 2 token id. This can be used to mark an object
literal (eg, Java mode uses this to mark true, false, etc)
|
NULL | final public static byte NULL(Code) | | Normal text token id. This should be used to mark
normal text.
|
OPERATOR | final public static byte OPERATOR(Code) | | Operator token id. This can be used to mark an
operator. (eg, SQL mode marks +, -, etc with this
token type)
|
id | public byte id(Code) | | The id of this token.
|
length | public int length(Code) | | The length of this token.
|
next | public Token next(Code) | | The next token in the linked list.
|
Token | public Token(int length, byte id)(Code) | | Creates a new token.
Parameters: length - The length of the token Parameters: id - The id of the token |
toString | public String toString()(Code) | | Returns a string representation of this token.
|
|
|