本文整理汇总了C++中NodePtr::endLine方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::endLine方法的具体用法?C++ NodePtr::endLine怎么用?C++ NodePtr::endLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodePtr
的用法示例。
在下文中一共展示了NodePtr::endLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printNodeAtLevel
void ASTree::printNodeAtLevel(NodePtr& node, std::string indent)
{
std::cout << indent << "Type: " << node->nodeType() << "\n";
std::cout << indent << "Name: " << node->nodeName() << "\n";
if (node->nodeType() == "function")
std::cout << indent << "Line Count: " << node->endLine() - node->startLine() - 1 << "\n";
if (node->nodeType() == "function")
std::cout << indent << "Complexity : " << node->getNoOfDescendants() << "\n";
std::cout << "\n";
}
示例2: recursiveFunctionMetrics
//------------Helper function for recursively printing function metrics data -------//
void ASTree::recursiveFunctionMetrics(NodePtr& node)
{
if (node->nodeType() == "function")
{
std::cout << "\n";
std::cout << "Function: " << node->nodeName() << "\t\t";
std::cout << "Lines: " << node->endLine() - node->startLine() - 1;
std::cout << " Complexity: " << node->getNoOfDescendants();
}
if (!hasChild(node))
{
return;
}
for each(auto child in node->children())
{
recursiveFunctionMetrics(child);
}
}