示例#1
0
        public static Expression AnalyzeNewExpr(SymplNewExpr expr,
                                                AnalysisScope scope)
        {
            List <Expression> args = new List <Expression>();

            args.Add(AnalyzeExpr(expr.Type, scope));
            args.AddRange(expr.Arguments.Select(a => AnalyzeExpr(a, scope)));

            return(Expression.Dynamic(
                       scope.GetRuntime().GetCreateInstanceBinder(
                           new CallInfo(expr.Arguments.Length)),
                       typeof(object),
                       args
                       ));
        }
示例#2
0
        public static Expression AnalyzeNewExpr(SymplNewExpr expr,
                                                AnalysisScope scope) {

            List<Expression> args = new List<Expression>();
            args.Add(AnalyzeExpr(expr.Type, scope));
            args.AddRange(expr.Arguments.Select(a => AnalyzeExpr(a, scope)));

            return Expression.Dynamic(
                scope.GetRuntime().GetCreateInstanceBinder(
                                     new CallInfo(expr.Arguments.Length)),
                typeof(object),
                args
            );
        }