Microsoft.R.Core.AST.AstNode.AppendChild C# (CSharp) Method

AppendChild() public method

public AppendChild ( IAstNode child ) : void
child IAstNode
return void
        public void AppendChild(IAstNode child) {
            if (child.Parent == null) {
                child.Parent = this;
            } else if (child.Parent == this) {
#if DEBUG
                //foreach (var c in _children)
                //{
                //    Debug.Assert(!TextRange.Intersect(c, child), "Children collection already contains overlapping node");
                //}
#endif
                _children.AddSorted(child);
            } else {
                throw new InvalidOperationException("Node already has parent");
            }
        }