Class MathExpression.Token
java.lang.Object
com.github.gbenroscience.parser.MathExpression.Token
- All Implemented Interfaces:
Savable,Serializable
- Enclosing class:
MathExpression
-
Field Summary
FieldsModifier and TypeFieldDescriptionintstatic final charstatic final intintThe slot in the execution frame where this token's value lives.static final intstatic final intstatic final intintstatic final charbooleanbooleanbooleanintstatic final intstatic final intstatic final intstatic final intcharstatic final intintstatic final intdoublestatic final int -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CBRT_DEF
public static final char CBRT_DEF- See Also:
-
INVERSE_DEF
public static final char INVERSE_DEF- See Also:
-
NUMBER
public static final int NUMBER- See Also:
-
OPERATOR
public static final int OPERATOR- See Also:
-
FUNCTION
public static final int FUNCTION- See Also:
-
METHOD
public static final int METHOD- See Also:
-
LPAREN
public static final int LPAREN- See Also:
-
RPAREN
public static final int RPAREN- See Also:
-
COMMA
public static final int COMMA- See Also:
-
MATRIX
public static final int MATRIX- See Also:
-
VARIABLE
public static final int VARIABLE- See Also:
-
FUNCTION_HANDLE
public static final int FUNCTION_HANDLE- See Also:
-
FUNCTION_HANDLE_UNDEFINED
public static final int FUNCTION_HANDLE_UNDEFINED- See Also:
-
kind
public int kind -
value
public double value -
name
-
frameIndex
public int frameIndexThe slot in the execution frame where this token's value lives. Used only when kind == NUMBER or VARIABLE and it represents a variable. -
v
-
m
-
id
public int id -
opChar
public char opChar -
precedence
public int precedence -
isRightAssoc
public boolean isRightAssoc -
isPostfix
public boolean isPostfix -
arity
public int arity -
assignToName
-
isAssignmentTarget
public boolean isAssignmentTarget
-
-
Constructor Details
-
Token
public Token(double value) -
Token
-
Token
Constructor for Function Handles. Used to pass references of functions as arguments to higher-order functions. e.g., in f(x)=x^3*sin(x); diff(f,1,1), 'f' is the function handle. In certain contexts, a function handle is passed to a method but it has not being defined anywhere. This method after it runs will create the function from the passed undefined handle and automatically store it. A good example is the diff method.- Parameters:
fn- The name of the function being referenced.
-
Token
-
Token
public Token(char opChar, int precedence, boolean isRightAssoc, boolean isPostfix) -
Token
-
Token
public Token(int kind) -
Token
-
-
Method Details