本文整理汇总了C++中FileScopePtr::getPseudoMain方法的典型用法代码示例。如果您正苦于以下问题:C++ FileScopePtr::getPseudoMain方法的具体用法?C++ FileScopePtr::getPseudoMain怎么用?C++ FileScopePtr::getPseudoMain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileScopePtr
的用法示例。
在下文中一共展示了FileScopePtr::getPseudoMain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: analyzeInclude
bool IncludeExpression::analyzeInclude(AnalysisResultConstPtr ar,
const std::string &include) {
ConstructPtr self = shared_from_this();
FileScopePtr file = ar->findFileScope(include);
if (!file) {
Compiler::Error(Compiler::PHPIncludeFileNotFound, self);
return false;
}
FunctionScopePtr func = getFunctionScope();
if (func && file->getPseudoMain()) {
file->getPseudoMain()->addUse(func, BlockScope::UseKindInclude);
}
return true;
}
示例2: analyzeInclude
void IncludeExpression::analyzeInclude(AnalysisResultPtr ar,
const std::string &include) {
ConstructPtr self = shared_from_this();
FileScopePtr file = ar->findFileScope(include);
if (!file && !include.empty()) {
Compiler::Error(Compiler::PHPIncludeFileNotFound, self);
return;
}
FunctionScopePtr func = getFunctionScope();
getFileScope()->addIncludeDependency(ar, m_include,
func && func->isInlined());
if (func && file->getPseudoMain()) {
file->getPseudoMain()->addUse(func, BlockScope::UseKindInclude);
}
}
示例3: postOptimize
ExpressionPtr IncludeExpression::postOptimize(AnalysisResultConstPtr ar) {
if (!m_include.empty()) {
if (!m_depsSet) {
analyzeInclude(ar, m_include);
m_depsSet = true;
}
FileScopePtr fs = ar->findFileScope(m_include);
if (fs && fs->getPseudoMain()) {
if (!Option::KeepStatementsWithNoEffect) {
if (ExpressionPtr rep = fs->getEffectiveImpl(ar)) {
recomputeEffects();
return replaceValue(rep->clone());
}
}
} else {
m_include = "";
}
}
return ExpressionPtr();
}