本文整理汇总了C++中SgInitializedName::get_protected_declaration方法的典型用法代码示例。如果您正苦于以下问题:C++ SgInitializedName::get_protected_declaration方法的具体用法?C++ SgInitializedName::get_protected_declaration怎么用?C++ SgInitializedName::get_protected_declaration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SgInitializedName
的用法示例。
在下文中一共展示了SgInitializedName::get_protected_declaration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isSgVarRefExp
foreach(SgAssignOp* op, assigns)
{
SgVarRefExp* var = isSgVarRefExp(op->get_lhs_operand());
SgInitializedName* decl = var->get_symbol()->get_declaration();
std::cout << "Found assignment to " << var->get_symbol()->get_name().str();
if (decl->get_protected_declaration())
{
std::cout << ", which is protected.";
}
std::cout << "\t\t" << op->unparseToString();
std::cout << std::endl;
SgNode* assign_scope = SageInterface::getScope(op);
SgNode* var_scope = decl->get_scope();
if (SageInterface::isAncestor(var_scope, assign_scope))
{
std::cout << "\tAnd both are in the same scope.\n";
}
else
{
std::cout << "\tIn different scopes.\n";
}
}