API reference
python:astx:astx.classes.StructDefStmt
class StructDefStmt
StructDefStmt(name: str, attributes: Iterable[VariableDeclaration] | ASTNodes[VariableDeclaration] = [], decorators: Iterable[Expr] | ASTNodes[Expr] = [], methods: Iterable[FunctionDef] | ASTNodes[FunctionDef] = [], visibility: VisibilityKind = VisibilityKind.public, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/classes.py:592
AST class for struct definition.
Attributes
-
name — Type: str
-
attributes — Type: ASTNodes[VariableDeclaration]
-
visibility — Type: VisibilityKind
-
decorators — Type: ASTNodes[Expr]
-
methods — Type: ASTNodes[FunctionDef]
-
kind — Type: ASTKind
Methods
-
__init__ — Initialize StructDefStmt instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.
Attributes
- kind —