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 45 of file qv4compilerscanfunctions_p.h.

Member Enumeration Documentation

◆ FunctionNameContext

Enumerator
None 
Inner 
Outer 

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

◆ calcEscapingVariables()

void ScanFunctions::calcEscapingVariables ( )
protected

Definition at line 771 of file qv4compilerscanfunctions.cpp.

References _cg, Break, and Continue.

Referenced by operator()().

Here is the caller graph for this function:

◆ checkDirectivePrologue()

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

Definition at line 70 of file qv4compilerscanfunctions.cpp.

◆ checkName()

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

Definition at line 95 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ endVisit() [1/13]

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

Definition at line 578 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 589 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 617 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 402 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 383 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 133 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 558 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 537 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 510 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 475 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 498 of file qv4compilerscanfunctions.cpp.

◆ endVisit() [12/13]

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

Definition at line 120 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 640 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 52 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ enterFunction() [1/2]

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

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

◆ enterQmlFunction()

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

Definition at line 64 of file qv4compilerscanfunctions_p.h.

◆ handleTopLevelFunctionFormals()

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

Definition at line 54 of file qv4compilerscanfunctions_p.h.

◆ leaveEnvironment()

void ScanFunctions::leaveEnvironment ( )

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

References _cg.

◆ visit() [1/26]

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

Definition at line 459 of file qv4compilerscanfunctions.cpp.

◆ visit() [2/26]

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

Definition at line 570 of file qv4compilerscanfunctions.cpp.

◆ visit() [3/26]

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

Definition at line 280 of file qv4compilerscanfunctions.cpp.

◆ visit() [4/26]

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

Definition at line 583 of file qv4compilerscanfunctions.cpp.

◆ visit() [5/26]

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

Definition at line 594 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [6/26]

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

Definition at line 388 of file qv4compilerscanfunctions.cpp.

◆ visit() [7/26]

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

Definition at line 372 of file qv4compilerscanfunctions.cpp.

◆ visit() [8/26]

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

Definition at line 515 of file qv4compilerscanfunctions.cpp.

◆ visit() [9/26]

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

Definition at line 125 of file qv4compilerscanfunctions.cpp.

◆ visit() [10/26]

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

Definition at line 138 of file qv4compilerscanfunctions.cpp.

◆ visit() [11/26]

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

Definition at line 341 of file qv4compilerscanfunctions.cpp.

References _allowFuncDecls, _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 433 of file qv4compilerscanfunctions.cpp.

References _cg.

◆ visit() [13/26]

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

Definition at line 542 of file qv4compilerscanfunctions.cpp.

◆ visit() [14/26]

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

Definition at line 524 of file qv4compilerscanfunctions.cpp.

◆ visit() [15/26]

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

Definition at line 505 of file qv4compilerscanfunctions.cpp.

◆ visit() [16/26]

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

Definition at line 365 of file qv4compilerscanfunctions.cpp.

◆ visit() [17/26]

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

Definition at line 331 of file qv4compilerscanfunctions.cpp.

◆ visit() [18/26]

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

Definition at line 231 of file qv4compilerscanfunctions.cpp.

◆ visit() [19/26]

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

Definition at line 480 of file qv4compilerscanfunctions.cpp.

References _allowFuncDecls.

◆ visit() [20/26]

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

Definition at line 295 of file qv4compilerscanfunctions.cpp.

◆ visit() [21/26]

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

Definition at line 487 of file qv4compilerscanfunctions.cpp.

◆ visit() [22/26]

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

Definition at line 113 of file qv4compilerscanfunctions.cpp.

◆ visit() [23/26]

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

Definition at line 418 of file qv4compilerscanfunctions.cpp.

◆ visit() [24/26]

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

Definition at line 407 of file qv4compilerscanfunctions.cpp.

◆ visit() [25/26]

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

Definition at line 563 of file qv4compilerscanfunctions.cpp.

◆ visit() [26/26]

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

Definition at line 622 of file qv4compilerscanfunctions.cpp.

References _cg.

Member Data Documentation

◆ _allowFuncDecls

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

Definition at line 157 of file qv4compilerscanfunctions_p.h.

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

◆ _cg

◆ _context

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

Definition at line 154 of file qv4compilerscanfunctions_p.h.

◆ _contextStack

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

Definition at line 155 of file qv4compilerscanfunctions_p.h.

◆ _sourceCode

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

Definition at line 153 of file qv4compilerscanfunctions_p.h.

◆ defaultProgramType

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

Definition at line 158 of file qv4compilerscanfunctions_p.h.


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