API reference
python:astx:astx.StructDeclStmt
class StructDeclStmt
StructDeclStmt(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:395
Declared as: python:astx:astx.classes.StructDeclStmt
AST class for struct declaration.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
name — Name identifying this declaration.; Type: str
-
attributes — Attributes.; Type: ASTNodes[VariableDeclaration]
-
visibility — Visibility.; Type: VisibilityKind
-
decorators — Decorators.; Type: ASTNodes[Expr]
-
methods — Methods.; Type: ASTNodes[FunctionDef]
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__init__ — Initialize StructDeclStmt instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.