variables
¶
Module for Variables.
InlineVariableDeclaration
¶
InlineVariableDeclaration(name: str, type_: ExprType, mutability: MutabilityKind = MutabilityKind.constant, visibility: VisibilityKind = VisibilityKind.public, scope: ScopeKind = 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.
Source code in src/astx/variables.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
109 110 111 112 113 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
Variable
¶
Bases: DataTypeOps
AST class for the variable usage.
Source code in src/astx/variables.py
154 155 156 157 158 159 160 161 162 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
168 169 170 171 172 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
VariableAssignment
¶
VariableAssignment(name: str, value: Expr, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for variable declaration.
Source code in src/astx/variables.py
123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
141 142 143 144 145 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
VariableDeclaration
¶
VariableDeclaration(name: str, type_: ExprType, mutability: MutabilityKind = MutabilityKind.constant, visibility: VisibilityKind = VisibilityKind.public, scope: ScopeKind = ScopeKind.local, value: Expr = UNDEFINED, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for variable declaration.
Source code in src/astx/variables.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/variables.py
63 64 65 66 67 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|