Home | History | Annotate | Download | only in antlr3

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
677 instead of the child-sibling approach in v2. A flat tree (a list) is
718 for child in self.children:
719 if child.getType() == treeType:
720 return child
730 """Add t as child of this node.
732 Warning: if t has no children, but child does
733 and child isNil then this routine moves children to t via
734 t.children = child.children; i.e., without copying the array.
747 raise ValueError("attempt to add child list to itself")
750 for idx, child in enumerate(childTree.children):
751 child.parent = self
752 child.childIndex = len(self.children) + idx
757 # child is not nil (don't care about children)
774 raise ValueError("Can't set single child to a list")
786 # walk rest and decrement their child indexes
787 for idx, child in enumerate(self.children[i:]):
788 child.childIndex = i + idx
797 For huge child lists, inserting children can force walking rest of
821 for idx, child in enumerate(newChildren):
822 self.children[idx + startChildIndex] = child
823 child.parent = self
824 child.childIndex = idx + startChildIndex
844 for idx, child in enumerate(self.children[offset:]):
845 child.childIndex = idx + offset
846 child.parent = self
858 "child indexes don't match; expected %d found %d"
862 for idx, child in enumerate(self.children):
863 child.sanityCheckParentAndChildIndexes(self, idx)
867 """BaseTree doesn't track child indexes."""
873 """BaseTree doesn't track child indexes."""
933 for i, child in enumerate(self.children):
936 buf.append(child.toStringTree())
1005 # ensure new subtree root has parent/child index set
1013 child = self.getChild(t, i)
1014 newSubTree = self.dupTree(child, t)
1020 def addChild(self, tree, child):
1022 Add a child to the tree t. If child is a flat tree (a list), make all
1023 in list children of t. Warning: if t has no children, but child does
1024 and child isNil then you can decide it is ok to move children to t via
1025 t.children = child.children; i.e., without copying the array. Just
1030 #if isinstance(child, Token):
1031 # child = self.createWithPayload(child)
1033 if tree is not None and child is not None:
1034 tree.addChild(child)
1040 If not a nil root, make oldRoot a child of newRoot.
1045 If newRoot is a nil-rooted single child tree, use the single
1046 child as the new root node.
1057 simple node or nil root with a single child node--it must be a root
1101 # whoever invokes rule will set parent and child index
1153 def setChild(self, t, i, child):
1154 t.setChild(i, child)
1204 parent and child index is very difficult and cumbersome. Better to
1221 # What index is this node in the child list? Range: 0..n-1
1332 for child in self.children:
1333 child.setUnknownTokenBoundaries()
1387 ret += ' '.join([child.toStringTree() for child in self.children])
1738 Replace from start to stop child index of parent with t, which might
2237 "CLASS VARDEF" says current node must be child of a VARDEF and whose
2415 the child list of this node (their parent). Return result of
2432 child = self.adaptor.getChild(t, idx)
2433 self.visit(child, pre_action, post_action)
2450 know what child index they are.
2524 # next node will be child 0 if any children