private int evaluateMethodInvocation(EvaluationContext context,
MethodDeclaration mi) {
FrameContext frame = new FrameContext();
context.push(frame);
VariableContext arguments = new VariableContext();
frame.push(arguments);
IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager()
.getAdapter(mi, IEvaluator.class);
int ret = evaluator.evaluate(context);
frame = context.popup();
Object result = frame.getResult();
switch (ret) {
case THROW:
context.peek().setResult(result);
return THROW;
case RETURN:
return OK;
}
frame = context.peek();
VariableContext varCtx = frame.peek();
Stack<Object> stack = varCtx.getStack();
stack.addElement(result);
return OK;
}