本文整理汇总了C++中AnalysisResultPtr::containsDynamicClass方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::containsDynamicClass方法的具体用法?C++ AnalysisResultPtr::containsDynamicClass怎么用?C++ AnalysisResultPtr::containsDynamicClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::containsDynamicClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inferTypes
TypePtr NewObjectExpression::inferTypes(AnalysisResultPtr ar, TypePtr type,
bool coerce) {
reset();
ConstructPtr self = shared_from_this();
if (!m_name.empty()) {
ClassScopePtr cls = ar->resolveClass(m_name);
if (cls) {
m_name = cls->getName();
}
if (!cls || cls->isRedeclaring()) {
if (cls) {
m_redeclared = true;
ar->getScope()->getVariables()->
setAttribute(VariableTable::NeedGlobalPointer);
}
if (!cls && ar->isFirstPass()) {
ar->getCodeError()->record(self, CodeError::UnknownClass, self);
}
if (m_params) m_params->inferAndCheck(ar, NEW_TYPE(Any), false);
return NEW_TYPE(Object);
}
if (cls->isVolatile()) {
ar->getScope()->getVariables()->
setAttribute(VariableTable::NeedGlobalPointer);
}
m_dynamic = cls->derivesFromRedeclaring();
m_validClass = true;
FunctionScopePtr func = cls->findConstructor(ar, true);
if (!func) {
if (m_params) {
if (!m_dynamic && m_params->getCount()) {
if (ar->isFirstPass()) {
ar->getCodeError()->record(self, CodeError::BadConstructorCall,
self);
}
m_params->setOutputCount(0);
}
m_params->inferAndCheck(ar, NEW_TYPE(Any), false);
}
} else {
m_extraArg = func->inferParamTypes(ar, self, m_params,
m_validClass);
m_variableArgument = func->isVariableArgument();
}
return Type::CreateObjectType(m_name);
} else {
ar->containsDynamicClass();
if (ar->isFirstPass()) {
ar->getCodeError()->record(self, CodeError::UseDynamicClass,
self);
}
if (m_params) {
m_params->markParams(false);
}
}
m_nameExp->inferAndCheck(ar, Type::String, false);
if (m_params) m_params->inferAndCheck(ar, NEW_TYPE(Any), false);
return Type::Variant;//NEW_TYPE(Object);
}
示例2: inferTypes
TypePtr NewObjectExpression::inferTypes(AnalysisResultPtr ar, TypePtr type,
bool coerce) {
reset();
m_classScope.reset();
m_funcScope.reset();
ConstructPtr self = shared_from_this();
if (!m_name.empty()) {
ClassScopePtr cls = resolveClass(getScope());
m_name = m_className;
if (!cls) {
if (isRedeclared()) {
getScope()->getVariables()->
setAttribute(VariableTable::NeedGlobalPointer);
} else if (getScope()->isFirstPass()) {
Compiler::Error(Compiler::UnknownClass, self);
}
if (m_params) m_params->inferAndCheck(ar, Type::Any, false);
return Type::Object;
}
if (cls->isVolatile() && !isPresent()) {
getScope()->getVariables()->
setAttribute(VariableTable::NeedGlobalPointer);
}
m_dynamic = cls->derivesFromRedeclaring();
bool valid = true;
FunctionScopePtr func = cls->findConstructor(ar, true);
if (!func) {
if (m_params) {
if (!m_dynamic && m_params->getCount()) {
if (getScope()->isFirstPass()) {
Compiler::Error(Compiler::BadConstructorCall, self);
}
m_params->setOutputCount(0);
}
m_params->inferAndCheck(ar, Type::Some, false);
}
} else {
m_extraArg = func->inferParamTypes(ar, self, m_params,
valid);
m_variableArgument = func->isVariableArgument();
}
if (valid) {
m_classScope = cls;
m_funcScope = func;
}
if (!valid || m_dynamic) {
m_implementedType = Type::Object;
} else {
m_implementedType.reset();
}
return Type::CreateObjectType(m_name);
} else {
ar->containsDynamicClass();
if (m_params) {
m_params->markParams(false);
}
}
m_implementedType.reset();
m_nameExp->inferAndCheck(ar, Type::String, false);
if (m_params) m_params->inferAndCheck(ar, Type::Any, false);
return Type::Object;
}