API reference
python:astx:astx.ASTNodes
class ASTNodes
ASTNodes(name: str = 'entry', loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/base.py:425
Declared as: python:astx:astx.base.ASTNodes
AST with a list of nodes, supporting type-specific elements.
Attributes
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
name — Type: str
-
nodes — Type: list[ASTType]
-
position — Type: int
Methods
-
__getitem__ — Support subscripting to get nodes by index.
-
__init__ — Initialize the AST instance.
-
__iter__ — Overload `iter` magic function.
-
__len__ — Return the number of nodes, supports len function.
-
__next__ — Overload `next` magic function.
-
append — Append a new node to the stack.
-
get_struct — Return a string that represents the object.