Ejemplo n.º 1
0
        public static CodegenExpression Codegen(
            EnumFirstOfPredicateEventsForge forge,
            EnumForgeCodegenParams args,
            CodegenMethodScope codegenMethodScope,
            CodegenClassScope codegenClassScope)
        {
            var scope = new ExprForgeCodegenSymbol(false, null);
            var methodNode = codegenMethodScope
                .MakeChildWithScope(
                    typeof(EventBean),
                    typeof(EnumFirstOfPredicateEventsForgeEval),
                    scope,
                    codegenClassScope)
                .AddParam(EnumForgeCodegenNames.PARAMS);

            var block = methodNode.Block;
            var forEach = block.ForEach(typeof(EventBean), "next", EnumForgeCodegenNames.REF_ENUMCOLL)
                .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("next"));
            CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass(
                forEach,
                forge.InnerExpression.EvaluationType,
                forge.InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope));
            forEach.BlockReturn(Ref("next"));
            block.MethodReturn(ConstantNull());
            return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx);
        }
Ejemplo n.º 2
0
 public EnumFirstOfPredicateEventsForgeEval(
     EnumFirstOfPredicateEventsForge forge,
     ExprEvaluator innerExpression)
 {
     _forge = forge;
     _innerExpression = innerExpression;
 }