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 — Kind of value or operation.; Type: ASTKind
-
mutability — Mutability.; Type: MutabilityKind
-
visibility — Visibility.; Type: VisibilityKind
-
scope — Scope used to resolve names.; Type: ScopeKind
-
name — Name identifying this declaration.; Type: str
-
type_ — Type associated with this expression.; Type: DataType
-
value — Stored value.; Type: Expr
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__init__ — Initialize the VarExprAST instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.