Beispiel #1
0
void ASTNode::addSibling(ASTNode *node)
{
	ASTNode *i;

	i = this;
	while (i->getSibling() != NULL) {
		i = i->getSibling();
	}

	node->setParentNode(this->_parent);
	i->_siblings = node;
}
Beispiel #2
0
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);
	}
}