本文整理汇总了C++中TypeNode::isTemplateParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeNode::isTemplateParameter方法的具体用法?C++ TypeNode::isTemplateParameter怎么用?C++ TypeNode::isTemplateParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeNode
的用法示例。
在下文中一共展示了TypeNode::isTemplateParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTypeNode
TypeNode* TypeNameNode::getTypeNode(TemplateArguments* templateArguments)
{
//assert(0 == templateArguments || templateArguments->m_classTypeNode->isTemplateClassInstance());
assert(0 != m_startTypeNode);
TypeNode* result = 0;
if (0 == m_typeNode)// under template parameter
{
assert(templateArguments && m_startTypeNode
&& (m_startTypeNode->isTemplateParameter() || m_startTypeNode->isTypedef()) );
if (templateArguments->m_classTypeNode->isClass())
{
return 0;
}
TypeNode* actualStartTypeNode = m_startTypeNode->getActualTypeNode(templateArguments);
assert(actualStartTypeNode);
std::vector<ScopeNameNode*> scopeNameNodes;
m_scopeNameList->collectIdentifyNodes(scopeNameNodes);
if (scopeNameNodes.size() == 1)
{
result = actualStartTypeNode;
}
else
{
scopeNameNodes.erase(scopeNameNodes.begin());
TypeNode* initialTypeTreeNode = 0;
TypeNode* finalTypeTreeNode = 0;
if (g_typeTree.findNodeByScopeNames(initialTypeTreeNode, finalTypeTreeNode,
scopeNameNodes, actualStartTypeNode, templateArguments))
{
assert(finalTypeTreeNode);
result = finalTypeTreeNode;
}
}
}
else if (m_typeNode->isTemplateParameter())
{
assert(templateArguments);
result = templateArguments->findTypeNode(m_scopeNameList->m_scopeName->m_name->m_str);
}
else if (m_typeNode->isTemplateClass())
{
assert(templateArguments);
if (m_scopeNameList->m_scopeName->isTemplateForm())
{
result = g_typeTree.findNodeByScopeName(m_scopeNameList->m_scopeName, m_typeNode->m_enclosing, templateArguments);
}
else
{
assert(m_scopeNameList->m_scopeName->m_name->m_str == templateArguments->m_className);
result = templateArguments->m_classTypeNode;
}
}
else if (m_typeNode->isUnderTemplateClass())
{
assert(templateArguments);
if (m_startTypeNode->isUnderTemplateClass())
{
std::vector<TypeNode*> typeNodes;
TypeNode* typeNode = m_typeNode;
while (typeNode)
{
if (typeNode->isTemplateClass())
{
break;
}
typeNodes.push_back(typeNode);
typeNode = typeNode->m_enclosing;
}
assert(typeNode->isTemplateClass() && typeNode->m_name == templateArguments->m_className);
typeNode = templateArguments->m_classTypeNode;
auto it = typeNodes.rbegin();
auto end = typeNodes.rend();
for (; it != end; ++it)
{
TypeNode* tempTypeNode = *it;
typeNode = typeNode->getChildNode(tempTypeNode->m_name);
assert(typeNode);
}
if (typeNode->isTypedef())
{
TypeNode* actualTypeNode = typeNode->getActualTypeNode(templateArguments);
if (actualTypeNode->isTemplateParameter())
{
typeNode = templateArguments->findTypeNode(actualTypeNode->m_name);
assert(0 != typeNode);
}
}
result = typeNode;
}
else
{
std::vector<ScopeNameNode*> scopeNameNodes;
m_scopeNameList->collectIdentifyNodes(scopeNameNodes);
TypeNode* initialTypeTreeNode = 0;
TypeNode* finalTypeTreeNode = 0;
if (m_startTypeNode->isTemplateClass() && !scopeNameNodes[0]->isTemplateForm())
{
assert(m_startTypeNode->m_name == templateArguments->m_className);
scopeNameNodes.erase(scopeNameNodes.begin());
if (g_typeTree.findNodeByScopeNames(initialTypeTreeNode, finalTypeTreeNode,
//.........这里部分代码省略.........