variables
¶
Module for Variables.
Classes:
-
InlineVariableDeclaration
–AST class for inline variable declaration expression.
-
Variable
–AST class for the variable usage.
-
VariableAssignment
–AST class for variable declaration.
-
VariableDeclaration
–AST class for variable declaration.
InlineVariableDeclaration
¶
InlineVariableDeclaration(name: str, type_: DataType, mutability: MutabilityKind = constant, visibility: VisibilityKind = public, scope: ScopeKind = local, value: Expr = UNDEFINED, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for inline variable declaration expression.
Can be used in expressions like for loops.
Methods:
-
get_struct
–Return a string that represents the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/variables.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
113 114 115 116 117 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
Variable
¶
Variable(name: str, type_: DataType = AnyType(), loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: DataTypeOps
AST class for the variable usage.
Methods:
-
get_struct
–Return a string that represents the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/variables.py
161 162 163 164 165 166 167 168 169 170 171 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
177 178 179 180 181 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
VariableAssignment
¶
VariableAssignment(name: str, value: Expr, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for variable declaration.
Methods:
-
get_struct
–Return a string that represents the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/variables.py
128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
146 147 148 149 150 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
VariableDeclaration
¶
VariableDeclaration(name: str, type_: DataType, mutability: MutabilityKind = constant, visibility: VisibilityKind = public, scope: ScopeKind = local, value: Expr = UNDEFINED, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for variable declaration.
Methods:
-
get_struct
–Return a string that represents the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/variables.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
66 67 68 69 70 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|