void ASTNode::addSibling(ASTNode *node) { ASTNode *i; i = this; while (i->getSibling() != NULL) { i = i->getSibling(); } node->setParentNode(this->_parent); i->_siblings = node; }
void ASTNode::addChild(ASTNode *node) { node->setParentNode(this); if (_children == NULL) { _children = node; }else { ASTNode *i; i = _children; while (i->getSibling() != NULL) { i = i->getSibling(); } i->addSibling(node); } }