///////////////////////////////////////////////////////////////////////////////// public static Expression Rewrite(ExprBinOp binOp, Expression[] listOfParameters) { ExpressionTreeCallRewriter rewriter = new ExpressionTreeCallRewriter(listOfParameters); // We should have a ExprBinOp that's an EK_SEQUENCE. The RHS of our sequence // should be a call to PM_EXPRESSION_LAMBDA. The LHS of our sequence is the // set of declarations for the parameters that we'll need. // Assert all of these first, and then unwrap them. Debug.Assert(binOp != null); Debug.Assert(binOp.Kind == ExpressionKind.Sequence); Debug.Assert(binOp.OptionalRightChild is ExprCall); Debug.Assert(((ExprCall)binOp.OptionalRightChild).PredefinedMethod == PREDEFMETH.PM_EXPRESSION_LAMBDA); Debug.Assert(binOp.OptionalLeftChild != null); // Visit the left to generate the parameter construction. rewriter.Visit(binOp.OptionalLeftChild); ExprCall call = (ExprCall)binOp.OptionalRightChild; ExpressionExpr e = rewriter.Visit(call) as ExpressionExpr; return(e.Expression); }
public virtual void Visit(ExpressionExpr expr) { }