本文整理汇总了C++中BlockScope类的典型用法代码示例。如果您正苦于以下问题:C++ BlockScope类的具体用法?C++ BlockScope怎么用?C++ BlockScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BlockScope类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getContainingClass
ClassScopeRawPtr BlockScope::getContainingClass() {
BlockScope *bs = this;
if (bs->is(BlockScope::FunctionScope)) {
bs = bs->m_outerScope.get();
}
if (bs && !bs->is(BlockScope::ClassScope)) {
bs = 0;
}
return ClassScopeRawPtr((HPHP::ClassScope*)bs);
}
示例2: while
AnalysisResultRawPtr BlockScope::getContainingProgram() {
BlockScope *bs = this;
while (bs) {
if (bs->is(BlockScope::ProgramScope)) {
break;
}
bs = bs->getOuterScope().get();
}
return AnalysisResultRawPtr((AnalysisResult*)bs);
}
示例3: getContainingNonClosureFunction
ClassScopeRawPtr BlockScope::getContainingClass() {
BlockScope *bs = getContainingNonClosureFunction().get();
if (!bs) {
bs = this;
}
if (bs && bs->is(BlockScope::FunctionScope)) {
bs = bs->m_outerScope.get();
}
if (!bs || !bs->is(BlockScope::ClassScope)) {
return ClassScopeRawPtr();
}
return ClassScopeRawPtr((HPHP::ClassScope*)bs);
}