Exemplo n.º 1
0
        private void AddLocation(ValueLocation location)
        {
            LocationCollectorNode nextNode = node.CreateValueChild(location);

            nextNode.IsMust = isMust;
            treeIndexCollector.AddNode(nextNode);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Collects the temporary variables.
        /// </summary>
        /// <param name="treeIndexCollector">The tree index collector.</param>
        /// <param name="temporaryPathSegment">The temporary path segment.</param>
        /// <exception cref="System.NotImplementedException">Temporary memory index is visited more than once</exception>
        public void CollectTemporary(TreeIndexCollector treeIndexCollector, TemporaryPathSegment temporaryPathSegment)
        {
            if (TemporaryNodes.ContainsKey(temporaryPathSegment.TemporaryIndex))
            {
                throw new NotImplementedException("Temporary memory index is visited more than once");
            }

            MemoryIndexCollectorNode node = new MemoryIndexCollectorNode(temporaryPathSegment.TemporaryIndex);

            node.IsMust = true;
            TemporaryNodes.Add(temporaryPathSegment.TemporaryIndex, node);
            treeIndexCollector.AddNode(node);
            HasRootNode = true;
        }
Exemplo n.º 3
0
            public void VisitTemporaryIndex(TemporaryIndex index)
            {
                MemoryIndexCollectorNode node;

                if (!rootNode.TemporaryNodes.TryGetValue(index.RootIndex, out node))
                {
                    MemoryIndexCollectorNode newNode = new MemoryIndexCollectorNode(index.RootIndex);
                    newNode.IsMust = isMust;
                    rootNode.TemporaryNodes.Add(index.RootIndex, newNode);

                    currentNode = newNode;
                }
                else
                {
                    currentNode = node;
                }

                processIndexPath(index);

                if (!processAlias(index))
                {
                    if (isMust)
                    {
                        rootNode.TemporaryNodes.Remove(index.RootIndex);

                        MemoryIndexCollectorNode newNode = new MemoryIndexCollectorNode(index.RootIndex);
                        newNode.IsMust = isMust;
                        rootNode.TemporaryNodes.Add(index.RootIndex, newNode);
                    }
                    else
                    {
                        MemoryIndexCollectorNode childNode = rootNode.TemporaryNodes[index.RootIndex];

                        collector.AddNode(childNode);
                        childNode.TargetIndex = index;
                        childNode.SourceIndex = index;
                        childNode.IsMust      = false;
                    }
                }
            }