Home | History | Annotate | Download | only in antlr3

Lines Matching refs:children

165         """Set the parent and child index values for all children"""
173 is nil, add all children of t to this' children.
191 Delete children from start to stop and replace with t even if t is
192 a list (nil-root tree). num of children can increase or decrease.
193 For huge child lists, inserting children can force walking rest of
194 children to set their childindex; could be slow.
202 Indicates the node is a nil node but may still have children, meaning
212 and its children?
225 and its children?
315 a list of element as the children. If you want a flat tree (a list)
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
363 If oldRoot is a nil root, just copy or move the children to newRoot.
385 children; i.e., you don't have to copy the list. We are
492 all children? Each rule that creates AST nodes will call this
494 still usually have a nil root node just to hold the children list.
532 """Remove ith child and shift children down from right."""
538 """How many children? If 0, then this is a leaf node"""
586 be a list. Number of children may be different
676 actually have any user data. ANTLR v3 uses a list of children approach
678 an empty node whose children represent the list. An empty, but
689 as there are no fields other than the children list, which cannot
690 be copied as the children are not considered part of this node.
694 self.children = []
701 return self.children[i]
707 """@brief Get the children internal List
714 return self.children
718 for child in self.children:
726 return len(self.children)
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.
744 # t is an empty node possibly with children
746 if self.children is childTree.children:
749 # fix parent pointer and childIndex for new children
750 for idx, child in enumerate(childTree.children):
752 child.childIndex = len(self.children) + idx
754 self.children += childTree.children
757 # child is not nil (don't care about children)
758 self.children.append(childTree)
760 childTree.childIndex = len(self.children) - 1
763 def addChildren(self, children):
764 """Add all elements of kids list as children of this node"""
766 self.children += children
776 self.children[i] = t
782 killed = self.children[i]
784 del self.children[i]
787 for idx, child in enumerate(self.children[i:]):
795 Delete children from start to stop and replace with t even if t is
796 a list (nil-root tree). num of children can increase or decrease.
797 For huge child lists, inserting children can force walking rest of
798 children to set their childindex; could be slow.
801 if (startChildIndex >= len(self.children)
802 or stopChildIndex >= len(self.children)
808 # normalize to a list of children to add: newChildren
810 newChildren = newTree.children
822 self.children[idx + startChildIndex] = child
827 # length of children changes...
830 del self.children[startChildIndex:stopChildIndex+1]
833 self.children[startChildIndex:startChildIndex] = newChildren
844 for idx, child in enumerate(self.children[offset:]):
862 for idx, child in enumerate(self.children):
924 if len(self.children) == 0:
933 for i, child in enumerate(self.children):
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
1039 If oldRoot is a nil root, just copy or move the children to newRoot.
1061 children; i.e., you don't have to copy the list. We are
1086 # is a flat list (i.e., nil-rooted tree). All children of oldRoot
1326 if self.children is None:
1332 for child in self.children:
1339 if self.children:
1340 firstChild = self.children[0]
1341 lastChild = self.children[-1]
1380 if not self.children:
1387 ret += ' '.join([child.toStringTree() for child in self.children])
1739 be a list. Number of children may be different
1881 # add DOWN node if t has children
1886 # and now add all its children
1890 # add UP node if t has children
2314 entire tree if node has children. If children, scan until
2412 before/after having visited all of its children. Bottom up walk.
2413 Execute both actions even if t has no children. Ignore return
2414 results from transforming children since they will have altered
2427 # if rewritten, walk children of new t
2524 # next node will be child 0 if any children
2531 # if no children, look for next sibling of tree or ancestor
2772 children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration