本文整理汇总了C++中ASTNode::getPackageName方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::getPackageName方法的具体用法?C++ ASTNode::getPackageName怎么用?C++ ASTNode::getPackageName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::getPackageName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readMathMLFromStringWithNamespaces
END_TEST
START_TEST (test_element_selector)
{
const char* s = wrapMathML
(
" <apply>"
" <selector/>"
" <ci> A </ci>"
" <ci> i </ci>"
" </apply>"
);
N = readMathMLFromStringWithNamespaces(s, NS);
fail_unless( N != NULL );
fail_unless( N->getType() == AST_ORIGINATES_IN_PACKAGE);
fail_unless( N->getExtendedType() == AST_LINEAR_ALGEBRA_SELECTOR);
fail_unless( N->getNumChildren() == 2);
fail_unless( N->getPackageName() == "arrays");
ASTNode * child = N->getChild(0);
fail_unless( child != NULL );
fail_unless( child->getType() == AST_NAME);
fail_unless( child->getExtendedType() == AST_NAME);
fail_unless( strcmp(child->getName(), "A") == 0);
fail_unless( child->getNumChildren() == 0);
fail_unless( child->getPackageName() == "core");
child = N->getChild(1);
fail_unless( child != NULL );
fail_unless( child->getType() == AST_NAME);
fail_unless( child->getExtendedType() == AST_NAME);
fail_unless( strcmp(child->getName(), "i") == 0);
fail_unless( child->getNumChildren() == 0);
ArraysASTPlugin* plugin = static_cast<ArraysASTPlugin*>(N->getPlugin("arrays"));
fail_unless(plugin != NULL);
fail_unless(plugin->getASTType() == AST_LINEAR_ALGEBRA_SELECTOR);
}