Esempio n. 1
0
        /// <summary>
        /// Visits the variable to traverse memory tree from variable root.
        /// </summary>
        /// <param name="variableSegment">The variable segment.</param>
        public void VisitVariable(VariablePathSegment variableSegment)
        {
            switch (Global)
            {
            case GlobalContext.LocalOnly:
                int level = CallLevel;
                if (CallLevel > snapshot.CallLevel)
                {
                    level = snapshot.CallLevel;
                }

                process(variableSegment,
                        snapshot.Structure.Readonly.
                        GetReadonlyStackContext(level).ReadonlyVariables);
                break;

            case GlobalContext.GlobalOnly:
                process(variableSegment,
                        snapshot.Structure.Readonly.
                        ReadonlyGlobalContext.ReadonlyVariables);
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Collects the variable.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="variableSegment">The variable segment.</param>
        public void CollectVariable(TreeIndexCollector collector, VariablePathSegment variableSegment)
        {
            int currentCallLevel = collector.GetCurrentCallLevel();
            ContainerCollectorNode variableStackNode = GetOrCreateVariableStackNode(collector, currentCallLevel);

            variableStackNode.Collect(collector, variableSegment);
            HasRootNode = true;
        }
Esempio n. 3
0
 public void VisitVariable(VariablePathSegment variableSegment)
 {
     if (!RootNode.HasRootNode)
     {
         RootNode.CollectVariable(this, variableSegment);
     }
     else
     {
         throw new Exception("Malformed MemoryPath - duplicit root segment");
     }
 }
Esempio n. 4
0
            /// <summary>
            /// Visits the variable.
            /// </summary>
            /// <param name="variableSegment">The variable segment.</param>
            public void VisitVariable(VariablePathSegment variableSegment)
            {
                switch (collector.Global)
                {
                case GlobalContext.LocalOnly:
                    CreatedIndex = snapshot.CreateLocalVariable(Name, collector.CallLevel);
                    break;

                case GlobalContext.GlobalOnly:
                    CreatedIndex = snapshot.CreateGlobalVariable(Name);
                    break;

                default:
                    break;
                }
            }
Esempio n. 5
0
        /// <summary>
        /// Visits the variable to traverse memory tree from variable root.
        /// </summary>
        /// <param name="segment">The segment.</param>
        public void VisitVariable(VariablePathSegment segment)
        {
            switch (Global)
            {
            case GlobalContext.LocalOnly:
                processSegment(segment, snapshot.Structure.Readonly.
                               GetReadonlyStackContext(CallLevel).ReadonlyVariables);
                break;

            case GlobalContext.GlobalOnly:
                processSegment(segment, snapshot.Structure.Readonly.ReadonlyGlobalContext.ReadonlyVariables);
                break;

            default:
                break;
            }
        }