本文整理汇总了C++中Name::isAbsolute方法的典型用法代码示例。如果您正苦于以下问题:C++ Name::isAbsolute方法的具体用法?C++ Name::isAbsolute怎么用?C++ Name::isAbsolute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Name
的用法示例。
在下文中一共展示了Name::isAbsolute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Name::Name(const Name& name, size_t substrSize)
: isAbsolute_(name.isAbsolute()) {
assert(substrSize <= name.size());
list_.reserve(substrSize);
for(std::size_t i = 0; i < substrSize; i++){
list_.push_back(name.at(i));
}
}
示例2: makeAbsolute
Name Name::makeAbsolute(const Name& name) const{
assert(isAbsolute());
assert(!name.empty());
if(name.isAbsolute()) {
return name.copy();
} else {
return concat(name);
}
}
示例3: performInnerAliasSearch
SearchResult performInnerAliasSearch(AST::Alias& alias, const Name& name) {
if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
const auto iterator = alias.namedTemplateVariables().find(name.at(0));
if (iterator != alias.namedTemplateVariables().end()) {
return SearchResult::TemplateVar(*(iterator->second));
}
return SearchResult::None();
}
示例4: performInnerCatchClauseSearch
SearchResult performInnerCatchClauseSearch(AST::CatchClause* catchClause, const Name& name) {
if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
const auto iterator = catchClause->namedVariables().find(name.at(0));
if (iterator != catchClause->namedVariables().end()) {
return SearchResult::Var(*(iterator->second));
}
return SearchResult::None();
}
示例5: performInnerTypeInstanceSearch
SearchResult performInnerTypeInstanceSearch(AST::TypeInstance& typeInstance, const Name& name) {
if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
const auto iterator = typeInstance.namedTemplateVariables().find(name.at(0));
if (iterator != typeInstance.namedTemplateVariables().end()) {
return SearchResult::TemplateVar(*(iterator->second));
}
return SearchResult::None();
}
示例6: performSearch
SearchResult performSearch(Context& context, const Name& name, const size_t searchStartPosition) {
assert(!name.empty());
const auto& scopeStack = context.scopeStack();
const size_t startPosition = name.isAbsolute() ? scopeStack.size() - 1 : searchStartPosition;
for (size_t i = startPosition; i < scopeStack.size(); i++) {
const auto pos = scopeStack.size() - i - 1;
const auto result = performInnerSearch(scopeStack[pos], name);
if (!result.isNone()) return result;
}
return SearchResult::None();
}
示例7: performInnerFunctionSearch
SearchResult performInnerFunctionSearch(AST::Function& function, const Name& name) {
if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
// Search template variables.
{
const auto iterator = function.namedTemplateVariables().find(name.at(0));
if (iterator != function.namedTemplateVariables().end()) {
return SearchResult::TemplateVar(*(iterator->second));
}
}
// Search parameter variables.
{
const auto iterator = function.namedVariables().find(name.at(0));
if (iterator != function.namedVariables().end()) {
return SearchResult::Var(*(iterator->second));
}
}
return SearchResult::None();
}