astx.packages

astx.packages

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

title: Define ASTx for more broader scope.

Classes

Target(Expr)

title: Define the Architecture target for the program.
attributes:
  datalayout:
    type: str
  triple:
    type: str

Methods

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

Module(Block)

title: AST main expression class.
attributes:
  kind:
    type: ASTKind
  name:
    type: str

Methods

block(self) -> list[AST]
title: Define an alias for self.nodes.
returns:
  type: list[AST]
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

Package(ASTNodes)

title: AST class for Package.
attributes:
  name:
    type: str
  modules:
    type: list[Module]
  packages:
    type: list[Package]

Methods

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

Program(Package)

title: AST class for Program.
attributes:
  name:
    type: str
  modules:
    type: list[Module]
  packages:
    type: list[Package]
  target:
    type: Target

AliasExpr(Expr)

title: Represents an alias in an import statement.
attributes:
  kind:
    type: ASTKind
  name:
    type: str
  asname:
    type: str

Methods

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

ImportStmt(StatementType)

title: Represents an import statement.
attributes:
  kind:
    type: ASTKind
  names:
    type: list[AliasExpr]

Methods

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

ImportFromStmt(StatementType)

title: Represents an import-from statement.
attributes:
  kind:
    type: ASTKind
  module:
    type: Optional[str]
  names:
    type: list[AliasExpr]
  level:
    type: int

Methods

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

ImportExpr(Expr)

title: Represents an import operation as an expression.
attributes:
  kind:
    type: ASTKind
  names:
    type: list[AliasExpr]

Methods

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

ImportFromExpr(Expr)

title: Represents a 'from ... import ...' operation as an expression.
attributes:
  kind:
    type: ASTKind
  module:
    type: str
  names:
    type: list[AliasExpr]
  level:
    type: int

Methods

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