예제 #1
0
        public static CodegenExpression Codegen(
            PropertyDotNonLambdaIndexedForge forge,
            CodegenMethodScope codegenMethodScope,
            ExprForgeCodegenSymbol exprSymbol,
            CodegenClassScope codegenClassScope)
        {
            CodegenMethod methodNode = codegenMethodScope.MakeChild(
                forge.EvaluationType,
                typeof(PropertyDotNonLambdaIndexedForgeEval),
                codegenClassScope);

            CodegenExpressionRef refEPS = exprSymbol.GetAddEPS(methodNode);
            Type evaluationType = forge.ParamForge.EvaluationType;
            methodNode.Block
                .DeclareVar<EventBean>("@event", ArrayAtIndex(refEPS, Constant(forge.StreamId)))
                .IfRefNullReturnNull("@event")
                .DeclareVar(
                    evaluationType,
                    "key",
                    forge.ParamForge.EvaluateCodegen(evaluationType, methodNode, exprSymbol, codegenClassScope))
                .MethodReturn(
                    forge.IndexedGetter.EventBeanGetIndexedCodegen(
                        methodNode,
                        codegenClassScope,
                        Ref("@event"),
                        Ref("key")));
            return LocalMethod(methodNode);
        }
예제 #2
0
 public PropertyDotNonLambdaIndexedForgeEval(
     PropertyDotNonLambdaIndexedForge forge,
     ExprEvaluator paramEval)
 {
     this.forge = forge;
     this.paramEval = paramEval;
 }