Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QV4::Compiler::ScanFunctions Class Reference

#include <qv4compilerscanfunctions_p.h>

Inheritance diagram for QV4::Compiler::ScanFunctions:
Collaboration diagram for QV4::Compiler::ScanFunctions:

Public Member Functions

 ScanFunctions (Codegen *cg, const QString &sourceCode, ContextType defaultProgramType)
void operator() (QQmlJS::AST::Node *node)
void handleTopLevelFunctionFormals (QQmlJS::AST::FunctionExpression *node)
void enterGlobalEnvironment (ContextType compilationMode)
void enterEnvironment (QQmlJS::AST::Node *node, ContextType compilationMode, const QString &name)
void leaveEnvironment ()
void enterQmlFunction (QQmlJS::AST::FunctionExpression *ast)

Protected Types

enum class  FunctionNameContext { None , Inner , Outer }

Protected Member Functions

void checkDirectivePrologue (QQmlJS::AST::StatementList *ast)
void checkName (QStringView name, const QQmlJS::SourceLocation &loc)
bool visit (QQmlJS::AST::Program *ast) override
void endVisit (QQmlJS::AST::Program *) override
bool visit (QQmlJS::AST::ESModule *ast) override
void endVisit (QQmlJS::AST::ESModule *) override
bool visit (QQmlJS::AST::ExportDeclaration *declaration) override
bool visit (QQmlJS::AST::ImportDeclaration *declaration) override
bool visit (QQmlJS::AST::CallExpression *ast) override
bool visit (QQmlJS::AST::PatternElement *ast) override
bool visit (QQmlJS::AST::IdentifierExpression *ast) override
bool visit (QQmlJS::AST::ExpressionStatement *ast) override
bool visit (QQmlJS::AST::FunctionExpression *ast) override
bool visit (QQmlJS::AST::TemplateLiteral *ast) override
bool visit (QQmlJS::AST::SuperLiteral *) override
bool visit (QQmlJS::AST::FieldMemberExpression *) override
bool visit (QQmlJS::AST::ArrayPattern *) override
bool enterFunction (QQmlJS::AST::FunctionExpression *ast, FunctionNameContext nameContext)
void endVisit (QQmlJS::AST::FunctionExpression *) override
bool visit (QQmlJS::AST::ObjectPattern *ast) override
bool visit (QQmlJS::AST::PatternProperty *ast) override
void endVisit (QQmlJS::AST::PatternProperty *) override
bool visit (QQmlJS::AST::FunctionDeclaration *ast) override
void endVisit (QQmlJS::AST::FunctionDeclaration *) override
bool visit (QQmlJS::AST::ClassExpression *ast) override
void endVisit (QQmlJS::AST::ClassExpression *) override
bool visit (QQmlJS::AST::ClassDeclaration *ast) override
void endVisit (QQmlJS::AST::ClassDeclaration *) override
bool visit (QQmlJS::AST::DoWhileStatement *ast) override
bool visit (QQmlJS::AST::ForStatement *ast) override
void endVisit (QQmlJS::AST::ForStatement *) override
bool visit (QQmlJS::AST::ForEachStatement *ast) override
void endVisit (QQmlJS::AST::ForEachStatement *) override
bool visit (QQmlJS::AST::ThisExpression *ast) override
bool visit (QQmlJS::AST::Block *ast) override
void endVisit (QQmlJS::AST::Block *ast) override
bool visit (QQmlJS::AST::CaseBlock *ast) override
void endVisit (QQmlJS::AST::CaseBlock *ast) override
bool visit (QQmlJS::AST::Catch *ast) override
void endVisit (QQmlJS::AST::Catch *ast) override
bool visit (QQmlJS::AST::WithStatement *ast) override
void endVisit (QQmlJS::AST::WithStatement *ast) override
void throwRecursionDepthError () override
bool enterFunction (QQmlJS::AST::Node *ast, const QString &name, QQmlJS::AST::FormalParameterList *formals, QQmlJS::AST::StatementList *body, FunctionNameContext nameContext)
void calcEscapingVariables ()
Protected Member Functions inherited from QQmlJS::AST::Visitor
 Visitor (quint16 parentRecursionDepth=0)
bool preVisit (Node *) override
void postVisit (Node *) override
Protected Member Functions inherited from QQmlJS::AST::BaseVisitor
 BaseVisitor (quint16 parentRecursionDepth=0)
virtual ~BaseVisitor ()
quint16 recursionDepth () const

Protected Attributes

Codegen_cg
const QString _sourceCode
Context_context
QStack< Context * > _contextStack
bool _allowFuncDecls
ContextType defaultProgramType
Protected Attributes inherited from QQmlJS::AST::BaseVisitor
quint16 m_recursionDepth = 0

Detailed Description

Definition at line 43 of file qv4compilerscanfunctions_p.h.

Member Enumeration Documentation

◆ FunctionNameContext

Enumerator
None 
Inner 
Outer 

Definition at line 72 of file qv4compilerscanfunctions_p.h.

Constructor & Destructor Documentation

◆ ScanFunctions()

ScanFunctions::ScanFunctions ( Codegen * cg,
const QString & sourceCode,
ContextType defaultProgramType )

Definition at line 28 of file qv4compilerscanfunctions.cpp.

References ScanFunctions(), _allowFuncDecls, and _cg.

Referenced by ScanFunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ calcEscapingVariables()

void ScanFunctions::calcEscapingVariables ( )
protected

Definition at line 722 of file qv4compilerscanfunctions.cpp.

References _cg.

Referenced by operator()().

Here is the caller graph for this function:

◆ checkDirectivePrologue()

void ScanFunctions::checkDirectivePrologue ( QQmlJS::AST::StatementList * ast)
protected

Definition at line 69 of file qv4compilerscanfunctions.cpp.

◆ checkName()

void ScanFunctions::checkName ( QStringView name,
const QQmlJS::SourceLocation & loc )
protected

Definition at line 94 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ endVisit() [1/13]

void ScanFunctions::endVisit ( QQmlJS::AST::Block * ast)
overrideprotected

Definition at line 577 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [2/13]

void ScanFunctions::endVisit ( QQmlJS::AST::CaseBlock * ast)
overrideprotected

Definition at line 588 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [3/13]

void ScanFunctions::endVisit ( QQmlJS::AST::Catch * ast)
overrideprotected

Definition at line 616 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [4/13]

void ScanFunctions::endVisit ( QQmlJS::AST::ClassDeclaration * )
overrideprotected

Definition at line 401 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [5/13]

void ScanFunctions::endVisit ( QQmlJS::AST::ClassExpression * )
overrideprotected

Definition at line 382 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [6/13]

void ScanFunctions::endVisit ( QQmlJS::AST::ESModule * )
overrideprotected

Definition at line 132 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [7/13]

void ScanFunctions::endVisit ( QQmlJS::AST::ForEachStatement * )
overrideprotected

Definition at line 557 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [8/13]

void ScanFunctions::endVisit ( QQmlJS::AST::ForStatement * )
overrideprotected

Definition at line 536 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [9/13]

void ScanFunctions::endVisit ( QQmlJS::AST::FunctionDeclaration * )
overrideprotected

Definition at line 509 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [10/13]

void ScanFunctions::endVisit ( QQmlJS::AST::FunctionExpression * )
overrideprotected

Definition at line 474 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [11/13]

void ScanFunctions::endVisit ( QQmlJS::AST::PatternProperty * )
overrideprotected

Definition at line 497 of file qv4compilerscanfunctions.cpp.

◆ endVisit() [12/13]

void ScanFunctions::endVisit ( QQmlJS::AST::Program * )
overrideprotected

Definition at line 119 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ endVisit() [13/13]

void ScanFunctions::endVisit ( QQmlJS::AST::WithStatement * ast)
overrideprotected

Definition at line 639 of file qv4compilerscanfunctions.cpp.

References leaveEnvironment().

Here is the call graph for this function:

◆ enterEnvironment()

void ScanFunctions::enterEnvironment ( QQmlJS::AST::Node * node,
ContextType compilationMode,
const QString & name )

Definition at line 51 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ enterFunction() [1/2]

bool ScanFunctions::enterFunction ( QQmlJS::AST::FunctionExpression * ast,
FunctionNameContext nameContext )
protected

Definition at line 466 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ enterFunction() [2/2]

bool QV4::Compiler::ScanFunctions::enterFunction ( QQmlJS::AST::Node * ast,
const QString & name,
QQmlJS::AST::FormalParameterList * formals,
QQmlJS::AST::StatementList * body,
FunctionNameContext nameContext )
protected

◆ enterGlobalEnvironment()

void ScanFunctions::enterGlobalEnvironment ( ContextType compilationMode)

Definition at line 46 of file qv4compilerscanfunctions.cpp.

◆ enterQmlFunction()

void QV4::Compiler::ScanFunctions::enterQmlFunction ( QQmlJS::AST::FunctionExpression * ast)
inline

Definition at line 62 of file qv4compilerscanfunctions_p.h.

◆ handleTopLevelFunctionFormals()

void QV4::Compiler::ScanFunctions::handleTopLevelFunctionFormals ( QQmlJS::AST::FunctionExpression * node)
inline

Definition at line 52 of file qv4compilerscanfunctions_p.h.

◆ leaveEnvironment()

void ScanFunctions::leaveEnvironment ( )

Definition at line 63 of file qv4compilerscanfunctions.cpp.

Referenced by endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), endVisit(), and visit().

Here is the caller graph for this function:

◆ operator()()

void ScanFunctions::operator() ( QQmlJS::AST::Node * node)

Definition at line 38 of file qv4compilerscanfunctions.cpp.

References calcEscapingVariables().

Here is the call graph for this function:

◆ throwRecursionDepthError()

void ScanFunctions::throwRecursionDepthError ( )
overrideprotectedvirtual

Implements QQmlJS::AST::BaseVisitor.

Definition at line 893 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [1/26]

bool ScanFunctions::visit ( QQmlJS::AST::ArrayPattern * ast)
overrideprotected

Definition at line 458 of file qv4compilerscanfunctions.cpp.

◆ visit() [2/26]

bool ScanFunctions::visit ( QQmlJS::AST::Block * ast)
overrideprotected

Definition at line 569 of file qv4compilerscanfunctions.cpp.

◆ visit() [3/26]

bool ScanFunctions::visit ( QQmlJS::AST::CallExpression * ast)
overrideprotected

Definition at line 279 of file qv4compilerscanfunctions.cpp.

◆ visit() [4/26]

bool ScanFunctions::visit ( QQmlJS::AST::CaseBlock * ast)
overrideprotected

Definition at line 582 of file qv4compilerscanfunctions.cpp.

◆ visit() [5/26]

bool ScanFunctions::visit ( QQmlJS::AST::Catch * ast)
overrideprotected

Definition at line 593 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [6/26]

bool ScanFunctions::visit ( QQmlJS::AST::ClassDeclaration * ast)
overrideprotected

Definition at line 387 of file qv4compilerscanfunctions.cpp.

◆ visit() [7/26]

bool ScanFunctions::visit ( QQmlJS::AST::ClassExpression * ast)
overrideprotected

Definition at line 371 of file qv4compilerscanfunctions.cpp.

◆ visit() [8/26]

bool ScanFunctions::visit ( QQmlJS::AST::DoWhileStatement * ast)
overrideprotected

Definition at line 514 of file qv4compilerscanfunctions.cpp.

◆ visit() [9/26]

bool ScanFunctions::visit ( QQmlJS::AST::ESModule * ast)
overrideprotected

Definition at line 124 of file qv4compilerscanfunctions.cpp.

◆ visit() [10/26]

bool ScanFunctions::visit ( QQmlJS::AST::ExportDeclaration * declaration)
overrideprotected

Definition at line 137 of file qv4compilerscanfunctions.cpp.

◆ visit() [11/26]

bool ScanFunctions::visit ( QQmlJS::AST::ExpressionStatement * ast)
overrideprotected

Definition at line 340 of file qv4compilerscanfunctions.cpp.

References _cg, and leaveEnvironment().

Here is the call graph for this function:

◆ visit() [12/26]

bool ScanFunctions::visit ( QQmlJS::AST::FieldMemberExpression * ast)
overrideprotected

Definition at line 432 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [13/26]

bool ScanFunctions::visit ( QQmlJS::AST::ForEachStatement * ast)
overrideprotected

Definition at line 541 of file qv4compilerscanfunctions.cpp.

◆ visit() [14/26]

bool ScanFunctions::visit ( QQmlJS::AST::ForStatement * ast)
overrideprotected

Definition at line 523 of file qv4compilerscanfunctions.cpp.

◆ visit() [15/26]

bool ScanFunctions::visit ( QQmlJS::AST::FunctionDeclaration * ast)
overrideprotected

Definition at line 504 of file qv4compilerscanfunctions.cpp.

◆ visit() [16/26]

bool ScanFunctions::visit ( QQmlJS::AST::FunctionExpression * ast)
overrideprotected

Definition at line 364 of file qv4compilerscanfunctions.cpp.

◆ visit() [17/26]

bool ScanFunctions::visit ( QQmlJS::AST::IdentifierExpression * ast)
overrideprotected

Definition at line 330 of file qv4compilerscanfunctions.cpp.

◆ visit() [18/26]

bool ScanFunctions::visit ( QQmlJS::AST::ImportDeclaration * declaration)
overrideprotected

Definition at line 230 of file qv4compilerscanfunctions.cpp.

◆ visit() [19/26]

bool ScanFunctions::visit ( QQmlJS::AST::ObjectPattern * ast)
overrideprotected

Definition at line 479 of file qv4compilerscanfunctions.cpp.

References _allowFuncDecls.

◆ visit() [20/26]

bool ScanFunctions::visit ( QQmlJS::AST::PatternElement * ast)
overrideprotected

Definition at line 294 of file qv4compilerscanfunctions.cpp.

◆ visit() [21/26]

bool ScanFunctions::visit ( QQmlJS::AST::PatternProperty * ast)
overrideprotected

Definition at line 486 of file qv4compilerscanfunctions.cpp.

◆ visit() [22/26]

bool ScanFunctions::visit ( QQmlJS::AST::Program * ast)
overrideprotected

Definition at line 112 of file qv4compilerscanfunctions.cpp.

◆ visit() [23/26]

bool ScanFunctions::visit ( QQmlJS::AST::SuperLiteral * )
overrideprotected

Definition at line 417 of file qv4compilerscanfunctions.cpp.

◆ visit() [24/26]

bool ScanFunctions::visit ( QQmlJS::AST::TemplateLiteral * ast)
overrideprotected

Definition at line 406 of file qv4compilerscanfunctions.cpp.

◆ visit() [25/26]

bool ScanFunctions::visit ( QQmlJS::AST::ThisExpression * ast)
overrideprotected

Definition at line 562 of file qv4compilerscanfunctions.cpp.

◆ visit() [26/26]

bool ScanFunctions::visit ( QQmlJS::AST::WithStatement * ast)
overrideprotected

Definition at line 621 of file qv4compilerscanfunctions.cpp.

References _cg.

Member Data Documentation

◆ _allowFuncDecls

bool QV4::Compiler::ScanFunctions::_allowFuncDecls
protected

Definition at line 155 of file qv4compilerscanfunctions_p.h.

Referenced by ScanFunctions(), and visit().

◆ _cg

◆ _context

Context* QV4::Compiler::ScanFunctions::_context
protected

Definition at line 152 of file qv4compilerscanfunctions_p.h.

◆ _contextStack

QStack<Context *> QV4::Compiler::ScanFunctions::_contextStack
protected

Definition at line 153 of file qv4compilerscanfunctions_p.h.

◆ _sourceCode

const QString QV4::Compiler::ScanFunctions::_sourceCode
protected

Definition at line 151 of file qv4compilerscanfunctions_p.h.

◆ defaultProgramType

ContextType QV4::Compiler::ScanFunctions::defaultProgramType
protected

Definition at line 156 of file qv4compilerscanfunctions_p.h.


The documentation for this class was generated from the following files: