Ejemplo n.º 1
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(FireAndForgetProcessorTable), GetType(), classScope);
     var nw = Ref("tbl");
     method.Block
         .DeclareVar<FireAndForgetProcessorTable>(
             nw.Ref,
             NewInstance(typeof(FireAndForgetProcessorTable)))
         .SetProperty(
             nw,
             "Table",
             TableDeployTimeResolver.MakeResolveTable(Table, symbols.GetAddInitSvc(method)))
         .MethodReturn(nw);
     return LocalMethod(method);
 }
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     CodegenMethod method = parent.MakeChild(typeof(PropertyEvaluatorAccumulative), this.GetType(), classScope);
     method.Block
         .DeclareVar<PropertyEvaluatorAccumulative>("pe", NewInstance(typeof(PropertyEvaluatorAccumulative)))
         .SetProperty(
             Ref("pe"),
             "ContainedEventEvals",
             MakeContained(containedEventEvals, method, symbols, classScope))
         .SetProperty(Ref("pe"), "WhereClauses", MakeWhere(whereClauses, method, symbols, classScope))
         .SetProperty(Ref("pe"), "PropertyNames", Constant(propertyNames.ToArray()))
         .SetProperty(Ref("pe"), "FragmentEventTypeIsIndexed", Constant(fragmentEventTypeIsIndexed))
         .MethodReturn(Ref("pe"));
     return LocalMethod(method);
 }
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(StreamJoinAnalysisResultRuntime), GetType(), classScope);
     method.Block
         .DeclareVar<StreamJoinAnalysisResultRuntime>(
             "ar",
             NewInstance(typeof(StreamJoinAnalysisResultRuntime)))
         .SetProperty(Ref("ar"), "IsPureSelfJoin", Constant(IsPureSelfJoin))
         .SetProperty(Ref("ar"), "Unidirectional", Constant(UnidirectionalInd))
         .SetProperty(Ref("ar"), "UnidirectionalNonDriving", Constant(_unidirectionalNonDriving))
         .SetProperty(Ref("ar"), "NamedWindows", MakeNamedWindows(method, symbols))
         .SetProperty(Ref("ar"), "Tables", MakeTables(method, symbols))
         .MethodReturn(Ref("ar"));
     return LocalMethod(method);
 }
Ejemplo n.º 4
0
        protected override void InlineCodegen(
            CodegenMethod method,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            method.Block.DeclareVar<EvalFactoryNode[]>(
                "children",
                NewArrayByLength(typeof(EvalFactoryNode), Constant(ChildNodes.Count)));
            for (var i = 0; i < ChildNodes.Count; i++) {
                method.Block.AssignArrayElement(
                    Ref("children"),
                    Constant(i),
                    LocalMethod(ChildNodes[i].MakeCodegen(method, symbols, classScope)));
            }

            method.Block
                .SetProperty(Ref("node"), "Children", Ref("children"));
        }
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(HistoricalIndexLookupStrategyHash), GetType(), classScope);
            var evaluator = MultiKeyCodegen.CodegenExprEvaluatorMayMultikey(
                _evaluators, _coercionTypes, _multiKeyClassRef, method, classScope);

            method.Block
                .DeclareVar<HistoricalIndexLookupStrategyHash>(
                    "strat",
                    NewInstance(typeof(HistoricalIndexLookupStrategyHash)))
                .SetProperty(Ref("strat"), "LookupStream", Constant(_lookupStream))
                .SetProperty(Ref("strat"), "Evaluator", evaluator)
                .MethodReturn(Ref("strat"));
            return LocalMethod(method);
        }
 public CodegenExpression CodegenCreateReader(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(AggregationMethodLinearWindow), GetType(), classScope);
     method.Block
         .DeclareVar(typeof(AggregationMethodLinearWindow), "strat", NewInstance(typeof(AggregationMethodLinearWindow)))
         .SetProperty(Ref("strat"), "ComponentType", Constant(arrayType.GetElementType()))
         .SetProperty(
             Ref("strat"),
             "OptionalEvaluator",
             optionalEvaluator == null
                 ? ConstantNull()
                 : ExprNodeUtilityCodegen.CodegenEvaluator(optionalEvaluator.Forge, method, GetType(), classScope))
         .MethodReturn(Ref("strat"));
     return LocalMethod(method);
 }
        public CodegenExpression CodegenCreateReader(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(AggregationMethodLinearFirstLastIndex), GetType(), classScope);
            var optionalIndexExpr = optionalIndexEval == null
                ? ConstantNull()
                : ExprNodeUtilityCodegen.CodegenEvaluator(optionalIndexEval.Forge, method, GetType(), classScope);

            method.Block
                .DeclareVar(typeof(AggregationMethodLinearFirstLastIndex), "strat", NewInstance(typeof(AggregationMethodLinearFirstLastIndex)))
                .SetProperty(Ref("strat"), "AccessType", Constant(accessType))
                .SetProperty(Ref("strat"), "OptionalConstIndex", Constant(optionalConstant))
                .SetProperty(Ref("strat"), "OptionalIndexEval", optionalIndexExpr)
                .MethodReturn(Ref("strat"));
            return LocalMethod(method);
        }
Ejemplo n.º 8
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(ContextConditionDescriptorFilter), GetType(), classScope);
     method.Block
         .DeclareVar<ContextConditionDescriptorFilter>(
             "condition",
             NewInstance(typeof(ContextConditionDescriptorFilter)))
         .SetProperty(
             Ref("condition"),
             "FilterSpecActivatable",
             LocalMethod(FilterSpecCompiled.MakeCodegen(method, symbols, classScope)))
         .SetProperty(Ref("condition"), "OptionalFilterAsName", Constant(OptionalFilterAsName))
         .MethodReturn(Ref("condition"));
     return LocalMethod(method);
 }
Ejemplo n.º 9
0
        private CodegenExpression MakeWriters(
            InternalEventRouterWriterForge[] writers,
            CodegenMethod method,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var init = new CodegenExpression[writers.Length];
            for (int i = 0; i < init.Length; i++) {
                if (writers[i] != null) {
                    init[i] = writers[i].Codegen(writers[i], method, symbols, classScope);
                }
                else {
                    init[i] = ConstantNull();
                }
            }

            return NewArrayWithInit(typeof(InternalEventRouterWriter), init);
        }
Ejemplo n.º 10
0
 public static CodegenExpressionInstanceField MakeVariableField(
     VariableMetaData variableMetaData,
     CodegenClassScope classScope,
     Type generator)
 {
     var symbols = new SAIFFInitializeSymbol();
     var variableInit = classScope.NamespaceScope.InitMethod
         .MakeChildWithScope(typeof(Variable), generator, symbols, classScope)
         .AddParam(
             typeof(EPStatementInitServices),
             EPStatementInitServicesConstants.REF.Ref);
     variableInit.Block.MethodReturn(
         MakeResolveVariable(variableMetaData, EPStatementInitServicesConstants.REF));
     return classScope.NamespaceScope.AddDefaultFieldUnshared(
         true,
         typeof(Variable),
         LocalMethod(variableInit, EPStatementInitServicesConstants.REF));
 }
Ejemplo n.º 11
0
 public void ProvideCodegen(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var factory = Ref("factory");
     method.Block
         .DeclareVar<OutputProcessViewDirectFactory>(
             factory.Ref,
             NewInstance(typeof(OutputProcessViewDirectFactory)))
         .SetProperty(
             factory,
             "PostProcessFactory",
             _outputStrategyPostProcessForge == null
                 ? ConstantNull()
                 : _outputStrategyPostProcessForge.Make(method, symbols, classScope))
         .MethodReturn(factory);
 }
Ejemplo n.º 12
0
        private static CodegenExpression MakeVariables(
            VariableMetaData[] variables,
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(Variable[]), typeof(VariableReadWritePackageForge), classScope);

            method.Block.DeclareVar <Variable[]>("vars", NewArrayByLength(typeof(Variable), Constant(variables.Length)));
            for (var i = 0; i < variables.Length; i++)
            {
                var resolve = VariableDeployTimeResolver.MakeResolveVariable(variables[i], symbols.GetAddInitSvc(method));
                method.Block.AssignArrayElement("vars", Constant(i), resolve);
            }

            method.Block.MethodReturn(Ref("vars"));
            return(LocalMethod(method));
        }
        public CodegenExpression CodegenCreateReader(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            CodegenMethod method = parent.MakeChild(typeof(AggregationMultiFunctionAggregationMethod), GetType(), classScope);

            method.Block
            .DeclareVar <ExprEvaluator>("keyEval", ExprNodeUtilityCodegen.CodegenEvaluator(_key.Forge, method, GetType(), classScope))
            .MethodReturn(
                StaticMethod(
                    typeof(AggregationMethodSortedKeyedFactory),
                    "MakeSortedAggregationWithKey",
                    Ref("keyEval"),
                    EnumValue(typeof(AggregationMethodSortedEnum), _aggMethod.GetName()),
                    Constant(_underlyingClass)));
            return(LocalMethod(method));
        }
Ejemplo n.º 14
0
 public override CodegenMethod MakeCodegen(
     CodegenClassScope classScope,
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols)
 {
     CodegenMethod method = parent.MakeChild(
         typeof(ContextControllerInitTermFactory),
         this.GetType(),
         classScope);
     method.Block
         .DeclareVar<ContextControllerInitTermFactory>(
             "factory",
             ExprDotMethodChain(symbols.GetAddInitSvc(method))
                 .Get(EPStatementInitServicesConstants.CONTEXTSERVICEFACTORY)
                 .Add("InitTermFactory"))
         .SetProperty(Ref("factory"), "InitTermSpec", detail.MakeCodegen(method, symbols, classScope))
         .MethodReturn(Ref("factory"));
     return method;
 }
Ejemplo n.º 15
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     return new SAIFFInitializeBuilder(
             OP_PACKAGE_NAME + ".epstatementsource.EPStatementSourceFactory",
             this.GetType(),
             "stmtSrc",
             parent,
             symbols,
             classScope)
         .Exprnode("statementDeploymentId", statementDeploymentId)
         .Exprnode("statementName", statementName)
         .Map<object>("statementFilter", statementFilter)
         .Map<object>("collector", collector)
         .Constant("IsSubmitEventBean", submitEventBean)
         .Build();
 }
Ejemplo n.º 16
0
 public void ProvideCodegen(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     method.Block.MethodReturn(
         NewInstance<OutputProcessViewDirectDistinctOrAfterFactory>(
             _outputStrategyPostProcessForge == null
                 ? ConstantNull()
                 : _outputStrategyPostProcessForge.Make(method, symbols, classScope),
             Constant(_isDistinct),
             MultiKeyCodegen.CodegenGetterEventDistinct(
                 _isDistinct, ResultEventType, DistinctMultiKey, method, classScope),
             AfterTimePeriod == null
                 ? ConstantNull()
                 : AfterTimePeriod.TimePeriodComputeForge.MakeEvaluator(method, classScope),
             Constant(AfterConditionNumberOfEvents),
             EventTypeUtility.ResolveTypeCodegen(ResultEventType, symbols.GetAddInitSvc(method))));
 }
Ejemplo n.º 17
0
        private static CodegenExpression MakeWriters(
            VariableTriggerWriteForge[] writers,
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(VariableTriggerWrite[]), typeof(VariableReadWritePackageForge), classScope);

            method.Block.DeclareVar <VariableTriggerWrite[]>("writers", NewArrayByLength(typeof(VariableTriggerWrite), Constant(writers.Length)));
            for (var i = 0; i < writers.Length; i++)
            {
                var writer = writers[i] == null?ConstantNull() : writers[i].Make(method, symbols, classScope);

                method.Block.AssignArrayElement("writers", Constant(i), writer);
            }

            method.Block.MethodReturn(Ref("writers"));
            return(LocalMethod(method));
        }
Ejemplo n.º 18
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(HistoricalIndexLookupStrategyInKeywordSingle), GetType(), classScope);

            method.Block
                .DeclareVar<HistoricalIndexLookupStrategyInKeywordSingle>(
                    "strat",
                    NewInstance(typeof(HistoricalIndexLookupStrategyInKeywordSingle)))
                .SetProperty(Ref("strat"), "LookupStream", Constant(lookupStream))
                .SetProperty(
                    Ref("strat"),
                    "Evaluators",
                    ExprNodeUtilityCodegen.CodegenEvaluators(evaluators, method, GetType(), classScope))
                .MethodReturn(Ref("strat"));
            return LocalMethod(method);
        }
Ejemplo n.º 19
0
 public CodegenMethod InitializeCodegen(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(StatementAgentInstanceFactoryUpdate), GetType(), classScope);
     method.Block
         .DeclareVar<StatementAgentInstanceFactoryUpdate>(
             "saiff",
             NewInstance(typeof(StatementAgentInstanceFactoryUpdate)))
         .SetProperty(Ref("saiff"), "Desc", forge.Make(method, symbols, classScope))
         .SetProperty(
             Ref("saiff"),
             "Subselects",
             SubSelectFactoryForge.CodegenInitMap(subselects, GetType(), method, symbols, classScope))
         .Expression(ExprDotMethodChain(symbols.GetAddInitSvc(method)).Add("AddReadyCallback", Ref("saiff")))
         .MethodReturn(Ref("saiff"));
     return method;
 }
Ejemplo n.º 20
0
 public CodegenMethod InitializeCodegen(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(StatementAgentInstanceFactoryCreateDataflow), GetType(), classScope);
     method.Block
         .DeclareVar<StatementAgentInstanceFactoryCreateDataflow>(
             "saiff",
             NewInstance(typeof(StatementAgentInstanceFactoryCreateDataflow)))
         .SetProperty(
             Ref("saiff"),
             "EventType",
             EventTypeUtility.ResolveTypeCodegen(eventType, symbols.GetAddInitSvc(method)))
         .SetProperty(Ref("saiff"), "Dataflow", dataflowForge.Make(method, symbols, classScope))
         .Expression(ExprDotMethodChain(symbols.GetAddInitSvc(method)).Add("AddReadyCallback", Ref("saiff")))
         .MethodReturn(Ref("saiff"));
     return method;
 }
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(SubordWMatchExprLookupStrategyFactory), GetType(), classScope);
     method.Block
         .DeclareVar<ExprEvaluator>(
             "eval",
             ExprNodeUtilityCodegen.CodegenEvaluatorNoCoerce(exprForge, method, GetType(), classScope))
         .DeclareVar<SubordTableLookupStrategyFactory>(
             "lookup",
             OptionalInnerStrategy.Make(method, symbols, classScope))
         .MethodReturn(
             NewInstance<SubordWMatchExprLookupStrategyIndexedFilteredFactory>(
                 Ref("eval"),
                 Ref("lookup")));
     return LocalMethod(method);
 }
Ejemplo n.º 22
0
 public void MakeMethod(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     CodegenExpressionRef queryMethod = Ref("qm");
     method.Block
         .DeclareVar(TypeOfMethod(), queryMethod.Ref, NewInstance(TypeOfMethod()))
         .SetProperty(
             queryMethod,
             "Annotations",
             annotations == null
                 ? ConstantNull()
                 : LocalMethod(MakeAnnotations(typeof(Attribute[]), annotations, method, classScope)))
         .SetProperty(
             queryMethod, "Processor", processor.Make(method, symbols, classScope))
         .SetProperty(
             queryMethod,
             "QueryGraph",
             queryGraph == null ? ConstantNull() : queryGraph.Make(method, symbols, classScope))
         .SetProperty(
             queryMethod,
             "InternalEventRouteDest",
             ExprDotName(
                 symbols.GetAddInitSvc(method), EPStatementInitServicesConstants.INTERNALEVENTROUTEDEST))
         .SetProperty(
             queryMethod,
             "TableAccesses",
             ExprTableEvalStrategyUtil.CodegenInitMap(
                 tableAccessForges,
                 this.GetType(),
                 method,
                 symbols,
                 classScope))
         .SetProperty(
             queryMethod, "HasTableAccess", Constant(hasTableAccess))
         .SetProperty(
             queryMethod, "Subselects", SubSelectFactoryForge.CodegenInitMap(
                 _subselectForges, GetType(), method, symbols, classScope));
         
     MakeInlineSpecificSetter(queryMethod, method, symbols, classScope);
     method.Block.MethodReturn(queryMethod);
 }
Ejemplo n.º 23
0
        public CodegenExpression MakeCodegen(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(ContextControllerDetailHashItem), GetType(), classScope);
            method.Block.DeclareVar<EventType>(
                "eventType",
                EventTypeUtility.ResolveTypeCodegen(
                    FilterSpecCompiled.FilterForEventType,
                    symbols.GetAddInitSvc(method)));

            var symbolsWithType = new SAIFFInitializeSymbolWEventType();
            var methodLookupableMake = parent.MakeChildWithScope(
                    typeof(ExprFilterSpecLookupable),
                    GetType(),
                    symbolsWithType,
                    classScope)
                .AddParam(typeof(EventType), "eventType")
                .AddParam(typeof(EPStatementInitServices), SAIFFInitializeSymbol.REF_STMTINITSVC.Ref);
            var methodLookupable = Lookupable.MakeCodegen(methodLookupableMake, symbolsWithType, classScope);
            methodLookupableMake.Block.MethodReturn(LocalMethod(methodLookupable));

            method.Block
                .DeclareVar<ContextControllerDetailHashItem>(
                    "item",
                    NewInstance(typeof(ContextControllerDetailHashItem)))
                .DeclareVar<ExprFilterSpecLookupable>(
                    "lookupable",
                    LocalMethod(methodLookupableMake, Ref("eventType"), symbols.GetAddInitSvc(method)))
                .SetProperty(
                    Ref("item"),
                    "FilterSpecActivatable",
                    LocalMethod(FilterSpecCompiled.MakeCodegen(method, symbols, classScope)))
                .SetProperty(Ref("item"), "Lookupable", Ref("lookupable"))
                .Expression(
                    ExprDotMethodChain(symbols.GetAddInitSvc(method))
                        .Get(EPStatementInitServicesConstants.FILTERSHAREDLOOKUPABLEREGISTERY)
                        .Add("RegisterLookupable", Ref("eventType"), Ref("lookupable")))
                .MethodReturn(Ref("item"));

            return LocalMethod(method);
        }
Ejemplo n.º 24
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(VariableReadWritePackage), GetType(), classScope);
            var @ref   = Ref("rw");

            method.Block
            .DeclareVar <VariableReadWritePackage>(@ref.Ref, NewInstance <VariableReadWritePackage>())
            .SetProperty(@ref, "CopyMethods", MakeCopyMethods(_copyMethods, method, symbols, classScope))
            .SetProperty(@ref, "Assignments", MakeAssignments(_assignments, _variables, method, symbols, classScope))
            .SetProperty(@ref, "Variables", MakeVariables(_variables, method, symbols, classScope))
            .SetProperty(@ref, "Writers", MakeWriters(_writers, method, symbols, classScope))
            .SetProperty(@ref, "ReadersForGlobalVars", MakeReadersForGlobalVars(_variables, method, symbols, classScope))
            .SetProperty(@ref, "MustCoerce", Constant(_mustCoerce))
            .MethodReturn(@ref);
            return(LocalMethod(method));
        }
Ejemplo n.º 25
0
 public CodegenExpression Make(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var resolveTable = table == null
         ? ConstantNull()
         : TableDeployTimeResolver.MakeResolveTable(table, symbols.GetAddInitSvc(method));
     var insertIntoStreamSelectorExpr = insertIntoStreamSelector == null
         ? ConstantNull()
         : EnumValue(typeof(SelectClauseStreamSelectorEnum), insertIntoStreamSelector.Value.GetName());
     
     return NewInstance<OutputStrategyPostProcessFactory>(
         Constant(isRouted),
         insertIntoStreamSelectorExpr,
         EnumValue(typeof(SelectClauseStreamSelectorEnum), selectStreamSelector.GetName()),
         Constant(routeToFront),
         resolveTable);
 }
Ejemplo n.º 26
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(EvalClass, GetType(), classScope);
     method.Block
         .DeclareVar(EvalClass, "eval", NewInstance(EvalClass))
         .SetProperty(Ref("eval"), "NodeNumNested", Constant(NodeNumNested))
         .SetProperty(Ref("eval"), "VariableName", Constant(VariableName))
         .SetProperty(Ref("eval"), "StreamNum", Constant(StreamNum))
         .SetProperty(Ref("eval"), "IsMultiple", Constant(IsMultiple))
         .SetProperty(Ref("eval"), "IsGreedy", Constant(IsGreedy))
         .SetProperty(Ref("eval"), "NodeNumFlat", Constant(NodeNumFlat))
         .SetProperty(Ref("eval"), "IsExprRequiresMultimatchState", Constant(exprRequiresMultimatchState));
     AssignInline(Ref("eval"), method, symbols, classScope);
     method.Block.MethodReturn(Ref("eval"));
     return LocalMethod(method);
 }
Ejemplo n.º 27
0
 protected override CodegenMethod CodegenConstructorInit(
     CodegenMethodScope parent,
     CodegenClassScope classScope)
 {
     var saiffInitializeSymbol = new SAIFFInitializeSymbol();
     CodegenMethod method = parent
         .MakeChildWithScope(TypeOfFactory(), GetType(), saiffInitializeSymbol, classScope)
         .AddParam(
             typeof(EPStatementInitServices),
             REF_STMTINITSVC.Ref);
     method.Block
         .ExprDotMethod(
             REF_STMTINITSVC,
             "ActivateContext",
             Constant(contextName),
             GetDefinition(method, saiffInitializeSymbol, classScope))
         .MethodReturn(LocalMethod(forge.InitializeCodegen(classScope, method, saiffInitializeSymbol)));
     return method;
 }
        public override CodegenExpression Codegen(
            InternalEventRouterWriterForge writer,
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(InternalEventRouterWriterCurly), GetType(), classScope);
            var descExpr = ExprNodeUtilityCodegen.CodegenEvaluator(
                _expression.Forge,
                method,
                typeof(VariableTriggerWriteArrayElementForge),
                classScope);

            method.Block
                .DeclareVar<InternalEventRouterWriterCurly>("desc", NewInstance(typeof(InternalEventRouterWriterCurly)))
                .SetProperty(Ref("desc"), "Expression", descExpr)
                .MethodReturn(Ref("desc"));
            return LocalMethod(method);
        }
        protected internal static CodegenExpression MakeWhere(
            ExprForge[] whereClauses,
            CodegenMethod method,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            CodegenExpression[] expressions = new CodegenExpression[whereClauses.Length];
            for (int i = 0; i < whereClauses.Length; i++) {
                expressions[i] = whereClauses[i] == null
                    ? ConstantNull()
                    : ExprNodeUtilityCodegen.CodegenEvaluator(
                        whereClauses[i],
                        method,
                        typeof(PropertyEvaluatorAccumulativeForge),
                        classScope);
            }

            return NewArrayWithInit(typeof(ExprEvaluator), expressions);
        }
Ejemplo n.º 30
0
 public CodegenMethod InitializeCodegen(
     CodegenClassScope classScope,
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols)
 {
     var method = parent.MakeChild(typeof(StatementAgentInstanceFactoryCreateContext), GetType(), classScope);
     method.Block
         .DeclareVar<StatementAgentInstanceFactoryCreateContext>(
             "saiff",
             NewInstance(typeof(StatementAgentInstanceFactoryCreateContext)))
         .SetProperty(Ref("saiff"), "ContextName", Constant(contextName))
         .SetProperty(
             Ref("saiff"),
             "StatementEventType",
             EventTypeUtility.ResolveTypeCodegen(statementEventType, symbols.GetAddInitSvc(method)))
         .ExprDotMethod(symbols.GetAddInitSvc(method), "AddReadyCallback", Ref("saiff"))
         .MethodReturn(Ref("saiff"));
     return method;
 }