Esempio n. 1
0
        public EmitSyntax Ld(EmitSyntax emit, Pipe <EmitSyntax> ldFrom)
        {
            // Load start value
            emit = ldFrom(emit);

            foreach (var getter in path)
            {
                emit = emit.Call(getter);
            }

            return(emit);
        }
Esempio n. 2
0
        public static EmitSyntax Call(this EmitSyntax emit, SR.MethodInfo method)
        {
            var methodRef = emit.Methods.Import(method);

            if (method.IsStatic)
            {
                return(emit.Call(methodRef));
            }
            else
            {
                return(emit.Callvirt(methodRef));
            }
        }
Esempio n. 3
0
 public static EmitSyntax PrintStrLn(this EmitSyntax emit)
 {
     return(emit.Call((string x) => Console.WriteLine(x)));
 }
Esempio n. 4
0
 public static EmitSyntax PrintIntLn(this EmitSyntax emit)
 {
     return(emit.Call((int x) => Console.WriteLine(x)));
 }
Esempio n. 5
0
 public static EmitSyntax Print(this EmitSyntax emit)
 {
     return(emit.Call((object x) => Console.Write(x)));
 }
Esempio n. 6
0
        public static EmitSyntax CallFromLambda(this EmitSyntax emit, LambdaExpression callExpr)
        {
            var method = ExpressionUtils.GetMethodFromLambda(callExpr);

            return(emit.Call(method));
        }
Esempio n. 7
0
        public static EmitSyntax Stprop <T, R>(this EmitSyntax emit, Expression <Func <T, R> > expr)
        {
            var property = ExpressionUtils.GetProperty(expr);

            return(emit.Call(property.GetSetMethod()));
        }