Lines Matching refs:child
108 even use Token objects as trees if you add a child list to your tokens.
123 """Tree tracks parent and child index now > 3.0"""
128 """Tree tracks parent and child index now > 3.0"""
154 """This node is what child index? 0..n-1"""
159 """This node is what child index? 0..n-1"""
165 """Set the parent and child index values for all children"""
172 Add t as a child to this node. If t is null, do nothing. If t
180 """Set ith child (0..n-1) to t; t must be non-null and non-nil node"""
193 For huge child lists, inserting children can force walking rest of
343 """Is tree considered a nil node used to make lists of child nodes?"""
348 def addChild(self, t, child):
350 Add a child to the tree t. If child is a flat tree (a list), make all
351 in list children of t. Warning: if t has no children, but child does
352 and child isNil then you can decide it is ok to move children to t via
353 t.children = child.children; i.e., without copying the array. Just
355 ASTs. Do nothing if t or child is null.
364 If not a nil root, make oldRoot a child of newRoot.
369 If newRoot is a nil-rooted single child tree, use the single
370 child as the new root node.
381 simple node or nil root with a single child node--it must be a root
520 """Get a child 0..n-1 node"""
525 def setChild(self, t, i, child):
526 """Set ith child (0..n-1) to t; t must be non-null and non-nil node"""
532 """Remove ith child and shift children down from right."""
565 What index is this node in the child list? Range: 0..n-1
575 What index is this node in the child list? Range: 0..n-1
585 Replace from start to stop child index of parent with t, which might
673 instead of the child-sibling approach in v2. A flat tree (a list) is
714 for child in self.children:
715 if child.getType() == treeType:
716 return child
726 """Add t as child of this node.
728 Warning: if t has no children, but child does
729 and child isNil then this routine moves children to t via
730 t.children = child.children; i.e., without copying the array.
743 raise ValueError("attempt to add child list to itself")
746 for idx, child in enumerate(childTree.children):
747 child.parent = self
748 child.childIndex = len(self.children) + idx
753 # child is not nil (don't care about children)
770 raise ValueError("Can't set single child to a list")
782 # walk rest and decrement their child indexes
783 for idx, child in enumerate(self.children[i:]):
784 child.childIndex = i + idx
793 For huge child lists, inserting children can force walking rest of
816 for idx, child in enumerate(newChildren):
817 self.children[idx + startChildIndex] = child
818 child.parent = self
819 child.childIndex = idx + startChildIndex
839 for idx, child in enumerate(self.children[offset:]):
840 child.childIndex = idx + offset
841 child.parent = self
852 "child indexes don't match; expected {} found {}"
855 for idx, child in enumerate(self.children):
856 child.sanityCheckParentAndChildIndexes(self, idx)
860 """BaseTree doesn't track child indexes."""
866 """BaseTree doesn't track child indexes."""
926 for i, child in enumerate(self.children):
929 buf.append(child.toStringTree())
998 # ensure new subtree root has parent/child index set
1006 child = self.getChild(t, i)
1007 newSubTree = self.dupTree(child, t)
1013 def addChild(self, tree, child):
1015 Add a child to the tree t. If child is a flat tree (a list), make all
1016 in list children of t. Warning: if t has no children, but child does
1017 and child isNil then you can decide it is ok to move children to t via
1018 t.children = child.children; i.e., without copying the array. Just
1023 #if isinstance(child, Token):
1024 # child = self.createWithPayload(child)
1026 if tree is not None and child is not None:
1027 tree.addChild(child)
1033 If not a nil root, make oldRoot a child of newRoot.
1038 If newRoot is a nil-rooted single child tree, use the single
1039 child as the new root node.
1050 simple node or nil root with a single child node--it must be a root
1094 # whoever invokes rule will set parent and child index
1146 def setChild(self, t, i, child):
1147 t.setChild(i, child)
1197 parent and child index is very difficult and cumbersome. Better to
1214 # What index is this node in the child list? Range: 0..n-1
1325 for child in self.children:
1326 child.setUnknownTokenBoundaries()
1380 ret += ' '.join([child.toStringTree() for child in self.children])
1729 Replace from start to stop child index of parent with t, which might
2224 "CLASS VARDEF" says current node must be child of a VARDEF and whose
2400 the child list of this node (their parent). Return result of
2417 child = self.adaptor.getChild(t, idx)
2418 self.visit(child, pre_action, post_action)
2435 know what child index they are.
2509 # next node will be child 0 if any children