Example #1
0
        public MemorySpace(string name, AST root, Scope scope, MemorySpaceNodeListCache cache)
        {
            Debug.Assert(name != null);
            Debug.Assert(root != null);
            Debug.Assert(scope != null);
            Debug.Assert(cache != null);

            m_name  = name;
            m_scope = scope;
            m_cache = cache;

            //Console.WriteLine("Creating list of nodes from tree: " + root.getTreeAsString());

            if (m_cache.hasCachedFunction(root))
            {
                //Console.WriteLine("Found cached list for " + m_name);
                m_nodes = m_cache.getList(root).ToArray();
            }
            else
            {
                List <AST> list = new List <AST>();
                addToList(list, root);
                m_cache.addMemorySpaceList(list, root);
                m_nodes = list.ToArray();
                //Console.WriteLine("Created new list for " + m_name);
            }

            m_currentNode = -1;

            //Console.WriteLine("New memory space " + name + " has got " + list.Count + " AST nodes in its list.");
        }
Example #2
0
        public MemorySpace(string name, AST root, Scope scope, MemorySpaceNodeListCache cache)
        {
            Debug.Assert(name != null);
            Debug.Assert(root != null);
            Debug.Assert(scope != null);
            Debug.Assert(cache != null);

            m_name = name;
            m_scope = scope;
            m_cache = cache;

            //Console.WriteLine("Creating list of nodes from tree: " + root.getTreeAsString());

            if(m_cache.hasCachedFunction(root)) {
                //Console.WriteLine("Found cached list for " + m_name);
                m_nodes = m_cache.getList(root).ToArray();
            }
            else {
                List<AST> list = new List<AST>();
                addToList(list, root);
                m_cache.addMemorySpaceList(list, root);
                m_nodes = list.ToArray();
                //Console.WriteLine("Created new list for " + m_name);
            }

            m_currentNode = -1;

            //Console.WriteLine("New memory space " + name + " has got " + list.Count + " AST nodes in its list.");
        }
Example #3
0
 public void Delete()
 {
     m_name = "";
     m_valuesForStrings = null;
     m_nodes = null;
     m_currentNode = -1;
     m_scope = null;
     m_cache = null;
 }