Class Token
java.lang.Object
mars.venus.editors.jeditsyntax.tokenmarker.Token
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.- Version:
- $Id: Token.java,v 1.12 1999/12/13 03:40:30 sp Exp $
- Author:
- Slava Pestov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic byteComment 1 token id.static byteComment 2 token id.static byteThe token type, that along with a length of 0 marks the end of the token list.byteThe id of this token.static byteThe total number of defined token ids.static byteThe first id that can be used for internal state in a token marker.static byteThe last id that can be used for internal state in a token marker.static byteInvalid token id.static byteKeyword 1 token id.static byteKeyword 2 token id.static byteKeyword 3 token id.static byteLabel token id.intThe length of this token.static byteLiteral 1 token id.static byteLiteral 2 token id.static byteMacro parameter token.The next token in the linked list.static byteNormal text token id.static byteOperator token id. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NULL
public static final byte NULLNormal text token id. This should be used to mark normal text.- See Also:
- Constant Field Values
-
COMMENT1
public static final byte COMMENT1Comment 1 token id. This can be used to mark a comment.- See Also:
- Constant Field Values
-
COMMENT2
public static final byte COMMENT2Comment 2 token id. This can be used to mark a comment.- See Also:
- Constant Field Values
-
LITERAL1
public static final byte LITERAL1Literal 1 token id. This can be used to mark a string literal (eg, C mode uses this to mark "..." literals)- See Also:
- Constant Field Values
-
LITERAL2
public static final byte LITERAL2Literal 2 token id. This can be used to mark an object literal (eg, Java mode uses this to mark true, false, etc)- See Also:
- Constant Field Values
-
LABEL
public static final byte LABELLabel token id. This can be used to mark labels (eg, C mode uses this to mark ...: sequences)- See Also:
- Constant Field Values
-
KEYWORD1
public static final byte KEYWORD1Keyword 1 token id. This can be used to mark a keyword. This should be used for general language constructs.- See Also:
- Constant Field Values
-
KEYWORD2
public static final byte KEYWORD2Keyword 2 token id. This can be used to mark a keyword. This should be used for preprocessor commands, or variables.- See Also:
- Constant Field Values
-
KEYWORD3
public static final byte KEYWORD3Keyword 3 token id. This can be used to mark a keyword. This should be used for data types.- See Also:
- Constant Field Values
-
OPERATOR
public static final byte OPERATOROperator token id. This can be used to mark an operator. (eg, SQL mode marks * +, -, etc with this token type)- See Also:
- Constant Field Values
-
INVALID
public static final byte INVALIDInvalid token id. This can be used to mark invalid or incomplete tokens, so the user can easily spot syntax errors.- See Also:
- Constant Field Values
-
MACRO_ARG
public static final byte MACRO_ARGMacro parameter token. Added for MARS 4.3.- See Also:
- Constant Field Values
-
ID_COUNT
public static final byte ID_COUNTThe total number of defined token ids.- See Also:
- Constant Field Values
-
INTERNAL_FIRST
public static final byte INTERNAL_FIRSTThe first id that can be used for internal state in a token marker.- See Also:
- Constant Field Values
-
INTERNAL_LAST
public static final byte INTERNAL_LASTThe last id that can be used for internal state in a token marker.- See Also:
- Constant Field Values
-
END
public static final byte ENDThe token type, that along with a length of 0 marks the end of the token list.- See Also:
- Constant Field Values
-
length
public int lengthThe length of this token. -
id
public byte idThe id of this token. -
next
The next token in the linked list.
-
-
Constructor Details
-
Token
public Token(int length, byte id)Creates a new token.- Parameters:
length- The length of the tokenid- The id of the token
-
-
Method Details