blocks
¶
Module for different kind of ASTx blocks.
Classes:
-
Block
–The AST tree.
Block
¶
Block(name: str = 'entry', loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: ASTNodes[ASTType]
The AST tree.
Methods:
-
append
–Append a new node to the stack.
-
get_struct
–Return the AST structure of 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/base.py
278 279 280 281 282 283 284 285 286 287 288 |
|
append
¶
append(value: ASTType) -> None
Append a new node to the stack.
Source code in src/astx/base.py
305 306 307 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/blocks.py
22 23 24 25 26 27 28 29 30 31 32 |
|
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 |
|