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.ObjectA linked list of syntax tokens.
-
-
Field Summary
Fields Modifier and Type Field Description static byteCOMMENT1static byteCOMMENT2static byteCOMMENT3static byteCOMMENT4static byteDIGITstatic byteENDstatic byteFUNCTIONbyteidThe id of this token.static byteID_COUNTstatic byteINVALIDstatic byteKEYWORD1static byteKEYWORD2static byteKEYWORD3static byteKEYWORD4static byteLABELintlengthThe length of this token.static byteLITERAL1static byteLITERAL2static byteLITERAL3static byteLITERAL4static byteMARKUPTokennextThe next token in the linked list.static byteNULLintoffsetThe start offset of this token.static byteOPERATORParserRuleSetrulesThe 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 booleanisCommentOrLiteral(byte id)static bytestringToToken(java.lang.String value)Converts a token type string to a token type constant.static java.lang.StringtokenToString(byte token)Converts a token type constant to a token type string.java.lang.StringtoString()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:
toStringin classjava.lang.Object
-
isCommentOrLiteral
public static boolean isCommentOrLiteral(byte id)
- Returns:
- true for COMMENTx and LITERALx tokens
-
-