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 scanWithoutEscapingVariables (QQmlJS::AST::Node *node)
void calcEscapingVariablesForNewContexts ()
void handleTopLevelFunctionFormals (QQmlJS::AST::FunctionExpression *node)
void enterGlobalEnvironment (ContextType compilationMode)
void enterEnvironment (QQmlJS::AST::Node *node, ContextType compilationMode, const QString &namename)
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 namename, 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::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 &namename, QQmlJS::AST::FormalParameterList *formals, QQmlJS::AST::StatementList *body, FunctionNameContext nameContext)
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 45 of file qv4compilerscanfunctions_p.h.

Member Enumeration Documentation

◆ FunctionNameContext

Enumerator
None 
Inner 
Outer 

Definition at line 82 of file qv4compilerscanfunctions_p.h.

Constructor & Destructor Documentation

◆ ScanFunctions()

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

Definition at line 29 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

◆ calcEscapingVariablesForNewContexts()

void ScanFunctions::calcEscapingVariablesForNewContexts ( )

Definition at line 800 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ checkDirectivePrologue()

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

Definition at line 62 of file qv4compilerscanfunctions.cpp.

◆ checkName()

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

Definition at line 87 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ endVisit() [1/13]

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

Definition at line 559 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 570 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 598 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 394 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 375 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 125 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 539 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 518 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 491 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 456 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 479 of file qv4compilerscanfunctions.cpp.

◆ endVisit() [12/13]

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

Definition at line 112 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 621 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 44 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ enterFunction() [1/2]

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

Definition at line 448 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 39 of file qv4compilerscanfunctions.cpp.

◆ enterQmlFunction()

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

Definition at line 72 of file qv4compilerscanfunctions_p.h.

◆ handleTopLevelFunctionFormals()

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

Definition at line 62 of file qv4compilerscanfunctions_p.h.

◆ leaveEnvironment()

void ScanFunctions::leaveEnvironment ( )

Definition at line 56 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 790 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ scanWithoutEscapingVariables()

void QV4::Compiler::ScanFunctions::scanWithoutEscapingVariables ( QQmlJS::AST::Node * node)
inline

Definition at line 53 of file qv4compilerscanfunctions_p.h.

◆ throwRecursionDepthError()

void ScanFunctions::throwRecursionDepthError ( )
overrideprotectedvirtual

Implements QQmlJS::AST::BaseVisitor.

Definition at line 1020 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [1/25]

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

Definition at line 440 of file qv4compilerscanfunctions.cpp.

◆ visit() [2/25]

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

Definition at line 551 of file qv4compilerscanfunctions.cpp.

◆ visit() [3/25]

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

Definition at line 272 of file qv4compilerscanfunctions.cpp.

◆ visit() [4/25]

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

Definition at line 564 of file qv4compilerscanfunctions.cpp.

◆ visit() [5/25]

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

Definition at line 575 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [6/25]

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

Definition at line 380 of file qv4compilerscanfunctions.cpp.

◆ visit() [7/25]

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

Definition at line 364 of file qv4compilerscanfunctions.cpp.

◆ visit() [8/25]

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

Definition at line 496 of file qv4compilerscanfunctions.cpp.

◆ visit() [9/25]

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

Definition at line 117 of file qv4compilerscanfunctions.cpp.

◆ visit() [10/25]

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

Definition at line 130 of file qv4compilerscanfunctions.cpp.

◆ visit() [11/25]

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

Definition at line 333 of file qv4compilerscanfunctions.cpp.

References _allowFuncDecls, _cg, and leaveEnvironment().

Here is the call graph for this function:

◆ visit() [12/25]

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

Definition at line 414 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [13/25]

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

Definition at line 523 of file qv4compilerscanfunctions.cpp.

◆ visit() [14/25]

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

Definition at line 505 of file qv4compilerscanfunctions.cpp.

◆ visit() [15/25]

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

Definition at line 486 of file qv4compilerscanfunctions.cpp.

◆ visit() [16/25]

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

Definition at line 357 of file qv4compilerscanfunctions.cpp.

◆ visit() [17/25]

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

Definition at line 323 of file qv4compilerscanfunctions.cpp.

◆ visit() [18/25]

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

Definition at line 223 of file qv4compilerscanfunctions.cpp.

◆ visit() [19/25]

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

Definition at line 461 of file qv4compilerscanfunctions.cpp.

References _allowFuncDecls.

◆ visit() [20/25]

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

Definition at line 287 of file qv4compilerscanfunctions.cpp.

◆ visit() [21/25]

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

Definition at line 468 of file qv4compilerscanfunctions.cpp.

◆ visit() [22/25]

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

Definition at line 105 of file qv4compilerscanfunctions.cpp.

◆ visit() [23/25]

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

Definition at line 399 of file qv4compilerscanfunctions.cpp.

◆ visit() [24/25]

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

Definition at line 544 of file qv4compilerscanfunctions.cpp.

◆ visit() [25/25]

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

Definition at line 603 of file qv4compilerscanfunctions.cpp.

References _cg.

Member Data Documentation

◆ _allowFuncDecls

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

Definition at line 163 of file qv4compilerscanfunctions_p.h.

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

◆ _cg

◆ _context

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

Definition at line 160 of file qv4compilerscanfunctions_p.h.

◆ _contextStack

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

Definition at line 161 of file qv4compilerscanfunctions_p.h.

◆ _sourceCode

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

Definition at line 159 of file qv4compilerscanfunctions_p.h.

◆ defaultProgramType

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

Definition at line 164 of file qv4compilerscanfunctions_p.h.


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