Esempio n. 1
0
        private void PushNewScope(Scope newScope, string nameOfNewMemorySpace, AST startNode)
        {
            Debug.Assert(newScope != null);
            Debug.Assert(startNode != null);
#if WRITE_DEBUG_INFO
            Console.WriteLine("Pushed new scope " + newScope.getName());
#endif
            m_currentScope = newScope;
            m_memorySpaceStack.Push(m_currentMemorySpace);
            m_currentMemorySpace = new MemorySpace(nameOfNewMemorySpace, startNode, m_currentScope, m_memorySpaceNodeListCache);
            m_currentScope.PushMemorySpace(m_currentMemorySpace);
        }
Esempio n. 2
0
        public void TraceParentScopes()
        {
            Console.Write("Parent scopes of " + getName() + ": ");
            Scope s = m_scope;

            while (s != null)
            {
                Console.Write(s.getName() + ", ");
                s = s.getEnclosingScope();
            }
            Console.WriteLine("");
        }