- All Known Implementing Classes:
EscapedToken
,SimpleToken
,TokenGroup
public interface Token
Interface for a token.
A token is a sequence of characters that matches a token definition.
The implementations of this interface serve as a value for a token definition.
A token is a sequence of characters that matches a token definition.
The implementations of this interface serve as a value for a token definition.
-
Method Summary
Modifier and TypeMethodDescription@NotNull TokenDefinition
Returns the token definition that this token matches.@NotNull TokenPosition
Returns the end position of the token.
The end position is the last character of the token.@NotNull TokenPosition
Returns the start position of the token.
The start position is the first character of the token.@NotNull String
value()
Returns the value of the token.
-
Method Details
-
definition
Returns the token definition that this token matches.- Returns:
- The token definition
-
value
Returns the value of the token.- Returns:
- The value
-
startPosition
Returns the start position of the token.
The start position is the first character of the token.- Returns:
- The start position
- API Note:
- In the case of a single character token, the start and end position are the same.
-
endPosition
Returns the end position of the token.
The end position is the last character of the token.- Returns:
- The end position
- API Note:
- In the case of a single character token, the start and end position are the same.
-