- 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 class
Token.Type
-
Constructor Summary
Constructors Constructor Description Token(Token.Type type, String text, int startIndex, int endIndex)
Create a Token of the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEndIndex()
Get the end index (exclusive) of this token's position in the script.int
getStartIndex()
Get the start index (inclusive) for this token's position in the script.String
getText()
Get the tokenized text (all escape sequences will have been parsed if required by the token type)Token.Type
getType()
Get the type of this token.String
toString()
-
-
-
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:
-
-