public CodegenExpression CodegenPremade(
     Type evaluationType,
     CodegenExpression input,
     Type inputType,
     CodegenMethodScope codegenMethodScope,
     ExprForgeCodegenSymbol exprSymbol,
     CodegenClassScope codegenClassScope)
 {
     return(parser.Codegen(input));
 }
예제 #2
0
        public CodegenExpression InitCtorScoped()
        {
            var parse = new CodegenExpressionLambda(classScope.NamespaceScope.InitMethod.Block)
                .WithParam<string>("text");
            var anonymousClass = NewInstance<ProxySimpleTypeParser>(parse);

            //CodegenExpressionNewAnonymousClass) anonymousClass = NewAnonymousClass(
            //    classScope.NamespaceScope.InitMethod.Block,
            //    typeof(SimpleTypeParser));
            //CodegenMethod parse = CodegenMethod.MakeParentNode(typeof(object), this.GetType(), classScope)
            //    .AddParam(typeof(string), "text");
            //anonymousClass.AddMethod("Parse", parse);

            parse.Block.BlockReturn(parser.Codegen(Ref("text")));
            return anonymousClass;
        }
예제 #3
0
        public static CodegenExpression CodegenSimpleParser(
            SimpleTypeParserSPI parser,
            CodegenMethod method,
            Type originator,
            CodegenClassScope classScope)
        {
            var parse = new CodegenExpressionLambda(method.Block)
                        .WithParam <string>("value");
            var typeParser = NewInstance <ProxySimpleTypeParser>(parse);

            //var anonymousClass =
            //    NewAnonymousClass(method.Block, typeof(SimpleTypeParser));
            //var parse = CodegenMethod
            //    .MakeParentNode<object>(originator, classScope)
            //    .AddParam<string>("value");
            //anonymousClass.AddMethod("Parse", parse);

            parse.Block.BlockReturn(parser.Codegen(Ref("value")));
            return(typeParser);
        }