예제 #1
0
파일: ScopeNode.cs 프로젝트: MilkTool/chela
        public void AddFirst(AstNode child)
        {
            if (child == null)
            {
                return;
            }

            if (this.children == null)
            {
                this.children = child;
                return;
            }

            // Add my children to the end of the list.
            AstNode lastChild = child;

            while (lastChild.GetNext() != null)
            {
                lastChild = lastChild.GetNext();
            }
            lastChild.SetNext(children);

            // Set the first.
            children = child;
        }
예제 #2
0
파일: ScopeNode.cs 프로젝트: MilkTool/chela
        public void AddLast(AstNode child)
        {
            if (child == null)
            {
                return;
            }

            if (this.children == null)
            {
                this.children = child;
                return;
            }

            AstNode lastChild = this.children;

            while (lastChild.GetNext() != null)
            {
                lastChild = lastChild.GetNext();
            }
            lastChild.SetNext(child);
        }
예제 #3
0
 protected void VisitList(AstNode list)
 {
     try
     {
         while (list != null)
         {
             list.Accept(this);
             list = list.GetNext();
         }
     }
     catch (System.SystemException sysException)
     {
         System.Console.WriteLine("Compiler bug near {0}", list.GetPosition().ToString());
         System.Console.WriteLine(sysException.ToString());
         System.Console.WriteLine(sysException.StackTrace);
         System.Environment.Exit(-1);
     }
 }
예제 #4
0
 protected void VisitList(AstNode list)
 {
     try
     {
         while(list != null)
         {
             list.Accept(this);
             list = list.GetNext();
         }
     }
     catch(System.SystemException sysException)
     {
         System.Console.WriteLine("Compiler bug near {0}", list.GetPosition().ToString());
         System.Console.WriteLine(sysException.ToString());
         System.Console.WriteLine(sysException.StackTrace);
         System.Environment.Exit(-1);
     }
 }