本文整理汇总了C++中TVariable::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ TVariable::getName方法的具体用法?C++ TVariable::getName怎么用?C++ TVariable::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVariable
的用法示例。
在下文中一共展示了TVariable::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputDeclaration
bool OutputDeclaration(TIntermDeclaration* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
TVariable* v = node->getVariable();
if (v->getType().getBasicType() == EbtInvariant) {
out.debug << "redeclare '" << v->getName() << "' as invariant";
} else if (v->getType().getBasicType() != EbtStruct) {
out.debug << "declare '" << v->getName() << "' (" <<
v->getType().getCompleteString() <<
") [id: " << v->getUniqueId() << "]";
} else {
out.debug << "declare '" << v->getName() << "' (" <<
v->getType().getCompleteString() << " '" <<
v->getType().getTypeName() << "') [id: " <<
v->getUniqueId() << "]";
}
out.debug << " {" << node->isFirst() << "}";
OutputDebugText(out, node);
out.debug << "\n";
#if DEBUG_CHANGEABLE == 1
OutputChangeableText(oit->infoSink, node, oit->depth, 0);
#endif
return true;
}
示例2: ir_grow_declaration
TIntermDeclaration* ir_grow_declaration(TIntermDeclaration* declaration, TSymbol* symbol, TIntermTyped* initializer, TInfoSink& infoSink)
{
TVariable* var = static_cast<TVariable*>(symbol);
TIntermSymbol* sym = ir_add_symbol(var->getUniqueId(), var->getName(), var->getType(), var->getType().getLine());
sym->setGlobal(symbol->isGlobal());
return ir_grow_declaration(declaration, sym, initializer, infoSink);
}
示例3: nonInitErrorCheck
//
// Do semantic checking for a variable declaration that has no initializer,
// and update the symbol table.
//
// Returns true if there was an error.
//
bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType& type)
{
if (reservedErrorCheck(line, identifier))
recover();
TVariable* variable = new TVariable(&identifier, TType(type));
if (! symbolTable.insert(*variable)) {
error(line, "redefinition", variable->getName().c_str(), "");
delete variable;
return true;
}
if (voidErrorCheck(line, identifier, type))
return true;
return false;
}