Interface Token

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.
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Returns the value of the token.
  • Method Details

    • definition

      @NotNull @NotNull TokenDefinition definition()
      Returns the token definition that this token matches.
      Returns:
      The token definition
    • value

      @NotNull @NotNull String value()
      Returns the value of the token.
      Returns:
      The value
    • startPosition

      @NotNull @NotNull TokenPosition 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

      @NotNull @NotNull TokenPosition 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.