Source:
public EvaluationResult call() throws Exception { checkCancelled(); final String expression = context.getExpression(); if (context.getTargetEObjects().isEmpty()) { IStatus errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No target for evaluation of " + expression); return new EvaluationResult(errorStatus); } final EObject target = context.getTargetEObjects().get(0); EObject semanticTarget = target; if (target instanceof DSemanticDecorator) { semanticTarget = ((DSemanticDecorator) target).getTarget(); } Session curSession = SessionManager.INSTANCE.getSession(semanticTarget); final IInterpreter vpInterpreter; if (curSession != null) { vpInterpreter = curSession.getInterpreter(); } else { vpInterpreter = CompoundInterpreter.INSTANCE.getInterpreterForExpression(expression); } assert vpInterpreter != null; checkCancelled(); for (Variable var : context.getVariables()) { vpInterpreter.setVariable(var.getName(), var.getValue()); } EvaluationResult evaluationResult = null; try { final Object result = vpInterpreter.evaluate(target, expression); final IStatus status = createResultStatus(result); if (result instanceof org.eclipse.acceleo.query.runtime.EvaluationResult) { org.eclipse.acceleo.query.runtime.EvaluationResult aqlResult = (org.eclipse.acceleo.query.runtime.EvaluationResult) result; evaluationResult = new EvaluationResult(aqlResult.getResult(), status); } else { evaluationResult = new EvaluationResult(result, status); } } catch (EvaluationException e) { final IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); evaluationResult = new EvaluationResult(status); } assert evaluationResult != null; return evaluationResult; }

Target:
public EvaluationResult call() throws Exception { checkCancelled(); final String expression = context.getExpression(); if (context.getTargetEObjects().isEmpty()) { IStatus errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No target for evaluation of " + expression); return new EvaluationResult(errorStatus); } final EObject target = context.getTargetEObjects().get(0); EObject semanticTarget = target; if (target instanceof DSemanticDecorator) { semanticTarget = ((DSemanticDecorator) target).getTarget(); } Session curSession = SessionManager.INSTANCE.getSession(semanticTarget); final IInterpreter vpInterpreter; if (curSession != null) { vpInterpreter = curSession.getInterpreter(); } else { vpInterpreter = CompoundInterpreter.INSTANCE.getInterpreterForExpression(expression); } assert vpInterpreter != null; checkCancelled(); for (Variable var : context.getVariables()) { vpInterpreter.setVariable(var.getName(), var.getValue()); } EvaluationResult evaluationResult = null; try { if (vpInterpreter instanceof IInterpreter2) { IEvaluationResult result = ((IInterpreter2) vpInterpreter).evaluateExpression(target, expression); final IStatus status = createResultStatus(result); evaluationResult = new EvaluationResult(result.getValue(), status); } else { Object result = vpInterpreter.evaluate(target, expression); final IStatus status = createResultStatus(result); evaluationResult = new EvaluationResult(result, status); } } catch (EvaluationException e) { final IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); evaluationResult = new EvaluationResult(status); } assert evaluationResult != null; return evaluationResult; }