• Home
  • Raw
  • Download

Lines Matching full:children

41      *  actually have any user data.  ANTLR v3 uses a list of children approach
43 * an empty node whose children represent the list. An empty, but
49 List<ITree> children; field in Antlr.Runtime.Tree.BaseTree
56 * as there are no fields other than the children list, which cannot
57 * be copied as the children are not considered part of this node.
64 * Get the children internal List; note that if you directly mess with
68 public virtual IList<ITree> Children { property in Antlr.Runtime.Tree.BaseTree
70 return children;
78 if (Children == null)
81 return Children.Count;
145 if (children == null || i >= children.Count) in GetChild()
148 return children[i]; in GetChild()
152 foreach (ITree child in children) { in GetFirstChildWithType()
163 * Warning: if t has no children, but child does
164 * and child isNil then this routine moves children to t via
165 * t.children = child.children; i.e., without copying the array.
170 //System.out.println("existing children: "+children); in AddChild()
175 // t is an empty node possibly with children in AddChild()
177 … if (childTree != null && this.children != null && this.children == childTree.children) { in AddChild()
180 // just add all of childTree's children to this in AddChild()
182 if (this.children != null || childTree == null) { in AddChild()
183 if (this.children == null) in AddChild()
184 this.children = CreateChildrenList(); in AddChild()
186 // must copy, this has children already in AddChild()
190 this.children.Add(c); in AddChild()
193 c.ChildIndex = children.Count - 1; in AddChild()
196 // no children for this but t is a BaseTree with children; in AddChild()
198 this.children = childTree.children; in AddChild()
203 // child is not nil (don't care about children) in AddChild()
204 if (children == null) { in AddChild()
205 children = CreateChildrenList(); // create children list on demand in AddChild()
207 children.Add(t); in AddChild()
209 t.ChildIndex = children.Count - 1; in AddChild()
211 // System.out.println("now children are: "+children); in AddChild()
214 /** <summary>Add all elements of kids list as children of this node</summary> */
233 if (children == null) { in SetChild()
234 children = CreateChildrenList(); in SetChild()
236 children[i] = t; in SetChild()
247 if (children == null) in DeleteChild()
250 ITree killed = children[i]; in DeleteChild()
251 children.RemoveAt(i); in DeleteChild()
258 * Delete children from start to stop and replace with t even if t is
259 * a list (nil-root tree). num of children can increase or decrease.
260 * For huge child lists, inserting children can force walking rest of
261 * children to set their childindex; could be slow.
279 if (children == null) { in ReplaceChildren()
280 throw new ArgumentException("indexes invalid; no children in list"); in ReplaceChildren()
286 // normalize to a list of children to add: newChildren in ReplaceChildren()
289 if (baseTree != null && baseTree.children != null) { in ReplaceChildren()
290 newChildren = baseTree.children; in ReplaceChildren()
306 int j = 0; // index into new children in ReplaceChildren()
309 children[i] = child; in ReplaceChildren()
316 // set children and then delete extra in ReplaceChildren()
318 children[startChildIndex + j] = newChildren[j]; in ReplaceChildren()
323 children.RemoveAt(indexToDelete); in ReplaceChildren()
328 // fill in as many children as we can (replacingHowMany) w/o moving data in ReplaceChildren()
330 children[startChildIndex + j] = newChildren[j]; in ReplaceChildren()
334 children.Insert(startChildIndex + j, newChildren[j]); in ReplaceChildren()
341 /** <summary>Override in a subclass to change the impl of children list</summary> */
416 if (children == null || children.Count == 0) { in ToStringTree()
425 for (int i = 0; children != null && i < children.Count; i++) { in ToStringTree()
426 ITree t = children[i]; in ToStringTree()