astx.classes

astx.classes

Source: packages/astx/src/astx/classes.py

title: Module for classes definitions/declarations.

Classes

ClassDeclStmt(StatementType)

title: AST class for class declaration.
attributes:
  kind:
    type: ASTKind
  name:
    type: str
  bases:
    type: ASTNodes[Expr]
  decorators:
    type: ASTNodes[Expr]
  visibility:
    type: VisibilityKind
  is_abstract:
    type: bool
  metaclass:
    type: Optional[Expr]
  attributes:
    type: ASTNodes[VariableDeclaration]
  methods:
    type: ASTNodes[FunctionDef]

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

ClassDefStmt(ClassDeclStmt)

title: AST class for class definition, including attributes and methods.
attributes:
  name:
    type: str
  bases:
    type: ASTNodes[Expr]
  decorators:
    type: ASTNodes[Expr]
  visibility:
    type: VisibilityKind
  is_abstract:
    type: bool
  metaclass:
    type: Optional[Expr]
  attributes:
    type: ASTNodes[VariableDeclaration]
  methods:
    type: ASTNodes[FunctionDef]
  kind:
    type: ASTKind
  body:
    type: Block

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

EnumDeclStmt(StatementType)

title: AST class for enum declaration.
attributes:
  kind:
    type: ASTKind
  name:
    type: str
  attributes:
    type: ASTNodes[VariableDeclaration]
  visibility:
    type: VisibilityKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

StructDeclStmt(StatementType)

title: AST class for struct declaration.
attributes:
  kind:
    type: ASTKind
  name:
    type: str
  attributes:
    type: ASTNodes[VariableDeclaration]
  visibility:
    type: VisibilityKind
  decorators:
    type: ASTNodes[Expr]
  methods:
    type: ASTNodes[FunctionDef]

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

StructDefStmt(StructDeclStmt)

title: 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

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct