本文整理汇总了C++中Type::Build方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::Build方法的具体用法?C++ Type::Build怎么用?C++ Type::Build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::Build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Build
bool Type::Build(const Node* node)
{
Node::Build(node);
auto t = static_cast<const Type *>(node);
m_NumDereferences = t->m_NumDereferences;
m_IsReference = t->m_IsReference;
m_IsConst = t->m_IsConst;
m_ArraySize = t->m_ArraySize;
for (auto &arg : t->m_TemplateArgs)
{
Type *newArg = new Type(this, arg->GetPrimitive(), arg->GetName());
newArg->Build(arg.get());
m_TemplateArgs.push_back(std::unique_ptr<Type>(newArg));
}
if (t->m_Class)
{
}
if (t->m_ParentType)
{
}
return true;
}
示例2: Build
bool Namespace::Build(const Node* node)
{
Node::Build(node);
auto ns = static_cast<const Namespace *>(node);
bool result = true;
for (auto &kvp : ns->m_Children)
{
Namespace *ch = nullptr;
if (kvp.second->GetNodeType() == NodeType::Namespace)
ch = GetOrCreateNamespace(kvp.first);
else if (kvp.second->GetNodeType() == NodeType::Class)
ch = GetOrCreateClass(kvp.first);
ch->Build(kvp.second.get());
}
for (auto &kvp : ns->m_Functions)
{
auto &overloads = GetOrCreateOverloads(kvp.first);
for (auto &f : kvp.second)
{
auto iter = overloads.find(f.second->GetFullSignature());
if (iter == overloads.end())
{
Function *newF = new Function(this, kvp.first, f.second->GetFunctionType());
newF->Build(f.second.get());
overloads[newF->GetFullSignature()] = std::unique_ptr<Function>(newF);
}
}
}
for (auto &kvp : ns->m_Types)
{
auto iter = m_Types.find(kvp.first);
if (iter == m_Types.end())
{
Type *t = new Type(this, kvp.second->GetPrimitive(), kvp.second->GetName());
t->Build(kvp.second.get());
m_Types[kvp.first] = std::unique_ptr<Type>(t);
}
}
for (auto &kvp : ns->m_Variables)
{
auto iter = m_Variables.find(kvp.first);
if (iter == m_Variables.end())
{
Variable *v = new Variable(this, kvp.first);
v->Build(kvp.second.get());
m_Variables[kvp.first] = std::unique_ptr<Variable>(v);
}
}
for (auto &kvp : ns->m_EnumConstants)
{
auto iter = m_EnumConstants.find(kvp.first);
if (iter == m_EnumConstants.end())
{
EnumConstant *ec = new EnumConstant(this, kvp.second->GetName());
ec->Build(kvp.second.get());
m_EnumConstants[kvp.first] = std::unique_ptr<EnumConstant>(ec);
}
}
return result;
}