Esempio n. 1
0
        /// <inheritdoc/>
        public override void DiscoverAllAnnotations(IList <RuleInstance> result)
        {
            base.DiscoverAllAnnotations(result);

            Name?.DiscoverAllAnnotations(result);

            if (!InheritanceItems.IsNullOrEmpty())
            {
                foreach (var item in InheritanceItems)
                {
                    item.DiscoverAllAnnotations(result);
                }
            }

            RuleInstance?.DiscoverAllAnnotations(result);
            InlineTrigger?.DiscoverAllAnnotations(result);
            Operator?.DiscoverAllAnnotations(result);
            Channel?.DiscoverAllAnnotations(result);
            NamedFunction?.DiscoverAllAnnotations(result);

            if (!SubItems.IsNullOrEmpty())
            {
                foreach (var item in SubItems)
                {
                    item.DiscoverAllAnnotations(result);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Clones the instance using special context and returns cloned instance.
        /// </summary>
        /// <param name="context">Special context for providing references continuity.</param>
        /// <returns>Cloned instance.</returns>
        public CodeEntity Clone(Dictionary <object, object> context)
        {
            if (context.ContainsKey(this))
            {
                return((CodeEntity)context[this]);
            }

            var result = new CodeEntity();

            context[this] = result;

            result.Kind               = Kind;
            result.Name               = Name?.Clone(context);
            result.InheritanceItems   = InheritanceItems?.Select(p => p.Clone(context)).ToList();
            result.RuleInstance       = RuleInstance?.Clone(context);
            result.InlineTrigger      = InlineTrigger?.Clone(context);
            result.Operator           = Operator?.Clone(context);
            result.Channel            = Channel?.Clone(context);
            result.LinguisticVariable = LinguisticVariable?.Clone(context);
            result.NamedFunction      = NamedFunction?.Clone(context);

            result.CodeFile         = CodeFile;
            result.ParentCodeEntity = ParentCodeEntity;
            result.SubItems         = SubItems?.Select(p => p.Clone(context)).ToList();

            result.AppendAnnotations(this, context);

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Clones the instance using special context and returns cloned instance.
        /// </summary>
        /// <param name="context">Special context for providing references continuity.</param>
        /// <returns>Cloned instance.</returns>
        public InlineTrigger Clone(Dictionary <object, object> context)
        {
            if (context.ContainsKey(this))
            {
                return((InlineTrigger)context[this]);
            }

            var result = new InlineTrigger();

            context[this] = result;

            result.Kind = Kind;
            result.KindOfSystemEvent = KindOfSystemEvent;
            result.Condition         = Condition?.Clone(context);
            result.BindingVariables  = BindingVariables.Clone(context);
            result.Statements        = Statements.Select(p => p.CloneAstStatement(context)).ToList();

            result.CodeEntity           = CodeEntity.Clone(context);
            result.CompiledFunctionBody = CompiledFunctionBody.Clone(context);
            result.AppendAnnotations(this, context);

            return(result);
        }