API reference
python:astx:astx.data.VariableDeclaration
class VariableDeclaration
VariableDeclaration(name: str, type_: DataType, mutability: MutabilityKind = MutabilityKind.constant, visibility: VisibilityKind = VisibilityKind.public, scope: ScopeKind = ScopeKind.local, value: Expr = UNDEFINED, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/data.py:30
AST class for variable declaration.
Attributes
-
kind — Type: ASTKind
-
mutability — Type: MutabilityKind
-
visibility — Type: VisibilityKind
-
scope — Type: ScopeKind
-
name — Type: str
-
type_ — Type: DataType
-
value — Type: Expr
Methods
-
__init__ — Initialize the VarExprAST instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.