예제 #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);
        }