public static interface Token.Type
Represents the type of the token, with a given type code and type name.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
code()
Return the type code, which uniquely identifies the token type.name()
Return the name of the token.static <V> Token.Type
Create a new token type with the givencode
andname
.token
(char c) Create a new token of the given character andthis
type.default <V> Token<V>
token
(V value) Create a new token of the givenvalue
andthis
type.
-
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 givenvalue
andthis
type.- Parameters:
value
- the token value- Returns:
- a new toke
- Throws:
NullPointerException
- if the givenvalue
isnull
-
token
Create a new token of the given character andthis
type.- Parameters:
c
- the token value- Returns:
- a new toke
-
of
Create a new token type with the givencode
andname
.- 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 givenname
isnull
-