本文整理汇总了C++中AnalysisResultPtr::addNonFinal方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::addNonFinal方法的具体用法?C++ AnalysisResultPtr::addNonFinal怎么用?C++ AnalysisResultPtr::addNonFinal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::addNonFinal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onParse
void ClassStatement::onParse(AnalysisResultPtr ar) {
ClassScope::KindOf kindOf = ClassScope::KindOfObjectClass;
switch (m_type) {
case T_CLASS: kindOf = ClassScope::KindOfObjectClass; break;
case T_ABSTRACT: kindOf = ClassScope::KindOfAbstractClass; break;
case T_FINAL: kindOf = ClassScope::KindOfFinalClass; break;
default:
ASSERT(false);
}
vector<string> bases;
if (!m_parent.empty()) {
bases.push_back(m_parent);
ar->addNonFinal(m_parent);
}
if (m_base) m_base->getStrings(bases);
StatementPtr stmt = dynamic_pointer_cast<Statement>(shared_from_this());
ClassScopePtr classScope(new ClassScope(kindOf, m_originalName, m_parent,
bases, m_docComment,
stmt, ar->getFileScope()));
m_classScope = classScope;
if (!ar->getFileScope()->addClass(ar, classScope)) {
m_ignored = true;
return;
}
ar->recordClassSource(m_name, ar->getFileScope()->getName());
if (m_stmt) {
ar->pushScope(classScope);
bool seenConstruct = false;
for (int i = 0; i < m_stmt->getCount(); i++) {
MethodStatementPtr meth =
dynamic_pointer_cast<MethodStatement>((*m_stmt)[i]);
if (meth && meth->getName() == "__construct") {
seenConstruct = true;
break;
}
}
for (int i = 0; i < m_stmt->getCount(); i++) {
if (!seenConstruct) {
MethodStatementPtr meth =
dynamic_pointer_cast<MethodStatement>((*m_stmt)[i]);
if (meth && classScope && meth->getName() == classScope->getName()
&& !meth->getModifiers()->isStatic()) {
// class-name constructor
classScope->setAttribute(ClassScope::classNameConstructor);
}
}
IParseHandlerPtr ph = dynamic_pointer_cast<IParseHandler>((*m_stmt)[i]);
ph->onParse(ar);
}
ar->popScope();
}
}