astx
¶
ASTx.
AST
¶
AST main expression class.
Source code in src/astx/base.py
138 139 140 141 142 143 144 145 146 147 148 149 |
|
get_struct
abstractmethod
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a structure that represents the node object.
Source code in src/astx/base.py
207 208 209 |
|
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 |
|
Argument
¶
Argument(name: str, type_: ExprType, mutability: MutabilityKind = MutabilityKind.constant, default: Expr = UNDEFINED, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Variable
AST class for argument definition.
Source code in src/astx/callables.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/callables.py
58 59 60 61 62 |
|
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 |
|
Arguments
¶
Bases: ASTNodes
AST class for argument definition.
Source code in src/astx/callables.py
69 70 71 72 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/callables.py
78 79 80 81 82 83 84 85 86 87 |
|
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 |
|
BinaryOp
¶
Bases: DataTypeOps
AST class for the binary operator.
Source code in src/astx/datatypes.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure that represents the object.
Source code in src/astx/datatypes.py
158 159 160 161 162 163 164 165 |
|
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 |
|
Block
¶
Block(name: str = 'entry', loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: ASTNodes
The AST tree.
Source code in src/astx/base.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/blocks.py
19 20 21 22 23 24 25 26 27 28 29 |
|
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 |
|
Boolean
¶
Bases: DataType
Boolean data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
DataType
¶
Bases: Expr
AST main expression class.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
DataTypeOps
¶
Bases: DataType
Overload some magic functions used for the main operations.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
Expr
¶
Bases: AST
AST main expression class.
Source code in src/astx/base.py
138 139 140 141 142 143 144 145 146 147 148 149 |
|
get_struct
abstractmethod
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a structure that represents the node object.
Source code in src/astx/base.py
207 208 209 |
|
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 |
|
Float16
¶
Bases: Floating
Float16 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
Float32
¶
Bases: Floating
Float32 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
Float64
¶
Bases: Floating
Float64 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
Floating
¶
Bases: Number
AST for the literal float number.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
ForCountLoop
¶
ForCountLoop(initializer: InlineVariableDeclaration, condition: Expr, update: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for a simple Count-Controlled For
Loop statement.
This is a very basic for
loop, used by languages like C or C++.
Source code in src/astx/flows.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
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 |
|
ForRangeLoop
¶
ForRangeLoop(variable: InlineVariableDeclaration, start: Expr, end: Expr, step: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for For
Loop Range statement.
Source code in src/astx/flows.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
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 |
|
Function
¶
Function(prototype: FunctionPrototype, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function definition.
Source code in src/astx/callables.py
206 207 208 209 210 211 212 213 214 215 216 217 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Get the AST structure that represent the object.
Source code in src/astx/callables.py
237 238 239 240 241 242 243 244 245 246 247 |
|
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 |
|
FunctionCall
¶
FunctionCall(fn: Function, args: tuple[DataType, ...], loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: DataType
AST class for function call.
Source code in src/astx/callables.py
97 98 99 100 101 102 103 104 105 106 107 108 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/callables.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
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 |
|
FunctionPrototype
¶
FunctionPrototype(name: str, args: Arguments, return_type: ExprType, scope: ScopeKind = ScopeKind.global_, visibility: VisibilityKind = VisibilityKind.public, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function prototype declaration.
Source code in src/astx/callables.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Get the AST structure that represent the object.
Source code in src/astx/callables.py
166 167 168 |
|
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 |
|
FunctionReturn
¶
FunctionReturn(value: DataType, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function return
statement.
Source code in src/astx/callables.py
177 178 179 180 181 182 183 184 185 186 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/callables.py
192 193 194 195 196 |
|
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 |
|
If
¶
If(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for if
statement.
Source code in src/astx/flows.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
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 |
|
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 |
|
Int16
¶
Bases: SignedInteger
Int16 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
Int32
¶
Bases: SignedInteger
Int32 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
Int64
¶
Bases: SignedInteger
Int64 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
Int8
¶
Bases: SignedInteger
Int8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
Integer
¶
Bases: Number
Integer number data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
Literal
¶
Literal(*args, **kwargs)
Bases: DataTypeOps
Literal Data type.
Source code in src/astx/datatypes.py
299 300 301 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralBoolean
¶
LiteralBoolean(value: bool, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralBoolean data type class.
Source code in src/astx/datatypes.py
481 482 483 484 485 486 487 488 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralFloat16
¶
LiteralFloat16(value: float, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralFloat16 data type class.
Source code in src/astx/datatypes.py
497 498 499 500 501 502 503 504 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralFloat32
¶
LiteralFloat32(value: float, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralFloat32 data type class.
Source code in src/astx/datatypes.py
513 514 515 516 517 518 519 520 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralFloat64
¶
LiteralFloat64(value: float, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralFloat64 data type class.
Source code in src/astx/datatypes.py
529 530 531 532 533 534 535 536 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralInt128
¶
LiteralInt128(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralInt128 data type class.
Source code in src/astx/datatypes.py
385 386 387 388 389 390 391 392 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralInt16
¶
LiteralInt16(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralInt16 data type class.
Source code in src/astx/datatypes.py
337 338 339 340 341 342 343 344 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralInt32
¶
LiteralInt32(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralInt32 data type class.
Source code in src/astx/datatypes.py
353 354 355 356 357 358 359 360 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralInt64
¶
LiteralInt64(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralInt64 data type class.
Source code in src/astx/datatypes.py
369 370 371 372 373 374 375 376 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralInt8
¶
LiteralInt8(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralInt8 data type class.
Source code in src/astx/datatypes.py
321 322 323 324 325 326 327 328 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralUInt128
¶
LiteralUInt128(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralUInt128 data type class.
Source code in src/astx/datatypes.py
465 466 467 468 469 470 471 472 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralUInt16
¶
LiteralUInt16(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralUInt16 data type class.
Source code in src/astx/datatypes.py
417 418 419 420 421 422 423 424 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralUInt32
¶
LiteralUInt32(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralUInt32 data type class.
Source code in src/astx/datatypes.py
433 434 435 436 437 438 439 440 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralUInt64
¶
LiteralUInt64(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralUInt64 data type class.
Source code in src/astx/datatypes.py
449 450 451 452 453 454 455 456 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
LiteralUInt8
¶
LiteralUInt8(value: int, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Literal
LiteralUInt8 data type class.
Source code in src/astx/datatypes.py
401 402 403 404 405 406 407 408 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST representation for the object.
Source code in src/astx/datatypes.py
308 309 310 311 312 |
|
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 |
|
Module
¶
Module(name: str = 'main', loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Block
AST main expression class.
Source code in src/astx/packages.py
49 50 51 52 53 54 55 56 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/packages.py
67 68 69 70 71 72 73 74 75 76 77 |
|
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 |
|
Number
¶
Bases: DataTypeOps
Number data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
OperatorType
¶
Bases: DataType
AST main expression class.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
Package
¶
Package(name: str = 'main', modules: list[Module] = [], packages: list[Package] = [], loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: ASTNodes
AST class for Package.
Source code in src/astx/packages.py
88 89 90 91 92 93 94 95 96 97 98 99 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/packages.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
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 |
|
Program
¶
Program(name: str = 'main', target: Target = Target('', ''), modules: list[Module] = [], packages: list[Package] = [], loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: Package
AST class for Program.
Source code in src/astx/packages.py
134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/packages.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
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 |
|
SignedInteger
¶
Bases: Integer
Signed integer number data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
StatementType
¶
Bases: AST
AST main expression class.
Source code in src/astx/base.py
138 139 140 141 142 143 144 145 146 147 148 149 |
|
Target
¶
Bases: Expr
Define the Architecture target for the program.
Source code in src/astx/packages.py
30 31 32 33 34 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/packages.py
36 37 38 39 40 |
|
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 |
|
UInt128
¶
Bases: UnsignedInteger
UInt8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
UInt16
¶
Bases: UnsignedInteger
UInt8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
UInt32
¶
Bases: UnsignedInteger
UInt8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
UInt64
¶
Bases: UnsignedInteger
UInt8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
UInt8
¶
Bases: UnsignedInteger
UInt8 data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
317 318 319 320 321 |
|
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 |
|
UnaryOp
¶
Bases: DataTypeOps
AST class for the unary operator.
Source code in src/astx/datatypes.py
93 94 95 96 97 98 99 100 101 102 103 104 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/datatypes.py
110 111 112 113 114 |
|
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 |
|
Undefined
¶
Bases: Expr
Undefined expression class.
Source code in src/astx/base.py
138 139 140 141 142 143 144 145 146 147 148 149 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a simple structure that represents the object.
Source code in src/astx/base.py
286 287 288 289 290 |
|
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 |
|
UnsignedInteger
¶
Bases: Integer
Unsigned integer number data type expression.
Source code in src/astx/base.py
301 302 303 304 305 306 307 308 309 310 311 |
|
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 |
|
While
¶
While(condition: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for while
statement.
Source code in src/astx/flows.py
186 187 188 189 190 191 192 193 194 195 196 197 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
203 204 205 206 207 208 209 210 211 212 213 214 |
|
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 |
|
get_version
¶
get_version() -> str
Return the program version.
Source code in src/astx/__init__.py
103 104 105 106 107 108 |
|