示例#1
0
        public CodegenExpressionRef GetAddInitSvc(CodegenMethodScope scope)
        {
            if (optionalInitServicesRef == null) {
                optionalInitServicesRef = REF_INITSVC;
            }

            scope.AddSymbol(optionalInitServicesRef);
            return optionalInitServicesRef;
        }
示例#2
0
        public CodegenExpressionRef GetAddLeftResult(CodegenMethodScope scope)
        {
            if (optionalLeftResult == null) {
                optionalLeftResult = REF_LEFTRESULT;
            }

            scope.AddSymbol(optionalLeftResult);
            return optionalLeftResult;
        }
        public CodegenExpressionRef GetAddEventType(CodegenMethodScope scope)
        {
            if (optionalEventTypeRef == null) {
                optionalEventTypeRef = REF_EVENTTYPE;
            }

            scope.AddSymbol(optionalEventTypeRef);
            return optionalEventTypeRef;
        }
        public CodegenExpressionRef GetAddEvent(CodegenMethodScope scope)
        {
            if (optionalEventRef == null) {
                optionalEventRef = Ref("@event");
            }

            scope.AddSymbol(optionalEventRef);
            return optionalEventRef;
        }
示例#5
0
        public CodegenExpressionRef GetAddMatchingEvents(CodegenMethodScope scope)
        {
            if (optionalMatchingEventRef == null) {
                optionalMatchingEventRef = REF_MATCHINGEVENTS;
            }

            scope.AddSymbol(optionalMatchingEventRef);
            return optionalMatchingEventRef;
        }
        public CodegenExpressionRef GetAddExprEvalCtx(CodegenMethodScope scope)
        {
            if (optionalExprEvalCtxRef == null) {
                optionalExprEvalCtxRef = ExprForgeCodegenNames.REF_EXPREVALCONTEXT;
            }

            scope.AddSymbol(optionalExprEvalCtxRef);
            return optionalExprEvalCtxRef;
        }
示例#7
0
        public CodegenExpressionRef GetAddState(CodegenMethodScope scope)
        {
            if (optionalStateRef == null) {
                optionalStateRef = REF_AGENTSTATE;
            }

            scope.AddSymbol(optionalStateRef);
            return optionalStateRef;
        }
示例#8
0
        // --------------------------------------------------------------------------------
        // Adding the following elements to scope is a fundamental wash because the
        // scope for a lambda is the same as it's parent (assuming we're dealing with
        // a lambda).
        // --------------------------------------------------------------------------------

        public CodegenExpressionRef GetAddEPS(CodegenMethodScope scope)
        {
            if (optionalEPSRef == null) {
                optionalEPSRef = ExprForgeCodegenNames.REF_EPS;
            }

            scope.AddSymbol(optionalEPSRef);
            return optionalEPSRef;
        }
示例#9
0
        public CodegenExpression GetAddIsNewData(CodegenMethodScope scope)
        {
            if (newDataValue != null) { // new-data can be a const
                return Constant(newDataValue);
            }

            if (optionalIsNewDataRef == null) {
                optionalIsNewDataRef = ExprForgeCodegenNames.REF_ISNEWDATA;
            }

            scope.AddSymbol(optionalIsNewDataRef);
            return optionalIsNewDataRef;
        }
示例#10
0
        // --------------------------------------------------------------------------------

        public CodegenExpressionRef GetAddRequiredUnderlying(
            CodegenMethodScope scope,
            int streamNum,
            EventType eventType,
            bool optionalEvent)
        {
            if (underlyingStreamNums.IsEmpty()) {
                underlyingStreamNums = new Dictionary<int, EventTypeWithOptionalFlag>();
            }

            var existing = underlyingStreamNums.Get(streamNum);
            if (existing != null) {
                scope.AddSymbol(existing.Ref);
                return existing.Ref;
            }

            var assigned = Ref("u" + currentParamNum);
            underlyingStreamNums.Put(streamNum, new EventTypeWithOptionalFlag(assigned, eventType, optionalEvent));
            currentParamNum++;
            scope.AddSymbol(assigned);
            return assigned;
        }