java.lang.Object
org.praxislive.core.syntax.Token
This class represents the basic tokens of the Praxis script format.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionToken(Token.Type type, String text, int startIndex, int endIndex) Create a Token of the specified type. -
Method Summary
Modifier and TypeMethodDescriptionintGet the end index (exclusive) of this token's position in the script.intGet the start index (inclusive) for this token's position in the script.getText()Get the tokenized text (all escape sequences will have been parsed if required by the token type)getType()Get the type of this token.toString()
-
Constructor Details
-
Token
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
Get the tokenized text (all escape sequences will have been parsed if required by the token type)- Returns:
-
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
-