• Home
  • Raw
  • Download

Lines Matching full:children

70  *  as there are no fields other than the children list, which cannot
71 * be copied as the children are not considered part of this node.
82 children = nil;
92 // children = [[AMutableArray arrayWithCapacity:5] retain];
93 // [children addObject:node];
105 if ( children ) [children release];
111 if ( children == nil || i >= [children count] ) {
114 return (id<ANTLRBaseTree>)[children objectAtIndex:i];
117 /** Get the children internal List; note that if you directly mess with
120 - (AMutableArray *) children
122 return children;
127 if ( children != anArray ) {
128 if ( children ) [children release];
131 children = anArray;
136 for (NSUInteger i = 0; children != nil && i < [children count]; i++) {
137 id<ANTLRBaseTree> t = (id<ANTLRBaseTree>) [children objectAtIndex:i];
147 if ( children == nil ) {
150 return [children count];
155 * Warning: if t has no children, but child does
156 * and child isNil then this routine moves children to t via
157 * t.children = child.children; i.e., without copying the array.
162 //System.out.println("existing children: "+children);
169 if ( [childTree isNil] ) { // t is an empty node possibly with children
170 if ( children != nil && children == childTree.children ) {
173 // just add all of childTree's children to this
174 if ( childTree.children != nil ) {
175 if ( children != nil ) { // must copy, this has children already
176 int n = [childTree.children count];
178 id<ANTLRBaseTree> c = (id<ANTLRBaseTree>)[childTree.children objectAtIndex:i];
179 [children addObject:c];
182 [c setChildIndex:[children count]-1];
186 // no children for this but t has children; just set pointer
188 children = childTree.children;
193 else { // child is not nil (don't care about children)
194 if ( children == nil ) {
195children = [[AMutableArray arrayWithCapacity:5] retain]; // create children list on demand
197 [children addObject:t];
199 [childTree setChildIndex:[children count]-1];
201 // System.out.println("now children are: "+children);
204 /** Add all elements of kids list as children of this node */
221 if ( children == nil ) {
222 children = [[AMutableArray arrayWithCapacity:5] retain];
224 if ([children count] > i ) {
225 [children replaceObjectAtIndex:i withObject:t];
228 [children insertObject:t atIndex:i];
236 if ( children == nil ) {
239 id<ANTLRBaseTree> killed = (id<ANTLRBaseTree>)[children objectAtIndex:idx];
240 [children removeObjectAtIndex:idx];
246 /** Delete children from start to stop and replace with t even if t is
247 * a list (nil-root ANTLRTree). num of children can increase or decrease.
248 * For huge child lists, inserting children can force walking rest of
249 * children to set their childindex; could be slow.
258 if ( children == nil ) {
259 …legalArgumentException newException:@"ANTLRBaseTree Invalid Indexes; no children in list"];
265 // normalize to a list of children to add: newChildren
267 newChildren = newTree.children;
278 int j = 0; // index into new children
281 [children replaceObjectAtIndex:i withObject:(id)child];
288 // set children and then delete extra
290 … [children replaceObjectAtIndex:startChildIndex+j withObject:[newChildren objectAtIndex:j]];
295 [children removeObjectAtIndex:indexToDelete];
300 // fill in as many children as we can (replacingHowMany) w/o moving data
302 … [children replaceObjectAtIndex:startChildIndex+j withObject:[newChildren objectAtIndex:j]];
306 [children insertObject:[newChildren objectAtIndex:j] atIndex:startChildIndex+j];
313 /** Override in a subclass to change the impl of children list */
361 * and its children?
373 * and its children?
472 // the children themselves are not copied here!
476 [theCopy addChildren:self.children];
489 if ( [theCopy.children count] )
490 [theCopy.children removeAllObjects];
491 AMutableArray *childrenCopy = theCopy.children;
492 for (id loopItem in children) {
502 if ( children == nil || [children count] == 0 ) {
505 NSMutableString *buf = [NSMutableString stringWithCapacity:[children count]];
511 for (int i = 0; children != nil && i < [children count]; i++) {
512 id<ANTLRBaseTree> t = (id<ANTLRBaseTree>)[children objectAtIndex:i];
541 @synthesize children;