本文整理汇总了C++中ASTNode::isNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::isNumber方法的具体用法?C++ ASTNode::isNumber怎么用?C++ ASTNode::isNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::isNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkValidUnits
/**
* Checks the MathML of the ASTnode
* is appropriate for the function being performed
*
* If an inconsistency is found, an error message is logged.
*/
void
ValidCnUnitsValue::checkMath (const Model& m, const ASTNode& node, const SBase & sb)
{
/* should not be here but why not catch it rather than crash*/
if (&(node) == NULL)
{
return;
}
if (node.isNumber())
{
checkValidUnits(m, node, sb);
}
else
{
ASTNodeType_t type = node.getType();
switch (type)
{
case AST_FUNCTION:
checkFunction(m, node, sb);
break;
default:
checkChildren(m, node, sb);
break;
}
}
//switch (type)
//{
// case AST_LOGICAL_AND:
// case AST_LOGICAL_NOT:
// case AST_LOGICAL_OR:
// case AST_LOGICAL_XOR:
// checkMathFromLogical(m, node, sb);
// break;
// case AST_FUNCTION:
// checkFunction(m, node, sb);
// break;
// default:
// checkChildren(m, node, sb);
// break;
//}
}
示例2: checkValidUnits
/**
* Checks the MathML of the ASTnode
* is appropriate for the function being performed
*
* If an inconsistency is found, an error message is logged.
*/
void
ValidCnUnitsValue::checkMath (const Model& m, const ASTNode& node, const SBase & sb)
{
if (node.isNumber())
{
checkValidUnits(m, node, sb);
}
else
{
ASTNodeType_t type = node.getType();
switch (type)
{
case AST_FUNCTION:
checkFunction(m, node, sb);
break;
default:
checkChildren(m, node, sb);
break;
}
}
//switch (type)
//{
// case AST_LOGICAL_AND:
// case AST_LOGICAL_NOT:
// case AST_LOGICAL_OR:
// case AST_LOGICAL_XOR:
// checkMathFromLogical(m, node, sb);
// break;
// case AST_FUNCTION:
// checkFunction(m, node, sb);
// break;
// default:
// checkChildren(m, node, sb);
// break;
//}
}