public void setChildWithTokens(int index, LinkedListTree child) { LinkedListTree oldChild = (LinkedListTree)GetChild(index); setChild(index, child); tokenListUpdater.ReplacedChild(this, index, child, oldChild); }
/** * called when one of this node's children updates it's stop-token, * so that this node can potentially take action; maybe by setting * the same stop-token IF the child was the very-last in this node's * list of children. */ private void notifyChildStopTokenChange(LinkedListTree child, LinkedListToken newStop) { // TODO: maybe move to delegates if (isLast(child) && (isSameStopToken(child) || isNoStopToken(child))) { setStopToken(newStop); } }
/** * called when one of this node's children updates it's start-token, * so that this node can potentially take action; maybe by setting * the same start-token IF the child was the very-first in this node's * list of children. */ private void notifyChildStartTokenChange(LinkedListTree child, LinkedListToken newStart) { // TODO: maybe move to delegates if (isFirst(child) && isSameStartToken(child)) { setStartToken(newStart); } }
public BaseTree deleteChild(int index) { LinkedListTree result = (LinkedListTree)base.DeleteChild(index); tokenListUpdater.DeletedChild(this, index, result); result.Parent = null; return(result); }
public void addChildWithTokens(int index, LinkedListTree child) { if (Children == null) { CreateChildrenList(); } Children.Add(child); if (child != null) { child.Parent = this; } tokenListUpdater.AddedChild(this, index, child); }
public int getIndexOfChild(LinkedListTree child) { return Children.IndexOf(child); }
/** * Adds the given child node to the end of the list of children * maintanined by the given parent node, and inserts the tokens * belonging to child into the tokenlist of parent just after the * stop-token of the previous last child. */ public void addChildWithTokens(LinkedListTree child) { addChild(child); tokenListUpdater.AddedChild(this, child); }
private bool isSameStopToken(LinkedListTree child) { return child.getStopToken() == getStopToken(); }
private bool isNoStopToken(LinkedListTree child) { return(child.getStopToken() == null); }
private bool isLast(LinkedListTree child) { return child == getLastChild(); }
private bool isSameStopToken(LinkedListTree child) { return(child.getStopToken() == getStopToken()); }
private bool isNoStopToken(LinkedListTree child) { return child.getStopToken() == null; }
private bool isLast(LinkedListTree child) { return(child == getLastChild()); }
public LinkedListTree(LinkedListTree node) : base(node) { this.token = node.token; }
public int getIndexOfChild(LinkedListTree child) { return(Children.IndexOf(child)); }