public static CodegenExpression Codegen( EnumWhereEventsForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope .MakeChildWithScope( typeof(FlexCollection), typeof(EnumWhereEventsForgeEval), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var block = methodNode.Block .IfCondition(ExprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "IsEmpty")) .BlockReturn(EnumValue(typeof(FlexCollection), "Empty")); block.DeclareVar<ArrayDeque<EventBean>>("result", NewInstance(typeof(ArrayDeque<EventBean>))); 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.Expression(ExprDotMethod(Ref("result"), "Add", Ref("next"))); block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
public static void InitBlockSizeOneEventPlus( int numParameters, CodegenBlock block, CodegenExpression innerValue, int streamNumLambda, Type evaluationType) { var blockSingle = block .IfCondition(EqualsIdentity(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "Count"), Constant(1))) .DeclareVar <EventBean>("item", Cast(typeof(EventBean), ExprDotMethodChain(EnumForgeCodegenNames.REF_ENUMCOLL).Add("First"))) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(streamNumLambda), Ref("item")) .AssignArrayElement("props", Constant(0), Constant(0)); if (numParameters > 2) { blockSingle.AssignArrayElement("props", Constant(1), Constant(1)); } block.DebugStack(); CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( blockSingle, evaluationType, innerValue, EnumValue(typeof(FlexCollection), "Empty")); blockSingle.BlockReturn( FlexWrap(StaticMethod(typeof(Collections), "SingletonList", Ref("item")))); block.DeclareVar <ArrayDeque <EventBean> >("result", NewInstance <ArrayDeque <EventBean> >()); }
public CodegenExpression EvaluateCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(subselect.EvaluationType, GetType(), classScope); var havingMethod = CodegenLegoMethodExpression.CodegenExpression(subselect.HavingExpr, method, classScope, true); CodegenExpression having = LocalMethod( havingMethod, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method)); method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( method.Block, typeof(bool?), having, ConstantNull()); if (subselect.SelectClause.Length == 1) { var eval = CodegenLegoMethodExpression.CodegenExpression(subselect.SelectClause[0].Forge, method, classScope, true); method.Block.MethodReturn( LocalMethod(eval, REF_EVENTS_SHIFTED, ConstantTrue(), symbols.GetAddExprEvalCtx(method))); } else { method.Block.MethodReturn(LocalMethod(subselect.EvaluateRowCodegen(method, classScope))); } return LocalMethod(method); }
public static CodegenExpression Codegen( EnumTakeWhileScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var typeMember = codegenClassScope.AddDefaultFieldUnshared( true, typeof(ObjectArrayEventType), Cast( typeof(ObjectArrayEventType), EventTypeUtility.ResolveTypeCodegen(forge.type, EPStatementInitServicesConstants.REF))); var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope .MakeChildWithScope( typeof(FlexCollection), typeof(EnumTakeWhileScalarForgeEval), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var innerValue = forge.InnerExpression.EvaluateCodegen( typeof(bool?), methodNode, scope, codegenClassScope); var block = methodNode.Block .IfCondition(ExprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "IsEmpty")) .BlockReturn(EnumForgeCodegenNames.REF_ENUMCOLL); block.DeclareVar<ObjectArrayEventBean>( "evalEvent", NewInstance<ObjectArrayEventBean>(NewArrayByLength(typeof(object), Constant(1)), typeMember)) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("evalEvent")) .DeclareVar<object[]>("props", ExprDotName(Ref("evalEvent"), "Properties")); var blockSingle = block .IfCondition(EqualsIdentity(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "Count"), Constant(1))) .DeclareVar<object>( "item", ExprDotMethodChain(EnumForgeCodegenNames.REF_ENUMCOLL).Add("First")) .AssignArrayElement("props", Constant(0), Ref("item")); CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( blockSingle, forge.InnerExpression.EvaluationType, innerValue, FlexEmpty()); blockSingle.BlockReturn(FlexValue(Ref("item"))); block.DeclareVar<ArrayDeque<object>>("result", NewInstance(typeof(ArrayDeque<object>))); var forEach = block.ForEach(typeof(object), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement("props", Constant(0), Ref("next")); CodegenLegoBooleanExpression.CodegenBreakIfNotNullAndNotPass( forEach, forge.InnerExpression.EvaluationType, innerValue); forEach.Expression(ExprDotMethod(Ref("result"), "Add", Ref("next"))); block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
public override void InitBlock( CodegenBlock block, CodegenMethod methodNode, ExprForgeCodegenSymbol scope, CodegenClassScope codegenClassScope) { innerValue = InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope); EnumTakeWhileHelper.InitBlockSizeOneScalar(numParameters, block, innerValue, InnerExpression.EvaluationType); block.DeclareVar( typeof(object[]), "all", StaticMethod(typeof(EnumTakeWhileHelper), "TakeWhileLastScalarToArray", EnumForgeCodegenNames.REF_ENUMCOLL)); var forEach = block.ForLoop( typeof(int), "i", Op(ArrayLength(Ref("all")), "-", Constant(1)), Relational(Ref("i"), GE, Constant(0)), DecrementRef("i")) .AssignArrayElement("props", Constant(0), ArrayAtIndex(Ref("all"), Ref("i"))); if (numParameters >= 2) { forEach.IncrementRef("count") .AssignArrayElement("props", Constant(1), Ref("count")); } CodegenLegoBooleanExpression.CodegenBreakIfNotNullAndNotPass(forEach, InnerExpression.EvaluationType, innerValue); forEach.Expression(ExprDotMethod(Ref("result"), "AddFirst", ArrayAtIndex(Ref("all"), Ref("i")))); }
public static CodegenExpression Codegen( EnumAllOfEventsForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope.MakeChildWithScope( typeof(bool), typeof(EnumAllOfEventsForgeEval), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var block = methodNode.Block; block.IfConditionReturnConst(ExprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "IsEmpty"), true); var forEach = block.ForEach(typeof(EventBean), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("next")); CodegenLegoBooleanExpression.CodegenReturnBoolIfNullOrBool( forEach, forge.InnerExpression.EvaluationType, forge.InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope), true, false, false, false); block.MethodReturn(ConstantTrue()); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
public static CodegenExpression Codegen( EnumCountOfSelectorScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var typeMember = codegenClassScope.AddDefaultFieldUnshared( true, typeof(ObjectArrayEventType), Cast( typeof(ObjectArrayEventType), EventTypeUtility.ResolveTypeCodegen(forge.type, EPStatementInitServicesConstants.REF))); var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope .MakeChildWithScope(typeof(int), typeof(EnumCountOfSelectorScalarForgeEval), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var block = methodNode.Block .DeclareVar<int>("count", Constant(0)) .DeclareVar<ObjectArrayEventBean>( "evalEvent", NewInstance<ObjectArrayEventBean>(NewArrayByLength(typeof(object), Constant(1)), typeMember)) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("evalEvent")) .DeclareVar<object[]>("props", ExprDotName(Ref("evalEvent"), "Properties")); var forEach = block.ForEach(typeof(object), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement(Ref("props"), Constant(0), Ref("next")); CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( forEach, forge.InnerExpression.EvaluationType, forge.InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope)); forEach.Increment("count"); block.MethodReturn(Ref("count")); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
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); }
protected override CodegenExpression CodegenEvaluateInternal( CodegenMethodScope parent, SubselectForgeNRSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool?), this.GetType(), classScope); var left = symbols.GetAddLeftResult(method); method.Block.DeclareVar<bool>("hasNullRow", ConstantFalse()); var @foreach = method.Block.ForEach(typeof(EventBean), "theEvent", symbols.GetAddMatchingEvents(method)); { @foreach.AssignArrayElement(NAME_EPS, Constant(0), Ref("theEvent")); if (filterEval != null) { CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( @foreach, filterEval.EvaluationType, filterEval.EvaluateCodegen(typeof(bool?), method, symbols, classScope)); } @foreach.IfRefNullReturnNull(left); Type valueRightType; if (selectEval != null) { valueRightType = Boxing.GetBoxedType(selectEval.EvaluationType); @foreach.DeclareVar( valueRightType, "valueRight", selectEval.EvaluateCodegen(valueRightType, method, symbols, classScope)); } else { valueRightType = subselect.RawEventType.UnderlyingType; @foreach.DeclareVar( valueRightType, "valueRight", Cast(valueRightType, ExprDotUnderlying(ArrayAtIndex(symbols.GetAddEPS(method), Constant(0))))); } var ifRight = @foreach.IfCondition(NotEqualsNull(Ref("valueRight"))); { if (coercer == null) { ifRight.IfCondition(ExprDotMethod(left, "Equals", Ref("valueRight"))) .BlockReturn(Constant(!isNotIn)); } else { ifRight.DeclareVar<object>("left", coercer.CoerceCodegen(left, symbols.LeftResultType)) .DeclareVar<object>("right", coercer.CoerceCodegen(Ref("valueRight"), valueRightType)) .DeclareVar<bool>("eq", ExprDotMethod(Ref("left"), "Equals", Ref("right"))) .IfCondition(Ref("eq")) .BlockReturn(Constant(!isNotIn)); } } ifRight.IfElse().AssignRef("hasNullRow", ConstantTrue()); } method.Block .IfCondition(Ref("hasNullRow")) .BlockReturn(ConstantNull()) .MethodReturn(Constant(isNotIn)); return LocalMethod(method); }
protected override CodegenExpression CodegenEvaluateInternal( CodegenMethodScope parent, SubselectForgeNRSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool?), GetType(), classScope); var eps = symbols.GetAddEPS(method); var evalCtx = symbols.GetAddExprEvalCtx(method); var left = symbols.GetAddLeftResult(method); method.Block.IfNullReturnNull(symbols.GetAddLeftResult(method)); if (havingEval != null) { CodegenExpression having = LocalMethod( CodegenLegoMethodExpression.CodegenExpression(havingEval, method, classScope, true), eps, ConstantTrue(), evalCtx); CodegenLegoBooleanExpression.CodegenReturnValueIfNullOrNotPass( method.Block, havingEval.EvaluationType, having, ConstantNull()); } CodegenExpression select = LocalMethod( CodegenLegoMethodExpression.CodegenExpression(selectEval, method, classScope, true), eps, ConstantTrue(), evalCtx); var rightEvalType = selectEval.EvaluationType.GetBoxedType(); method.Block .DeclareVar(rightEvalType, "rhs", select) .IfRefNullReturnNull("rhs"); if (coercer == null) { method.Block.DeclareVar<bool>("eq", ExprDotMethod(left, "Equals", Ref("rhs"))); if (isNot) { method.Block.IfCondition(Ref("eq")).BlockReturn(ConstantFalse()); } else { method.Block.IfCondition(Not(Ref("eq"))).BlockReturn(ConstantFalse()); } } else { method.Block .DeclareVar<object>("left", coercer.CoerceCodegen(left, symbols.LeftResultType)) .DeclareVar<object>("right", coercer.CoerceCodegen(Ref("rhs"), rightEvalType)) .DeclareVar<bool>("eq", StaticMethod<object>("Equals", Ref("left"), Ref("right"))); if (isNot) { method.Block.IfCondition(Ref("eq")).BlockReturn(ConstantFalse()); } else { method.Block.IfCondition(Not(Ref("eq"))).BlockReturn(ConstantFalse()); } } method.Block.MethodReturn(ConstantTrue()); return LocalMethod(method); }
public override CodegenExpression EvaluateGetCollScalarCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { if (subselect.FilterExpr == null) { if (subselect.SelectClause == null) { return ConstantNull(); } else { var method = parent.MakeChild(typeof(FlexCollection), this.GetType(), classScope); method.Block .DeclareVar<IList<object>>("result", NewInstance(typeof(List<object>))) .ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); var selectClause = GetSelectClauseExpr(method, symbols, classScope); var @foreach = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { @foreach.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")) .DeclareVar<object>("value", selectClause) .ExprDotMethod(Ref("result"), "Add", Ref("value")); } method.Block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(method); } } if (subselect.SelectClause == null) { return ConstantNull(); } var methodX = parent.MakeChild(typeof(FlexCollection), this.GetType(), classScope); methodX.Block .DeclareVar<IList<object>>("result", NewInstance(typeof(List<object>))) .ApplyTri(DECLARE_EVENTS_SHIFTED, methodX, symbols); var selectClauseX = GetSelectClauseExpr(methodX, symbols, classScope); var filter = CodegenLegoMethodExpression.CodegenExpression(subselect.FilterExpr, methodX, classScope, true); var foreachX = methodX.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(methodX)); { foreachX.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")); CodegenLegoBooleanExpression.CodegenContinueIfNullOrNotPass( foreachX, typeof(bool?), LocalMethod( filter, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(methodX), symbols.GetAddExprEvalCtx(methodX))); foreachX.DeclareVar<object>("value", selectClauseX) .ExprDotMethod(Ref("result"), "Add", Ref("value")); } methodX.Block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(methodX); }
public override void ForEachBlock( CodegenBlock block, CodegenMethod methodNode, ExprForgeCodegenSymbol scope, CodegenClassScope codegenClassScope) { CodegenLegoBooleanExpression.CodegenBreakIfNotNullAndNotPass(block, InnerExpression.EvaluationType, innerValue); block.Expression(ExprDotMethod(Ref("result"), "Add", Ref("next"))); }
public override void ForEachBlock( CodegenBlock block, CodegenMethod methodNode, ExprForgeCodegenSymbol scope, CodegenClassScope codegenClassScope) { CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( block, InnerExpression.EvaluationType, InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope)); block.BlockReturn(Ref("next")); }
public static CodegenExpression Codegen( EnumTakeWhileEventsForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var returnType = typeof(FlexCollection); var paramTypes = EnumForgeCodegenNames.PARAMS; var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope .MakeChildWithScope( returnType, typeof(EnumTakeWhileEventsForgeEval), scope, codegenClassScope) .AddParam(paramTypes); var innerValue = forge.InnerExpression.EvaluateCodegen( typeof(bool?), methodNode, scope, codegenClassScope); var block = methodNode.Block .IfCondition(ExprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "IsEmpty")) .BlockReturn(EnumForgeCodegenNames.REF_ENUMCOLL); var blockSingle = block .IfCondition(EqualsIdentity(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "Count"), Constant(1))) .DeclareVar<EventBean>("item", ExprDotMethod(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "EventBeanCollection"), "First")) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("item")); CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( blockSingle, forge.InnerExpression.EvaluationType, innerValue, FlexEmpty()); blockSingle.BlockReturn(FlexEvent(Ref("item"))); block.DeclareVar<ArrayDeque<EventBean>>("result", NewInstance(typeof(ArrayDeque<EventBean>))); var forEach = block .ForEach(typeof(EventBean), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("next")); CodegenLegoBooleanExpression.CodegenBreakIfNotNullAndNotPass( forEach, forge.InnerExpression.EvaluationType, innerValue); forEach.Expression(ExprDotMethod(Ref("result"), "Add", Ref("next"))); block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
public override void ForEachBlock( CodegenBlock block, CodegenMethod methodNode, ExprForgeCodegenSymbol scope, CodegenClassScope codegenClassScope) { CodegenLegoBooleanExpression.CodegenReturnBoolIfNullOrBool( block, InnerExpression.EvaluationType, InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope), all, all ? false : (bool?)null, !all, !all); }
public static CodegenExpression Codegen( EnumAllOfScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var typeMember = codegenClassScope.AddDefaultFieldUnshared( true, typeof(ObjectArrayEventType), Cast( typeof(ObjectArrayEventType), EventTypeUtility.ResolveTypeCodegen(forge.type, EPStatementInitServicesConstants.REF))); var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope .MakeChildWithScope(typeof(bool), typeof(EnumAllOfScalarForgeEval), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var block = methodNode.Block; //block.CommentFullLine("-- trace --"); //block.Debug("enumcoll: {0}", ExprDotMethod(Ref("enumcoll"), "RenderAny")); block.IfConditionReturnConst(ExprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "IsEmpty"), true); block.DeclareVar<ObjectArrayEventBean>( "evalEvent", NewInstance<ObjectArrayEventBean>( NewArrayByLength(typeof(object), Constant(1)), typeMember)) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(forge.StreamNumLambda), Ref("evalEvent")) .DeclareVar<object[]>("props", ExprDotName(Ref("evalEvent"), "Properties")); var forEach = block.ForEach(typeof(object), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement("props", Constant(0), Ref("next")); CodegenLegoBooleanExpression.CodegenReturnBoolIfNullOrBool( forEach, forge.InnerExpression.EvaluationType, forge.InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope), false, null, false, false); block.MethodReturn(ConstantTrue()); return LocalMethod(methodNode, args.Eps, args.Enumcoll, args.IsNewData, args.ExprCtx); }
public override CodegenExpression EvaluateCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { CodegenExpressionInstanceField eventToPublic = TableDeployTimeResolver.MakeTableEventToPublicField(table, classScope, this.GetType()); CodegenMethod method = parent.MakeChild(subselect.EvaluationType, this.GetType(), classScope); method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); method.Block.DeclareVar<EventBean>("filtered", ConstantNull()); CodegenBlock @foreach = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { @foreach.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")); CodegenMethod filter = CodegenLegoMethodExpression.CodegenExpression(subselect.FilterExpr, method, classScope, true); CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( @foreach, typeof(bool?), LocalMethod( filter, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); @foreach.IfCondition(NotEqualsNull(Ref("filtered"))) .BlockReturn(ConstantNull()) .AssignRef("filtered", Ref("@event")); } method.Block.IfRefNullReturnNull("filtered") .MethodReturn( ExprDotMethod( eventToPublic, "ConvertToUnd", Ref("filtered"), symbols.GetAddEPS(method), symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); return LocalMethod(method); }
public CodegenExpression EvaluateMatchesCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { CodegenExpression aggService = classScope.NamespaceScope.AddOrGetDefaultFieldWellKnown( new CodegenFieldNameSubqueryAgg(subselect.SubselectNumber), typeof(AggregationResultFuture)); var method = parent.MakeChild(typeof(bool), GetType(), classScope); var evalCtx = symbols.GetAddExprEvalCtx(method); method.Block .ApplyTri(new ReturnIfNoMatch(ConstantFalse(), ConstantFalse()), method, symbols) .DeclareVar<int>("cpid", ExprDotName(evalCtx, "AgentInstanceId")) .DeclareVar<AggregationService>( "aggregationService", ExprDotMethod(aggService, "GetContextPartitionAggregationService", Ref("cpid"))) .DeclareVar<ICollection<object>>( "groupKeys", ExprDotMethod(Ref("aggregationService"), "GetGroupKeys", evalCtx)); method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); var forEach = method.Block.ForEach(typeof(object), "groupKey", Ref("groupKeys")); { forEach.ExprDotMethod( Ref("aggregationService"), "SetCurrentAccess", Ref("groupKey"), Ref("cpid"), ConstantNull()); CodegenLegoBooleanExpression.CodegenContinueIfNullOrNotPass( forEach, havingEval.EvaluationType, havingEval.EvaluateCodegen(havingEval.EvaluationType, method, symbols, classScope)); forEach.BlockReturn(ConstantTrue()); } method.Block.MethodReturn(ConstantFalse()); return LocalMethod(method); }
public CodegenExpression EvaluateMatchesCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool), GetType(), classScope); var havingMethod = CodegenLegoMethodExpression.CodegenExpression(havingEval, method, classScope, true); CodegenExpression having = LocalMethod( havingMethod, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method)); method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); CodegenLegoBooleanExpression.CodegenReturnValueIfNullOrNotPass( method.Block, typeof(bool?), having, ConstantFalse()); method.Block.MethodReturn(ConstantTrue()); return LocalMethod(method); }
public override CodegenExpression Codegen( EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { var scope = new ExprForgeCodegenSymbol(false, null); var methodNode = codegenMethodScope.MakeChildWithScope(typeof(EventBean), typeof(EnumLastOfEvent), scope, codegenClassScope) .AddParam(EnumForgeCodegenNames.PARAMS); var block = methodNode.Block .DeclareVar <EventBean>("result", ConstantNull()); var forEach = block .ForEach(typeof(EventBean), "next", EnumForgeCodegenNames.REF_ENUMCOLL) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(StreamNumLambda), Ref("next")); CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( forEach, InnerExpression.EvaluationType, InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope)); forEach.AssignRef("result", Ref("next")); block.MethodReturn(Ref("result")); return(LocalMethod(methodNode, premade.Eps, premade.Enumcoll, premade.IsNewData, premade.ExprCtx)); }
public override void InitBlock( CodegenBlock block, CodegenMethod methodNode, ExprForgeCodegenSymbol scope, CodegenClassScope codegenClassScope) { innerValue = InnerExpression.EvaluateCodegen(typeof(bool?), methodNode, scope, codegenClassScope); var blockSingle = block.IfCondition(EqualsIdentity(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "Count"), Constant(1))) .DeclareVar <EventBean>("item", Cast(typeof(EventBean), ExprDotMethodChain(EnumForgeCodegenNames.REF_ENUMCOLL).Add("First"))) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(StreamNumLambda), Ref("item")); block.DebugStack(); CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( blockSingle, InnerExpression.EvaluationType, innerValue, EnumValue(typeof(FlexCollection), "Empty")); blockSingle.BlockReturn( FlexWrap(StaticMethod(typeof(Collections), "SingletonList", Ref("item")))); block .DeclareVar <ArrayDeque <EventBean> >("result", NewInstance <ArrayDeque <EventBean> >()) .DeclareVar <EventBean[]>("all", StaticMethod(typeof(EnumTakeWhileHelper), "TakeWhileLastEventBeanToArray", EnumForgeCodegenNames.REF_ENUMCOLL)); var forEach = block.ForLoop( typeof(int), "i", Op(ArrayLength(Ref("all")), "-", Constant(1)), Relational(Ref("i"), GE, Constant(0)), DecrementRef("i")) .AssignArrayElement(EnumForgeCodegenNames.REF_EPS, Constant(StreamNumLambda), ArrayAtIndex(Ref("all"), Ref("i"))); CodegenLegoBooleanExpression.CodegenBreakIfNotNullAndNotPass(forEach, InnerExpression.EvaluationType, innerValue); forEach.Expression(ExprDotMethod(Ref("result"), "AddFirst", ArrayAtIndex(Ref("all"), Ref("i")))); }
public static void InitBlockSizeOneScalar( int numParameters, CodegenBlock block, CodegenExpression innerValue, Type evaluationType) { var blockSingle = block.IfCondition(EqualsIdentity(ExprDotName(EnumForgeCodegenNames.REF_ENUMCOLL, "Count"), Constant(1))) .DeclareVar <object>("item", ExprDotMethodChain(EnumForgeCodegenNames.REF_ENUMCOLL).Add("First")) .AssignArrayElement("props", Constant(0), Ref("item")); if (numParameters >= 2) { blockSingle.AssignArrayElement("props", Constant(1), Constant(0)); } CodegenLegoBooleanExpression.CodegenReturnValueIfNotNullAndNotPass( blockSingle, evaluationType, innerValue, FlexEmpty()); blockSingle.BlockReturn(FlexValue(Ref("item"))); block.DeclareVar <ArrayDeque <object> >("result", NewInstance <ArrayDeque <object> >()); }
protected override CodegenExpression CodegenEvaluateInternal( CodegenMethodScope parent, SubselectForgeNRSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool?), GetType(), classScope); CodegenExpression eps = symbols.GetAddEPS(method); CodegenExpression evalCtx = symbols.GetAddExprEvalCtx(method); var left = symbols.GetAddLeftResult(method); if (havingEval != null) { CodegenExpression having = LocalMethod( CodegenLegoMethodExpression.CodegenExpression(havingEval, method, classScope, true), eps, ConstantTrue(), evalCtx); CodegenLegoBooleanExpression.CodegenReturnValueIfNullOrNotPass( method.Block, havingEval.EvaluationType, having, ConstantNull()); } CodegenExpression rhsSide = LocalMethod( CodegenLegoMethodExpression.CodegenExpression(selectEval, method, classScope, true), eps, ConstantTrue(), evalCtx); var rhsType = selectEval.EvaluationType.GetBoxedType(); method.Block .DeclareVar(rhsType, "rhs", rhsSide) .IfRefNullReturnNull("rhs") .MethodReturn(computer.Codegen(left, symbols.LeftResultType, Ref("rhs"), rhsType)); return LocalMethod(method); }
protected override CodegenExpression CodegenEvaluateInternal( CodegenMethodScope parent, SubselectForgeNRSymbol symbols, CodegenClassScope classScope) { CodegenExpression aggService = classScope.NamespaceScope.AddOrGetDefaultFieldWellKnown( new CodegenFieldNameSubqueryAgg(subselect.SubselectNumber), typeof(AggregationResultFuture)); var method = parent.MakeChild(subselect.EvaluationType, this.GetType(), classScope); var evalCtx = symbols.GetAddExprEvalCtx(method); var left = symbols.GetAddLeftResult(method); method.Block .DeclareVar<int>("cpid", ExprDotName(evalCtx, "AgentInstanceId")) .DeclareVar<AggregationService>( "aggregationService", ExprDotMethod(aggService, "GetContextPartitionAggregationService", Ref("cpid"))) .DeclareVar<ICollection<object>>( "groupKeys", ExprDotMethod(Ref("aggregationService"), "GetGroupKeys", evalCtx)) .DeclareVar<bool>("hasNullRow", ConstantFalse()); var forEach = method.Block.ForEach(typeof(object), "groupKey", Ref("groupKeys")); { forEach.IfCondition(EqualsNull(left)) .BlockReturn(ConstantNull()) .ExprDotMethod( Ref("aggregationService"), "SetCurrentAccess", Ref("groupKey"), Ref("cpid"), ConstantNull()); if (havingEval != null) { CodegenLegoBooleanExpression.CodegenContinueIfNullOrNotPass( forEach, havingEval.EvaluationType, havingEval.EvaluateCodegen(havingEval.EvaluationType, method, symbols, classScope)); } Type valueRightType; if (selectEval != null) { valueRightType = Boxing.GetBoxedType(selectEval.EvaluationType); forEach.DeclareVar( valueRightType, "valueRight", selectEval.EvaluateCodegen(valueRightType, method, symbols, classScope)); } else { valueRightType = typeof(object); forEach.DeclareVar( valueRightType, "valueRight", ExprDotUnderlying(ArrayAtIndex(symbols.GetAddEPS(method), Constant(0)))); } var ifRightNotNull = forEach.IfCondition(EqualsNull(Ref("valueRight"))) .AssignRef("hasNullRow", ConstantTrue()) .IfElse(); { if (coercer == null) { ifRightNotNull.DeclareVar<bool>("eq", ExprDotMethod(left, "Equals", Ref("valueRight"))); } else { ifRightNotNull.DeclareVar<object>("left", coercer.CoerceCodegen(left, symbols.LeftResultType)) .DeclareVar<object>("right", coercer.CoerceCodegen(Ref("valueRight"), valueRightType)) .DeclareVar<bool>("eq", StaticMethod<object>("Equals", Ref("left"), Ref("right"))); } if (isNot) { if (isAll) { ifRightNotNull.IfCondition(Ref("eq")).BlockReturn(ConstantFalse()); } else { ifRightNotNull.IfCondition(Not(Ref("eq"))).BlockReturn(ConstantTrue()); } } else { if (isAll) { ifRightNotNull.IfCondition(Not(Ref("eq"))).BlockReturn(ConstantFalse()); } else { ifRightNotNull.IfCondition(Ref("eq")).BlockReturn(ConstantTrue()); } } } } method.Block .IfCondition(Ref("hasNullRow")) .BlockReturn(ConstantNull()) .MethodReturn(isAll ? ConstantTrue() : ConstantFalse()); return LocalMethod(method); }
public CodegenExpression EvaluateTypableMultirowCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { if (subselect.SelectClause == null) { return ConstantNull(); } if (subselect.FilterExpr == null) { var method = parent.MakeChild(typeof(object[][]), GetType(), classScope); method.Block .DeclareVar<object[][]>( "rows", NewArrayByLength(typeof(object[]), ExprDotName(symbols.GetAddMatchingEvents(method), "Count"))) .DeclareVar<int>("index", Constant(-1)) .ApplyTri(SubselectForgeCodegenUtil.DECLARE_EVENTS_SHIFTED, method, symbols); var foreachEvent = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { foreachEvent .IncrementRef("index") .AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")) .DeclareVar<object[]>( "results", NewArrayByLength(typeof(object), Constant(subselect.SelectClause.Length))) .AssignArrayElement("rows", Ref("index"), Ref("results")); for (var i = 0; i < subselect.SelectClause.Length; i++) { var eval = CodegenLegoMethodExpression.CodegenExpression(subselect.SelectClause[i].Forge, method, classScope, true); foreachEvent.AssignArrayElement( "results", Constant(i), LocalMethod( eval, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); } } method.Block.MethodReturn(Ref("rows")); return LocalMethod(method); } else { var method = parent.MakeChild(typeof(object[][]), GetType(), classScope); method.Block .DeclareVar<ArrayDeque<object[]>>("rows", NewInstance(typeof(ArrayDeque<object[]>))) .ApplyTri(SubselectForgeCodegenUtil.DECLARE_EVENTS_SHIFTED, method, symbols); var foreachEvent = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { foreachEvent.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")); var filter = CodegenLegoMethodExpression.CodegenExpression(subselect.FilterExpr, method, classScope, true); CodegenLegoBooleanExpression.CodegenContinueIfNullOrNotPass( foreachEvent, typeof(bool?), LocalMethod( filter, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); foreachEvent .DeclareVar<object[]>( "results", NewArrayByLength(typeof(object), Constant(subselect.SelectClause.Length))) .ExprDotMethod(Ref("rows"), "Add", Ref("results")); for (var i = 0; i < subselect.SelectClause.Length; i++) { var eval = CodegenLegoMethodExpression.CodegenExpression(subselect.SelectClause[i].Forge, method, classScope, true); foreachEvent.AssignArrayElement( "results", Constant(i), LocalMethod( eval, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); } } method.Block .IfCondition(ExprDotMethod(Ref("rows"), "IsEmpty")) .BlockReturn(EnumValue(typeof(CollectionUtil), "OBJECTARRAYARRAY_EMPTY")) .MethodReturn(ExprDotMethod(Ref("rows"), "ToArray")); return LocalMethod(method); } }
protected override CodegenExpression CodegenEvaluateInternal( CodegenMethodScope parent, SubselectForgeNRSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(bool?), GetType(), classScope); method.Block .DeclareVar<bool>("hasRows", ConstantFalse()) .DeclareVar<bool>("hasNullRow", ConstantFalse()); var @foreach = method.Block.ForEach( typeof(EventBean), "subselectEvent", symbols.GetAddMatchingEvents(method)); { @foreach.AssignArrayElement(NAME_EPS, Constant(0), Ref("subselectEvent")); if (filterOrHavingEval != null) { CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( @foreach, filterOrHavingEval.EvaluationType, filterOrHavingEval.EvaluateCodegen(typeof(bool?), method, symbols, classScope)); } @foreach.AssignRef("hasRows", ConstantTrue()); Type valueRightType; if (selectEval != null) { valueRightType = selectEval.EvaluationType.GetBoxedType(); @foreach.DeclareVar( valueRightType, "valueRight", selectEval.EvaluateCodegen(valueRightType, method, symbols, classScope)); } else { valueRightType = typeof(object); @foreach.DeclareVar( valueRightType, "valueRight", ExprDotUnderlying(ArrayAtIndex(symbols.GetAddEPS(method), Constant(0)))); } @foreach.IfRefNull("valueRight") .AssignRef("hasNullRow", ConstantTrue()) .IfElse() .IfCondition(NotEqualsNull(symbols.GetAddLeftResult(method))) .IfCondition( Not( computer.Codegen( symbols.GetAddLeftResult(method), symbols.LeftResultType, Ref("valueRight"), valueRightType))) .BlockReturn(ConstantFalse()); } method.Block .IfCondition(Not(Ref("hasRows"))) .BlockReturn(ConstantTrue()) .IfCondition(EqualsNull(symbols.GetAddLeftResult(method))) .BlockReturn(ConstantNull()) .IfCondition(Ref("hasNullRow")) .BlockReturn(ConstantNull()) .MethodReturn(ConstantTrue()); return LocalMethod(method); }
public override CodegenExpression EvaluateGetCollEventsCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { if (subselect.FilterExpr == null) { if (subselect.SelectClause == null) { return symbols.GetAddMatchingEvents(parent); } else { if (subselect.subselectMultirowType == null) { var eval = ((ExprIdentNode) subselect.SelectClause[0]).ExprEvaluatorIdent; var method = parent.MakeChild( typeof(FlexCollection), this.GetType(), classScope); method.Block.DeclareVar<ICollection<EventBean>>( "events", NewInstance<ArrayDeque<EventBean>>( ExprDotName(symbols.GetAddMatchingEvents(method), "Count"))); var @foreach = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { @foreach.DeclareVar<EventBean>( "fragment", CodegenLegoCast.CastSafeFromObjectType( typeof(EventBean), eval.Getter.EventBeanFragmentCodegen(Ref("@event"), method, classScope))) .IfRefNull("fragment") .BlockContinue() .ExprDotMethod(Ref("events"), "Add", Ref("fragment")); } method.Block.MethodReturn(FlexWrap(Ref("events"))); return LocalMethod(method); } // when selecting a combined output row that contains multiple fields var methodX = parent.MakeChild(typeof(FlexCollection), this.GetType(), classScope); var fieldEventType = classScope.AddDefaultFieldUnshared( true, typeof(EventType), EventTypeUtility.ResolveTypeCodegen( subselect.subselectMultirowType, EPStatementInitServicesConstants.REF)); var eventBeanSvc = classScope.AddOrGetDefaultFieldSharable(EventBeanTypedEventFactoryCodegenField.INSTANCE); methodX.Block .DeclareVar<ICollection<EventBean>>( "result", NewInstance<ArrayDeque<EventBean>>( ExprDotName(symbols.GetAddMatchingEvents(methodX), "Count"))) .ApplyTri(DECLARE_EVENTS_SHIFTED, methodX, symbols); var foreachX = methodX.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(methodX)); { foreachX.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")) .DeclareVar<IDictionary<string, object>>( "row", LocalMethod( subselect.EvaluateRowCodegen(methodX, classScope), REF_EVENTS_SHIFTED, ConstantTrue(), symbols.GetAddExprEvalCtx(methodX))) .DeclareVar<EventBean>( "rowEvent", ExprDotMethod(eventBeanSvc, "AdapterForTypedMap", Ref("row"), fieldEventType)) .ExprDotMethod(Ref("result"), "Add", Ref("rowEvent")); } methodX.Block.MethodReturn(FlexWrap(Ref("result"))); return LocalMethod(methodX); } } if (subselect.SelectClause != null) { return ConstantNull(); } // handle filtered var methodY = parent.MakeChild(typeof(FlexCollection), this.GetType(), classScope); methodY.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, methodY, symbols); methodY.Block.DeclareVar<ArrayDeque<EventBean>>("filtered", ConstantNull()); var foreachY = methodY.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(methodY)); { foreachY.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")); var filter = CodegenLegoMethodExpression.CodegenExpression(subselect.FilterExpr, methodY, classScope, true); CodegenLegoBooleanExpression.CodegenContinueIfNullOrNotPass( foreachY, typeof(bool?), LocalMethod( filter, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(methodY), symbols.GetAddExprEvalCtx(methodY))); foreachY.IfCondition(EqualsNull(Ref("filtered"))) .AssignRef("filtered", NewInstance(typeof(ArrayDeque<EventBean>))) .BlockEnd() .ExprDotMethod(Ref("filtered"), "Add", Ref("@event")); } methodY.Block.MethodReturn(FlexWrap(Ref("filtered"))); return LocalMethod(methodY); }
public override CodegenExpression EvaluateCodegen( CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(subselect.EvaluationType, this.GetType(), classScope); if (subselect.FilterExpr == null) { method.Block .IfCondition( Relational( ExprDotName(symbols.GetAddMatchingEvents(method), "Count"), CodegenExpressionRelational.CodegenRelational.GT, Constant(1))) .BlockReturn(ConstantNull()); if (subselect.SelectClause == null) { method.Block.MethodReturn( Cast( subselect.EvaluationType, StaticMethod( typeof(EventBeanUtility), "GetNonemptyFirstEventUnderlying", symbols.GetAddMatchingEvents(method)))); return LocalMethod(method); } else { method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols) .AssignArrayElement( REF_EVENTS_SHIFTED, Constant(0), StaticMethod( typeof(EventBeanUtility), "GetNonemptyFirstEvent", symbols.GetAddMatchingEvents(method))); } } else { method.Block.ApplyTri(DECLARE_EVENTS_SHIFTED, method, symbols); method.Block.DeclareVar<EventBean>("filtered", ConstantNull()); var @foreach = method.Block.ForEach( typeof(EventBean), "@event", symbols.GetAddMatchingEvents(method)); { @foreach.AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("@event")); var filter = CodegenLegoMethodExpression.CodegenExpression(subselect.FilterExpr, method, classScope, true); CodegenLegoBooleanExpression.CodegenContinueIfNotNullAndNotPass( @foreach, typeof(bool?), LocalMethod( filter, REF_EVENTS_SHIFTED, symbols.GetAddIsNewData(method), symbols.GetAddExprEvalCtx(method))); @foreach.IfCondition(NotEqualsNull(Ref("filtered"))) .BlockReturn(ConstantNull()) .AssignRef("filtered", Ref("@event")); } if (subselect.SelectClause == null) { method.Block.IfRefNullReturnNull("filtered") .MethodReturn(Cast(subselect.EvaluationType, ExprDotUnderlying(Ref("filtered")))); return LocalMethod(method); } method.Block.IfRefNullReturnNull("filtered") .AssignArrayElement(REF_EVENTS_SHIFTED, Constant(0), Ref("filtered")); } var selectClause = GetSelectClauseExpr(method, symbols, classScope); method.Block.MethodReturn(selectClause); return LocalMethod(method); }