本文整理汇总了C++中AnalysisResultPtr::appendExtraCode方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::appendExtraCode方法的具体用法?C++ AnalysisResultPtr::appendExtraCode怎么用?C++ AnalysisResultPtr::appendExtraCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::appendExtraCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onParse
void SimpleFunctionCall::onParse(AnalysisResultPtr ar) {
if (m_class) return;
FileScopePtr fs = ar->getFileScope();
ConstructPtr self = shared_from_this();
if (m_className.empty()) {
CodeErrorPtr codeError = ar->getCodeError();
switch (m_type) {
case CreateFunction:
if (m_params->getCount() == 2 &&
(*m_params)[0]->isLiteralString() &&
(*m_params)[1]->isLiteralString()) {
FunctionScopePtr func = ar->getFunctionScope();
if (func) func->disableInline();
string params = (*m_params)[0]->getLiteralString();
string body = (*m_params)[1]->getLiteralString();
m_lambda = CodeGenerator::GetNewLambda();
string code = "function " + m_lambda + "(" + params + ") "
"{" + body + "}";
ar->appendExtraCode(code);
}
break;
case VariableArgumentFunction:
ar->getFileScope()->setAttribute(FileScope::VariableArgument);
break;
case ExtractFunction:
ar->getCodeError()->record(self, CodeError::UseExtract, self);
ar->getFileScope()->setAttribute(FileScope::ContainsLDynamicVariable);
ar->getFileScope()->setAttribute(FileScope::ContainsExtract);
break;
case CompactFunction:
ar->getFileScope()->setAttribute(FileScope::ContainsDynamicVariable);
ar->getFileScope()->setAttribute(FileScope::ContainsCompact);
break;
case ShellExecFunction:
ar->getCodeError()->record(self, CodeError::UseShellExec, self);
break;
case GetDefinedVarsFunction:
ar->getFileScope()->setAttribute(FileScope::ContainsGetDefinedVars);
ar->getFileScope()->setAttribute(FileScope::ContainsCompact);
break;
default:
CHECK_HOOK(onSimpleFunctionCallFuncType);
break;
}
}
string call = getText();
string name = m_name;
if (!m_className.empty()) {
name = m_className + "::" + name;
}
ar->getDependencyGraph()->add(DependencyGraph::KindOfFunctionCall, call,
shared_from_this(), name);
}