Lines Matching full:children
24 self.children = []
42 if len(node.alternatives) == len(node.children):
56 if len(node.group) == len(node.children):
98 for child in self.children:
100 if not self.children:
115 node = node.children[0]
119 if len(node.children) <= 2:
121 new_node = reduce_tree(node.children[0], parent)
125 #skip odd children('|' tokens)
126 for child in node.children:
127 if node.children.index(child)%2:
131 new_node.children.append(reduced)
133 if len(node.children) > 1:
136 for child in node.children:
139 new_node.children.append(reduced)
140 if not new_node.children:
141 # delete the group if all of the children were reduced to None
145 new_node = reduce_tree(node.children[0], parent)
148 if (isinstance(node.children[0], pytree.Leaf) and
149 node.children[0].value == '('):
151 return reduce_tree(node.children[1], parent)
152 if ((isinstance(node.children[0], pytree.Leaf) and
153 node.children[0].value == '[')
155 (len(node.children)>1 and
156 hasattr(node.children[1], "value") and
157 node.children[1].value == '[')):
168 for child in node.children:
183 name_leaf = node.children[2]
186 name_leaf = node.children[3]
188 name_leaf = node.children[0]
214 if repeater_node.children[0].value == '*':
217 elif repeater_node.children[0].value == '+':
225 #add children
227 for child in details_node.children[1:-1]:
231 new_node.children.append(reduced)