|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TokenTypes
The TokenTypes interface defines the integer constants representing different types of tokens, for use with any languages. The constants are used in symbols to represent the types of similar tokens, and in scanners as scanner states, and in highlighters to determine the colour or style of tokens. There is also an array typeNames of textual names, indexed by type, for descriptive purposes.
The UNRECOGNIZED constant (zero) is for tokens which are completely unrecognised, usually consisting of a single illegal character. Other error tokens are represented by negative types, where -t represents an incomplete or malformed token of type t. An error token usually consists of the maximal legal substring of the source text.
The WHITESPACE constant is used to classify tokens which are to be discarded, it acts as a suitable scanner state at the beginning of a document, and it is used for the usual end-of-text sentinel token which marks the end of the document. Comments can optionally be classified as WHITESPACE and discarded, if they are not needed for highlighting. No other types besides UNRECOGNIZED and WHITESPACE are treated specially.
The constants are presented as an interface so that any class can implement the interface and use the names of the constants directly, without prefixing them with a class name.
Field Summary | |
---|---|
static int |
BRACKET
|
static int |
CHARACTER
|
static int |
COMMENT
|
static int |
END_COMMENT
|
static int |
END_TAG
|
static int |
IDENTIFIER
|
static int |
KEYWORD
|
static int |
KEYWORD2
|
static int |
LITERAL
|
static int |
MID_COMMENT
|
static int |
NUMBER
|
static int |
OPERATOR
|
static int |
PUNCTUATION
|
static int |
SEPARATOR
|
static int |
START_COMMENT
|
static int |
STRING
|
static int |
TAG
|
static String[] |
typeNames
The names of the token types, indexed by type, are provided for descriptive purposes and for use by properties files. |
static int |
UNRECOGNIZED
|
static int |
URL
|
static int |
WHITESPACE
|
static int |
WORD
|
Field Detail |
---|
static final int UNRECOGNIZED
static final int WHITESPACE
static final int WORD
static final int NUMBER
static final int PUNCTUATION
static final int COMMENT
static final int START_COMMENT
static final int MID_COMMENT
static final int END_COMMENT
static final int TAG
static final int END_TAG
static final int KEYWORD
static final int KEYWORD2
static final int IDENTIFIER
static final int LITERAL
static final int STRING
static final int CHARACTER
static final int OPERATOR
static final int BRACKET
static final int SEPARATOR
static final int URL
static final String[] typeNames
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |