Class: QgsVbScriptNode¶
Represents an abstract node for a VBScript script.
VBScript node subclasses are either:
statements (inheriting
QgsVbSriptStatement), such as a variable declaration, if statement, for loop.or expressions (inheriting
QgsVbScriptExpression), 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 a VBScript script. |
|
Base class for statement nodes in a VBScript 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.QgsVbScriptNode[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 statementAssignmentStatement: Variable assignment statementFunctionDeclarationStatement: Function declarationExpressionStatement: ExpressionLiteralExpression: LiteralVariableReferenceExpression: Reference to a standard variableMemberAccessExpression: 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])IfStatement: If statementForStatement: For loopForEachStatement: For each loopWhileStatement: While loopExitStatement: Exit loop statementFieldReferenceExpression: Special ESRI specific reference to a layer’s field (eg[FIELD_NAME])
- ArrayLiteralExpression = 12¶
- AssignmentStatement = 2¶
- BinaryOperatorExpression = 8¶
- BlockStatement = 0¶
- ExitStatement = 17¶
- ExpressionStatement = 4¶
- FieldReferenceExpression = 18¶
- ForEachStatement = 15¶
- ForStatement = 14¶
- FunctionCallExpression = 10¶
- FunctionDeclarationStatement = 3¶
- IfStatement = 13¶
- IndexExpression = 11¶
- LiteralExpression = 5¶
- MemberAccessExpression = 7¶
- UnaryOperatorExpression = 9¶
- VariableDeclarationStatement = 1¶
- VariableReferenceExpression = 6¶
- WhileStatement = 16¶
- abstract accept(self, visitor: QgsVbScriptVisitor)[source]¶
Accepts a
visitorto traverse the node.- Parameters:
visitor (QgsVbScriptVisitor)
- abstract clone(self) QgsVbScriptNode | None[source]¶
Creates a copy of the node.
Caller takes ownership of the returned object.
- Return type:
QgsVbScriptNode|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 VBScript string.
- Return type:
str
- abstract nodeType(self) QgsVbScriptNode.NodeType[source]¶
Returns the node type.
- Return type: