Class Token

java.lang.Object
org.praxislive.core.syntax.Token

public class Token extends Object
This class represents the basic tokens of the Praxis script format.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Token(Token.Type type, String text, int startIndex, int endIndex)
    Create a Token of the specified type.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the end index (exclusive) of this token's position in the script.
    int
    Get the start index (inclusive) for this token's position in the script.
    Get the tokenized text (all escape sequences will have been parsed if required by the token type)
    Get the type of this token.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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:
    • toString

      public String toString()
      Overrides:
      toString in class Object