public ParseNodeDrawable(ParseNodeDrawable parent, ParseNodeDrawable child, string symbol) { this.children = new List <ParseNode>(); this.depth = child.depth; child.UpdateDepths(this.depth + 1); this.parent = parent; this.parent.SetChild(parent.GetChildIndex(child), this); this.children.Add(child); child.parent = this; this.data = new Symbol(symbol); }
public void ReplaceChild(ParseNodeDrawable oldChild, ParseNodeDrawable newChild) { newChild.UpdateDepths(this.depth + 1); newChild.parent = this; children[children.IndexOf(oldChild)] = newChild; }