QGIS API Documentation 4.3.0-Master (bd2f5e21fd1)
Loading...
Searching...
No Matches
QgsEsriArcadeVariableDeclarationStatement Class Reference

Represents a variable declaration statement. More...

#include <qgsesriarcadescript.h>

Inheritance diagram for QgsEsriArcadeVariableDeclarationStatement:

Public Member Functions

 QgsEsriArcadeVariableDeclarationStatement (const QString &variableName, QgsEsriArcadeExpression *initializer=nullptr)
 Constructor for QgsEsriArcadeVariableDeclarationStatement.
void accept (QgsEsriArcadeVisitor &visitor) const override
 Accepts a visitor to traverse the node.
QgsEsriArcadeNode * clone () const override
 Creates a copy of the node.
QString dump () const override
 Returns the formatted script representation of the node.
QgsEsriArcadeExpression * initializer () const
 Returns the optional initializer expression, or nullptr if uninitialized.
QgsEsriArcadeNode::NodeType nodeType () const override
 Returns the node type.
QString variableName () const
 Returns the declared variable name.
Public Member Functions inherited from QgsEsriArcadeStatement
 ~QgsEsriArcadeStatement () override=default
Public Member Functions inherited from QgsEsriArcadeNode
virtual ~QgsEsriArcadeNode ()=default

Additional Inherited Members

Public Types inherited from QgsEsriArcadeNode
enum class  NodeType {
  BlockStatement , VariableDeclarationStatement , ReturnStatement , AssignmentStatement ,
  FunctionDeclarationStatement , ExpressionStatement , LiteralExpression , VariableReferenceExpression ,
  ProfileVariableReferenceExpression , MemberAccessExpression , BinaryOperatorExpression , UnaryOperatorExpression ,
  FunctionCallExpression , IndexExpression , ArrayLiteralExpression , DictionaryLiteralExpression ,
  IfStatement , ForStatement , ForInStatement , WhileStatement ,
  BreakStatement , ContinueStatement
}
 Node type identifier. More...

Detailed Description

Represents a variable declaration statement.

For example var x = 3;.

Since
QGIS 4.4

Definition at line 289 of file qgsesriarcadescript.h.

Constructor & Destructor Documentation

◆ QgsEsriArcadeVariableDeclarationStatement()

QgsEsriArcadeVariableDeclarationStatement::QgsEsriArcadeVariableDeclarationStatement ( const QString & variableName,
QgsEsriArcadeExpression * initializer = nullptr )
explicit

Constructor for QgsEsriArcadeVariableDeclarationStatement.

Ownership of initializer is transferred to this statement.

Definition at line 86 of file qgsesriarcadescript.cpp.

Member Function Documentation

◆ accept()

void QgsEsriArcadeVariableDeclarationStatement::accept ( QgsEsriArcadeVisitor & visitor) const
overridevirtual

Accepts a visitor to traverse the node.

Implements QgsEsriArcadeNode.

Definition at line 104 of file qgsesriarcadescript.cpp.

◆ clone()

QgsEsriArcadeNode * QgsEsriArcadeVariableDeclarationStatement::clone ( ) const
overridevirtual

Creates a copy of the node.

Caller takes ownership of the returned object.

Implements QgsEsriArcadeNode.

Definition at line 99 of file qgsesriarcadescript.cpp.

◆ dump()

QString QgsEsriArcadeVariableDeclarationStatement::dump ( ) const
overridevirtual

Returns the formatted script representation of the node.

This can be used to export a script node back to a valid Esri arcade script string.

Implements QgsEsriArcadeNode.

Definition at line 91 of file qgsesriarcadescript.cpp.

◆ initializer()

QgsEsriArcadeExpression * QgsEsriArcadeVariableDeclarationStatement::initializer ( ) const
inline

Returns the optional initializer expression, or nullptr if uninitialized.

For the statement var my_var = 3 * 2; this would return the 3 * 2 expression node.

Definition at line 317 of file qgsesriarcadescript.h.

◆ nodeType()

QgsEsriArcadeNode::NodeType QgsEsriArcadeVariableDeclarationStatement::nodeType ( ) const
inlineoverridevirtual

Returns the node type.

Implements QgsEsriArcadeNode.

Definition at line 299 of file qgsesriarcadescript.h.

◆ variableName()

QString QgsEsriArcadeVariableDeclarationStatement::variableName ( ) const
inline

Returns the declared variable name.

For the statement var my_var = 3; this would return "my_var".

Definition at line 309 of file qgsesriarcadescript.h.


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