本文整理汇总了C++中ASTNode::getFirstChild方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::getFirstChild方法的具体用法?C++ ASTNode::getFirstChild怎么用?C++ ASTNode::getFirstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::getFirstChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void SITSituationVisitor::visit(ASTNode *node) throw (SITSituationVisitorException) {
if (node != NULL) {
if (node->getParent() == NULL) {
m_situation.setHeader(visitSituationHeader(node->getFirstChild()));
vector<ASTNode*> list = node->getChildren();
vector<ASTNode*>::iterator it = list.begin();
while (it != list.end()) {
ASTNode *n = (*it++);
if ((n->getFirstChild() != NULL) && (n->getFirstChild()->getKey() == "OBJECT") ) {
m_situation.addObject(visitObject(n));
}
}
}
}
}
示例2: visitOnEnteringPolygon
OnEnteringPolygon* SITSituationVisitor::visitOnEnteringPolygon(ASTNode *node) {
OnEnteringPolygon *oep = NULL;
if (node != NULL) {
oep = new OnEnteringPolygon();
ASTNode *n = findByKey("OBJECTID", node->getParent(), 3);
if (n == NULL) {
OPENDAVINCI_CORE_THROW_EXCEPTION(SITSituationVisitorException, "Node to get name from OBJECTID expected.");
}
oep->setID(n->getValue<uint32_t>());
n = findByKey("VERTEX2", node->getParent(), 4);
if (n == NULL) {
OPENDAVINCI_CORE_THROW_EXCEPTION(SITSituationVisitorException, "Node to get name from VERTEX222 expected.");
}
n = n->getParent()->getParent();
vector<ASTNode*> listOfEnteringPolygon = n->getChildren();
vector<ASTNode*>::iterator it = listOfEnteringPolygon.begin();
while (it != listOfEnteringPolygon.end()) {
n = (*it++);
if (n->getFirstChild()->getKey() == "VERTEX2") {
oep->add(visitVertex3(n));
}
}
}
return oep;
}