Class Token
java.lang.Object
studio.magemonkey.codex.util.eval.javaluator.Token
A token.
When evaluating an expression, it is first split into tokens. These tokens can be operators, constants, etc ...
When evaluating an expression, it is first split into tokens. These tokens can be operators, constants, etc ...
- Author:
- Jean-Marc Astesana
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendTokenInfo(String msg) static TokenbuildArgumentSeparator(String strToken) static TokenbuildCloseToken(BracketPair pair) static TokenbuildFunction(Function function) static TokenbuildLiteral(String literal) static TokenbuildOpenToken(BracketPair pair) static TokenbuildOperator(Operator ope) getKind()intbooleanTests whether the token is a close bracket.booleanTests whether the token is a function.booleanTests whether the token is a function argument separator.booleanTests whether the token is a literal or a constant or a variable name.booleanTests whether the token is an open bracket.booleanTests whether the token is an operator.setLineInfo(String line, int lineNum, int startPosition, int endPosition) toString()
-
Constructor Details
-
Token
-
-
Method Details
-
buildLiteral
-
buildOperator
-
buildFunction
-
buildOpenToken
-
buildCloseToken
-
buildArgumentSeparator
-
appendTokenInfo
-
setLineInfo
-
getBrackets
-
getOperator
-
getFunction
-
getKind
-
getString
-
isOperator
public boolean isOperator()Tests whether the token is an operator.- Returns:
- true if the token is an operator
-
isFunction
public boolean isFunction()Tests whether the token is a function.- Returns:
- true if the token is a function
-
isOpenBracket
public boolean isOpenBracket()Tests whether the token is an open bracket.- Returns:
- true if the token is an open bracket
-
isCloseBracket
public boolean isCloseBracket()Tests whether the token is a close bracket.- Returns:
- true if the token is a close bracket
-
isFunctionArgumentSeparator
public boolean isFunctionArgumentSeparator()Tests whether the token is a function argument separator.- Returns:
- true if the token is a function argument separator
-
isLiteral
public boolean isLiteral()Tests whether the token is a literal or a constant or a variable name.- Returns:
- true if the token is a literal, a constant or a variable name
-
getAssociativity
-
getPrecedence
public int getPrecedence() -
getLiteral
-
toString
-