|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.Expression
public class Expression
This class handles Tcl expressions.
Field Summary | |
---|---|
static int |
AND
|
static int |
BIT_AND
|
static int |
BIT_NOT
|
static int |
BIT_OR
|
static int |
BIT_XOR
|
static int |
CLOSE_PAREN
|
static int |
COLON
|
static int |
COMMA
|
static int |
DIVIDE
|
static int |
END
|
static int |
EQUAL
|
static int |
GEQ
|
static int |
GREATER
|
static int |
LEFT_SHIFT
|
static int |
LEQ
|
static int |
LESS
|
HashMap<String,tcl.lang.MathFunction> |
mathFuncTable
Maps name of function to its implementation |
static int |
MINUS
|
static int |
MOD
|
static int |
MULT
|
static int |
NEQ
|
static int |
NOT
|
static int |
OPEN_PAREN
|
static String[] |
operatorStrings
Mapping from operator numbers to strings; used for error messages. |
static int |
OR
|
static int |
PLUS
|
static int[] |
precTable
Precedence table. |
static int |
QUESTY
|
static int |
RIGHT_SHIFT
|
static int |
STREQ
|
static int |
STRNEQ
|
static int |
UNARY_MINUS
|
static int |
UNARY_PLUS
|
static int |
UNKNOWN
|
static int |
VALUE
|
Constructor Summary | |
---|---|
Expression()
Constructor. |
Method Summary | |
---|---|
static void |
evalBinaryOperator(Interp interp,
int operator,
ExprValue value,
ExprValue value2)
|
boolean |
evalBoolean(Interp interp,
String string)
Evaluate an Tcl expression. |
void |
evalMathFunction(Interp interp,
String funcName,
ExprValue[] values,
boolean releaseValues,
ExprValue result)
This procedure will lookup and invoke a math function given the name of the function and an array of ExprValue arguments. |
void |
evalSetResult(Interp interp,
String string)
Evaluate a Tcl expression and set the interp result to the value. |
static void |
evalUnaryOperator(Interp interp,
int operator,
ExprValue value)
|
static void |
ExprParseObject(Interp interp,
TclObject obj,
ExprValue value)
Given a TclObject, such as the result of a command or variable evaluation, fill in a ExprValue with the parsed result. |
static void |
ExprParseString(Interp interp,
TclObject obj,
ExprValue value)
TclParseNumber -> ExprParseString Given a TclObject that contains a String to be parsed (from a command or variable subst), fill in an ExprValue based on the string's numeric value. |
ExprValue |
grabExprValue()
|
static void |
IntegerTooLarge(Interp interp)
|
static boolean |
looksLikeInt(String s,
int len,
int i,
boolean whole)
This procedure decides whether the leading characters of a string look like an integer or something else (such as a floating-point number or string). |
void |
releaseExprValue(ExprValue val)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VALUE
public static final int OPEN_PAREN
public static final int CLOSE_PAREN
public static final int COMMA
public static final int END
public static final int UNKNOWN
public static final int MULT
public static final int DIVIDE
public static final int MOD
public static final int PLUS
public static final int MINUS
public static final int LEFT_SHIFT
public static final int RIGHT_SHIFT
public static final int LESS
public static final int GREATER
public static final int LEQ
public static final int GEQ
public static final int EQUAL
public static final int NEQ
public static final int BIT_AND
public static final int BIT_XOR
public static final int BIT_OR
public static final int AND
public static final int OR
public static final int QUESTY
public static final int COLON
public static final int STREQ
public static final int STRNEQ
public static final int UNARY_MINUS
public static final int UNARY_PLUS
public static final int NOT
public static final int BIT_NOT
public static int[] precTable
public static String[] operatorStrings
public HashMap<String,tcl.lang.MathFunction> mathFuncTable
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public void evalSetResult(Interp interp, String string) throws TclException
interp
- the context in which to evaluate the expression.string
- expression to evaluate.
TclException
- for malformed expressions.public boolean evalBoolean(Interp interp, String string) throws TclException
interp
- the context in which to evaluate the expression.string
- expression to evaluate.
TclException
- for malformed expressions.public static void IntegerTooLarge(Interp interp) throws TclException
TclException
public static void ExprParseObject(Interp interp, TclObject obj, ExprValue value) throws TclException
TclException
public static void ExprParseString(Interp interp, TclObject obj, ExprValue value)
interp
- the context in which to evaluate the expression.obj
- the TclObject containing the string to parse.value
- the ExprValue object to save the parsed value in.public static void evalUnaryOperator(Interp interp, int operator, ExprValue value) throws TclException
TclException
public static void evalBinaryOperator(Interp interp, int operator, ExprValue value, ExprValue value2) throws TclException
TclException
public void evalMathFunction(Interp interp, String funcName, ExprValue[] values, boolean releaseValues, ExprValue result) throws TclException
TclException
public static boolean looksLikeInt(String s, int len, int i, boolean whole)
public final ExprValue grabExprValue()
public final void releaseExprValue(ExprValue val)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |