public static interface Token.Type
Represents the type of the token, with a given type code and type name.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcode()Return the type code, which uniquely identifies the token type.name()Return the name of the token.static <V> Token.TypeCreate a new token type with the givencodeandname.token(char c) Create a new token of the given character andthistype.default <V> Token<V>token(V value) Create a new token of the givenvalueandthistype.
-
Field Details
-
EOF
The common end of file token type.
-
-
Method Details
-
code
int code()Return the type code, which uniquely identifies the token type.- Returns:
- the code of the token type
-
name
Return the name of the token.- Returns:
- the name of the token
-
token
Create a new token of the givenvalueandthistype.- Parameters:
value- the token value- Returns:
- a new toke
- Throws:
NullPointerException- if the givenvalueisnull
-
token
Create a new token of the given character andthistype.- Parameters:
c- the token value- Returns:
- a new toke
-
of
Create a new token type with the givencodeandname.- Parameters:
code- the code of the created token typename- the name of the created token type- Returns:
- a new token type
- Throws:
NullPointerException- if the givennameisnull
-