本文整理汇总了C++中AnalysisResultPtr::isSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::isSystem方法的具体用法?C++ AnalysisResultPtr::isSystem怎么用?C++ AnalysisResultPtr::isSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::isSystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: outputCPPImpl
void ObjectMethodExpression::outputCPPImpl(CodeGenerator &cg,
AnalysisResultPtr ar) {
if (!m_name.empty() && m_valid && m_object->getType()->isSpecificObject()) {
// Static method call
outputCPPObjectCall(cg, ar);
cg_printf("%s%s(", m_funcScope ?
m_funcScope->getPrefix(m_params) : Option::MethodPrefix,
m_name.c_str());
FunctionScope::OutputCPPArguments(m_params, m_funcScope, cg, ar,
m_extraArg, m_variableArgument,
m_argArrayId, m_argArrayHash,
m_argArrayIndex);
cg_printf(")");
} else {
bool maybeStatic = true;
if (!ar->isSystem() && !m_name.empty()) {
FunctionScope::FunctionInfoPtr info =
FunctionScope::GetFunctionInfo(m_name);
if (info && !info->getMaybeStatic()) maybeStatic = false;
}
cg_printf("(mcp%d.%s->",
m_ciTemp, maybeStatic ? "bindClass(fi)" : "ci" );
outputDynamicCall(cg, ar, true);
}
}
示例2: inferAndCheck
TypePtr ObjectMethodExpression::inferAndCheck(AnalysisResultPtr ar,
TypePtr type, bool coerce) {
reset();
ConstructPtr self = shared_from_this();
TypePtr objectType = m_object->inferAndCheck(ar, Type::Some, false);
m_valid = true;
m_bindClass = true;
if (m_name.empty()) {
m_nameExp->inferAndCheck(ar, Type::String, false);
setInvokeParams(ar);
// we have to use a variant to hold dynamic value
return checkTypesImpl(ar, type, Type::Variant, coerce);
}
ClassScopePtr cls;
if (objectType && !objectType->getName().empty()) {
if (m_classScope && !strcasecmp(objectType->getName().c_str(),
m_classScope->getName().c_str())) {
cls = m_classScope;
} else {
cls = ar->findExactClass(shared_from_this(), objectType->getName());
}
}
if (!cls) {
m_classScope.reset();
m_funcScope.reset();
setInvokeParams(ar);
return checkTypesImpl(ar, type, Type::Variant, coerce);
}
if (m_classScope != cls) {
m_classScope = cls;
m_funcScope.reset();
}
FunctionScopePtr func = m_funcScope;
if (!func) {
func = cls->findFunction(ar, m_name, true, true);
if (!func) {
if (!cls->getAttribute(ClassScope::MayHaveUnknownMethodHandler) &&
!cls->getAttribute(ClassScope::HasUnknownMethodHandler) &&
!cls->getAttribute(ClassScope::InheritsUnknownMethodHandler)) {
if (ar->classMemberExists(m_name, AnalysisResult::MethodName)) {
setDynamicByIdentifier(ar, m_name);
} else {
Compiler::Error(Compiler::UnknownObjectMethod, self);
}
}
m_valid = false;
setInvokeParams(ar);
return checkTypesImpl(ar, type, Type::Variant, coerce);
}
m_funcScope = func;
func->addCaller(getScope());
}
bool valid = true;
m_bindClass = func->isStatic();
// use $this inside a static function
if (m_object->isThis()) {
FunctionScopePtr localfunc = getFunctionScope();
if (localfunc->isStatic()) {
if (getScope()->isFirstPass()) {
Compiler::Error(Compiler::MissingObjectContext, self);
}
valid = false;
}
}
// invoke() will return Variant
if (cls->isInterface() ||
(func->isVirtual() &&
(ar->isSystem() || func->isAbstract() ||
(func->hasOverride() && cls->getAttribute(ClassScope::NotFinal))) &&
!func->isPerfectVirtual())) {
valid = false;
}
if (!valid) {
setInvokeParams(ar);
checkTypesImpl(ar, type, Type::Variant, coerce);
m_valid = false; // so we use invoke() syntax
func->setDynamic();
return m_actualType;
}
return checkParamsAndReturn(ar, type, coerce, func, false);
}