Lines Matching refs:root
165 if (!currentAST.root)
167 // Make new child the current root
168 currentAST.root = child;
174 // Add new child to current root
175 currentAST.root->setFirstChild(child);
199 /** Duplicate tree including siblings of root. */
206 { // for each sibling of the root
214 /** Duplicate a tree, assuming this is a root node of a tree
215 * duplicate that node and what's below; ignore siblings of root node.
219 RefAST result = dup(t); // make copy of root
220 // copy all children of root.
227 * array is the root. If the root is null, then the tree is
237 RefAST root = nodes[0];
240 if( root )
241 root->setFirstChild(RefAST(nullASTptr)); // don't leave any old pointers set
249 if ( root == 0 ) // Set the root and set it up for a flat list
250 root = tail = nodes[i];
253 root->setFirstChild(nodes[i]);
254 tail = root->getFirstChild();
270 return root;
283 /// Make an AST the root of current AST
284 void ASTFactory::makeASTRoot( ASTPair& currentAST, RefAST root )
286 if (root)
288 // Add the current root as a child of new root
289 root->addChild(currentAST.root);
290 // The new current child is the last sibling of the old root
291 currentAST.child = currentAST.root;
293 // Set the new root
294 currentAST.root = root;