API reference
python:astx:astx.InlineVariableDeclaration
class InlineVariableDeclaration
InlineVariableDeclaration(name: str, type_: DataType, mutability: MutabilityKind = MutabilityKind.constant, visibility: VisibilityKind = VisibilityKind.public, scope: ScopeKind = ScopeKind.local, value: Expr = UNDEFINED, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/data.py:106
Declared as: python:astx:astx.data.InlineVariableDeclaration
AST class for inline variable declaration expression.
Can be used in expressions like for loops.
Attributes
-
scope — Scope used to resolve names.; Type: ScopeKind
-
visibility — Visibility.; Type: VisibilityKind
-
kind — Kind of value or operation.; Type: ASTKind
-
mutability — Mutability.; Type: MutabilityKind
-
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
-
nbytes — Type: int
Methods
-
__init__ — Initialize the VarExprAST instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.