Example #1
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     ModuleTableInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(TableMetaData), GetType(), classScope);
     method.Block
         .DeclareVar<TableMetaData>("meta", NewInstance(typeof(TableMetaData)))
         .SetProperty(Ref("meta"), "TableName", Constant(TableName))
         .SetProperty(Ref("meta"), "TableModuleName", Constant(TableModuleName))
         .SetProperty(Ref("meta"), "TableVisibility", Constant(TableVisibility))
         .SetProperty(Ref("meta"), "OptionalContextName", Constant(OptionalContextName))
         .SetProperty(Ref("meta"), "OptionalContextVisibility", Constant(OptionalContextVisibility))
         .SetProperty(Ref("meta"), "OptionalContextModule", Constant(OptionalContextModule))
         .SetProperty(
             Ref("meta"),
             "InternalEventType",
             EventTypeUtility.ResolveTypeCodegen(InternalEventType, symbols.GetAddInitSvc(method)))
         .SetProperty(
             Ref("meta"),
             "PublicEventType",
             EventTypeUtility.ResolveTypeCodegen(PublicEventType, symbols.GetAddInitSvc(method)))
         .SetProperty(Ref("meta"), "KeyColumns", Constant(KeyColumns))
         .SetProperty(Ref("meta"), "KeyTypes", Constant(KeyTypes))
         .SetProperty(Ref("meta"), "KeyColNums", Constant(KeyColNums))
         .SetProperty(
             Ref("meta"),
             "Columns",
             TableMetadataColumn.MakeColumns(Columns, method, symbols, classScope))
         .SetProperty(Ref("meta"), "NumMethodAggs", Constant(NumMethodAggs))
         .ExprDotMethod(Ref("meta"), "Init")
         .MethodReturn(Ref("meta"));
     return LocalMethod(method);
 }
        protected override CodegenExpression Make(
            CodegenMethodScope parent,
            ModuleTableInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(TableMetadataColumnAggregation), GetType(), classScope);
            method.Block.DeclareVar<TableMetadataColumnAggregation>(
                "col",
                NewInstance(typeof(TableMetadataColumnAggregation)));

            base.MakeSettersInline(Ref("col"), method.Block);
            method.Block
                .SetProperty(Ref("col"), "Column", Constant(Column))
                .SetProperty(
                    Ref("col"),
                    "AggregationPortableValidation",
                    AggregationPortableValidation.Make(method, symbols, classScope))
                .SetProperty(Ref("col"), "AggregationExpression", Constant(AggregationExpression))
                .SetProperty(Ref("col"), "IsMethodAgg", Constant(IsMethodAgg))
                .SetProperty(
                    Ref("col"),
                    "OptionalEnumerationType",
                    OptionalEnumerationType == null
                        ? ConstantNull()
                        : OptionalEnumerationType.Codegen(method, classScope, symbols.GetAddInitSvc(method)))
                .MethodReturn(Ref("col"));
            return LocalMethod(method);
        }
Example #3
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     ModuleTableInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(AggregationPortableValidationLinear), GetType(), classScope);
     method.Block
         .DeclareVar<AggregationPortableValidationLinear>(
             "v",
             NewInstance(typeof(AggregationPortableValidationLinear)))
         .SetProperty(
             Ref("v"),
             "ContainedEventType",
             EventTypeUtility.ResolveTypeCodegen(ContainedEventType, symbols.GetAddInitSvc(method)))
         .MethodReturn(Ref("v"));
     return LocalMethod(method);
 }
 private static CodegenMethod RegisterTableCodegen(
     KeyValuePair<string, TableMetaData> table,
     CodegenMethodScope parent,
     CodegenClassScope classScope,
     ModuleTableInitializeSymbol symbols)
 {
     var method = parent.MakeChild(typeof(void), typeof(EPCompilerImpl), classScope);
     method.Block
         .DeclareVar<TableMetaData>("detail", table.Value.Make(parent, symbols, classScope))
         .Expression(
             ExprDotMethodChain(symbols.GetAddInitSvc(method))
                 .Get(EPModuleTableInitServicesConstants.GETTABLECOLLECTOR)
                 .Add(
                     "RegisterTable",
                     Constant(table.Key),
                     Ref("detail")));
     return method;
 }