private Expression CreateExpressionTreeFromResult(
IEnumerable<Expression> parameters,
ArgumentObject[] arguments,
Scope pScope,
EXPR pResult)
{
// (3) - Place the result in a return statement and create the EXPRBOUNDLAMBDA.
EXPRBOUNDLAMBDA boundLambda = GenerateBoundLambda(arguments, pScope, pResult);
// (4) - Rewrite the EXPRBOUNDLAMBDA into an expression tree.
EXPR exprTree = ExpressionTreeRewriter.Rewrite(boundLambda, _exprFactory, SymbolLoader);
// (5) - Create the actual Expression Tree
Expression e = ExpressionTreeCallRewriter.Rewrite(SymbolLoader.GetTypeManager(), exprTree, parameters);
return e;
}