Exemplo n.º 1
0
        public static CodegenExpression Codegen(
            PropertyDotNonLambdaIndexedForge forge,
            CodegenMethodScope codegenMethodScope,
            ExprForgeCodegenSymbol exprSymbol,
            CodegenClassScope codegenClassScope)
        {
            var methodNode = codegenMethodScope.MakeChild(
                forge.EvaluationType,
                typeof(PropertyDotNonLambdaIndexedForgeEval),
                codegenClassScope);

            var refEPS = exprSymbol.GetAddEPS(methodNode);
            var keyEvaluationType = forge.ParamForge.EvaluationType.GetUnboxedType();
            var keyEvaluation = forge.ParamForge.EvaluateCodegen(keyEvaluationType, methodNode, exprSymbol, codegenClassScope);
            
            methodNode.Block
                .DeclareVar<EventBean>("@event", ArrayAtIndex(refEPS, Constant(forge.StreamId)))
                .IfRefNullReturnNull("@event")
                .DeclareVar(keyEvaluationType, "key", keyEvaluation)
                .MethodReturn(
                    forge.IndexedGetter.EventBeanGetIndexedCodegen(
                        methodNode,
                        codegenClassScope,
                        Ref("@event"),
                        Ref("key")));
            return LocalMethod(methodNode);
        }
Exemplo n.º 2
0
 public PropertyDotNonLambdaIndexedForgeEval(
     PropertyDotNonLambdaIndexedForge forge,
     ExprEvaluator paramEval)
 {
     this.forge = forge;
     this.paramEval = paramEval;
 }