use of net.sourceforge.processdash.data.compiler.Stack in project processdash by dtuma.
the class Eval method call.
/** Perform a procedure call.
*
* This method <b>must</b> be thread-safe.
*/
public Object call(List arguments, ExpressionContext context) {
String expression = asString(getArg(arguments, 0));
if (expression == null || expression.length() == 0)
return null;
String prefix = asString(getArg(arguments, 1));
CompiledScript script = Compiler.compile(expression);
try {
Stack stack = new ListStack();
if (prefix != null)
context = new RelativeExpressionContext(context, prefix);
script.run(stack, context);
return stack.pop();
} catch (ExecutionException ee) {
return null;
}
}
Aggregations