API reference
python:astx:astx.AST
class AST
AST(loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/base.py:249
Declared as: python:astx:astx.base.AST
AST main expression class.
Attributes
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__hash__ — Return a stable hash for the AST structure.
-
__init__ — Initialize the AST instance.
-
__repr__ — Return an string that represents the object.
-
__str__ — Return an string that represents the object.
-
_get_metadata — Return the metadata for the requested AST.
-
_prepare_struct — Prepare a representation structure for the node.
-
_repr_png_ — Return PNG representation of the Graphviz object.
-
_update_parent — Update the parent node.
-
get_struct — Return a structure that represents the node object.
-
to_json — Return an json string that represents the object.
-
to_yaml — Return an yaml string that represents the object.