本文整理汇总了C++中BlockScope::is方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockScope::is方法的具体用法?C++ BlockScope::is怎么用?C++ BlockScope::is使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockScope
的用法示例。
在下文中一共展示了BlockScope::is方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getContainingClass
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);
}
示例3: getContainingProgram
AnalysisResultRawPtr BlockScope::getContainingProgram() {
BlockScope *bs = this;
while (bs) {
if (bs->is(BlockScope::ProgramScope)) {
break;
}
bs = bs->getOuterScope().get();
}
return AnalysisResultRawPtr((AnalysisResult*)bs);
}
示例4: getContainingFile
FileScopeRawPtr BlockScope::getContainingFile() {
BlockScope *bs = this;
while (bs) {
if (bs->is(BlockScope::FileScope)) {
break;
}
bs = bs->getOuterScope().get();
}
return FileScopeRawPtr((HPHP::FileScope*)bs);
}
示例5: getContainingNonClosureFunction
FunctionScopeRawPtr BlockScope::getContainingNonClosureFunction() {
BlockScope *bs = this;
// walk out through all the closures
while (bs && bs->is(BlockScope::FunctionScope)) {
HPHP::FunctionScope *fs = static_cast<HPHP::FunctionScope*>(bs);
if (!fs->isClosure()) {
return FunctionScopeRawPtr(fs);
}
bs = bs->m_outerScope.get();
}
return FunctionScopeRawPtr();
}