Class Token


  • public class Token
    extends Object
    This class represents the basic tokens of the Praxis script format.
    • Constructor Detail

      • Token

        public Token​(Token.Type type,
                     String text,
                     int startIndex,
                     int endIndex)
        Create a Token of the specified type. The text should be the tokenized text only, with any escaping already done. The start and end indexes refer to the Token's position in the full-text being tokenized, and not the text of the token itself.
        Parameters:
        type -
        text -
        startIndex -
        endIndex -
    • Method Detail

      • getText

        public String getText()
        Get the tokenized text (all escape sequences will have been parsed if required by the token type)
        Returns:
      • getType

        public Token.Type getType()
        Get the type of this token.
        Returns:
      • getStartIndex

        public int getStartIndex()
        Get the start index (inclusive) for this token's position in the script.
        Returns:
      • getEndIndex

        public int getEndIndex()
        Get the end index (exclusive) of this token's position in the script.
        Returns: