本文整理汇总了C++中Identifier::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Identifier::getName方法的具体用法?C++ Identifier::getName怎么用?C++ Identifier::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Identifier
的用法示例。
在下文中一共展示了Identifier::getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
bool ASTPrinter::visit(Identifier const& _node)
{
writeLine(string("Identifier ") + _node.getName());
printType(_node);
printSourcePart(_node);
return goDeeper();
}
示例2: Object
UserDefinedFunction::UserDefinedFunction( Operands *operands ) : Object( __function_t ){
closureLink = NULL;
// get the function name.
Identifier *name = CAST_TO( Identifier, operands->get(0) );
if( name != NULL ){
char *tmpName = name->getName();
functName = new char[ strlen(tmpName) + 1 ];
strcpy( functName, tmpName );
//operands->pop_front();
// get the formalParameter list.
fpList = CAST_TO( FormalParameterList, operands->get(1) );
if( fpList != NULL ){
//operands->pop_front();
// get the returnType.
Type *dataType = CAST_TO( Type, operands->get(2) );
if( dataType != NULL ){
returnType = dataType->getDataType();
//operands->pop_front();
// get the statementList of the function.
functBody = CAST_TO( StatementList, operands->get(3) );
if( functBody == NULL ){
cout<<"Error in udf.."<<endl;
}
}
}
}
}
示例3: name
const SharedString& Declaration::mangledName() const
{
if (_mangledName.empty())
{
for (auto a : _attributes)
{
Identifier *i = dynamic_cast<Identifier*>(a);
if (i && i->getName().eq("extern_c"))
{
_mangledName = name();
return _mangledName;
}
}
_mangledName = SharedString(Concat, "_M", mangleof()); // TODO: include scope...
}
return _mangledName;
}
示例4: setup
void Arg::setup() {
// If two children, the first is the name. Otherwise, name is "".
if (1 == children.size()) {
m_typeSpec = dynamic_cast<TypeSpec*>(children.at(0));
} else if (2 == children.size()) {
m_typeSpec = dynamic_cast<TypeSpec*>(children.at(1));
Identifier* ident = dynamic_cast<Identifier*>(children.at(0));
if (!ident) {
throw CompileError("First child of 2-child Arg " + print() + " must be an Identifier");
}
m_argname = ident->getName();
} else {
throw CompileError("Arg node must have 1 or 2 children");
}
if (!m_typeSpec) {
throw CompileError("Arg " + print() + " must have a TypeSpec child");
}
}
示例5: getName
virtual std::string getName() {
if(identifier) return identifier->getName();
return "";
}
示例6: asString
virtual std::string asString() { return id->getName(); }