Class: QgsEsriArcadeNode¶
Represents an abstract node for an Esri Arcade script.
Arcade node subclasses are either:
statements (inheriting
QgsEsriArcadeStatement), such as a variable declaration, if statement, for loop.or expressions (inheriting
QgsEsriArcadeExpression), which are a portion of a statement representing an expression. For example1+2,Upper('A string'), or literals like255or'a string'.
Added in version 4.4.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: accept(), clone(), dump(), nodeType()
List of all members, including inherited members
Class Hierarchy¶
Subclasses¶
Base class for expression nodes in an Esri Arcade script. |
|
Base class for statement nodes in an Esri Arcade script. |
Enums
Node type identifier. |
Abstract Methods
Accepts a visitor to traverse the node. |
|
Creates a copy of the node. |
|
Returns the formatted script representation of the node. |
|
Returns the node type. |
- class qgis.core.QgsEsriArcadeNode[source]¶
Bases:
object- class NodeType(*values)¶
Bases:
EnumNode type identifier.
BlockStatement: Block statement (a list of statements grouped together in a block)VariableDeclarationStatement: Variable declaration statementReturnStatement: Return statementAssignmentStatement: Variable assignment statementFunctionDeclarationStatement: Function declarationExpressionStatement: ExpressionLiteralExpression: LiteralVariableReferenceExpression: Reference to a standard variableProfileVariableReferenceExpression: Reference to a profile variable (eg$feature)MemberAccessExpression: Member access via bracket or notation (eg$feature.ATTRIBUTEor$feature["ATTRIBUTE"])BinaryOperatorExpression: Binary OperatorUnaryOperatorExpression: OperatorFunctionCallExpression: Function callIndexExpression: Index operatorArrayLiteralExpression: A literal array, where the element values may be expressions themselves (eg[1, 2, 3/4])DictionaryLiteralExpression: A literal dictionary, eg{key: 1, other_key: 2}IfStatement: If statementForStatement: For loopForInStatement: For x in y loopWhileStatement: While loopBreakStatement: Break statementContinueStatement: Continue statement
- ArrayLiteralExpression = 14¶
- AssignmentStatement = 3¶
- BinaryOperatorExpression = 10¶
- BlockStatement = 0¶
- BreakStatement = 20¶
- ContinueStatement = 21¶
- DictionaryLiteralExpression = 15¶
- ExpressionStatement = 5¶
- ForInStatement = 18¶
- ForStatement = 17¶
- FunctionCallExpression = 12¶
- FunctionDeclarationStatement = 4¶
- IfStatement = 16¶
- IndexExpression = 13¶
- LiteralExpression = 6¶
- MemberAccessExpression = 9¶
- ProfileVariableReferenceExpression = 8¶
- ReturnStatement = 2¶
- UnaryOperatorExpression = 11¶
- VariableDeclarationStatement = 1¶
- VariableReferenceExpression = 7¶
- WhileStatement = 19¶
- abstract accept(self, visitor: QgsEsriArcadeVisitor)[source]¶
Accepts a
visitorto traverse the node.- Parameters:
visitor (QgsEsriArcadeVisitor)
- abstract clone(self) QgsEsriArcadeNode | None[source]¶
Creates a copy of the node.
Caller takes ownership of the returned object.
- Return type:
QgsEsriArcadeNode|None
- abstract dump(self) str[source]¶
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.
- Return type:
str
- abstract nodeType(self) QgsEsriArcadeNode.NodeType[source]¶
Returns the node type.
- Return type: