astx.flows
astx.flows
Source: packages/astx/src/astx/flows.py
title: Module for controle flow AST.Classes
IfStmt(StatementType)
title: AST class for `if` statement.
attributes:
loc:
type: SourceLocation
kind:
type: ASTKind
condition:
type: Expr
then:
type: Block
else_:
type: Optional[Block]Methods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructIfExpr(Expr)
title: AST class for `if` expression.
attributes:
loc:
type: SourceLocation
kind:
type: ASTKind
condition:
type: Expr
then:
type: Block
else_:
type: Optional[Block]Methods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructForRangeLoopStmt(StatementType)
title: AST class for `For` Range Statement.
attributes:
kind:
type: ASTKind
variable:
type: InlineVariableDeclaration
start:
type: Expr
end:
type: Expr
step:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructForRangeLoopExpr(Expr)
title: AST class for `For` Range Expression.
attributes:
kind:
type: ASTKind
variable:
type: InlineVariableDeclaration
start:
type: Expr
end:
type: Expr
step:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructForCountLoopStmt(StatementType)
title: AST class for a simple Count-Controlled `For` Loop statement.
summary: |-
This is a very basic `for` loop, used by languages like C or C++.
attributes:
kind:
type: ASTKind
initializer:
type: InlineVariableDeclaration
condition:
type: Expr
update:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructForCountLoopExpr(Expr)
title: AST class for a simple Count-Controlled `For` Loop expression.
summary: |-
This is a very basic `for` loop, used by languages like C or C++.
attributes:
kind:
type: ASTKind
initializer:
type: InlineVariableDeclaration
condition:
type: Expr
update:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructAsyncForRangeLoopStmt(StatementType)
title: AST class for asynchronous `For` Range Statement.
attributes:
kind:
type: ASTKind
variable:
type: InlineVariableDeclaration
start:
type: Optional[Expr]
end:
type: Expr
step:
type: Optional[Expr]
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructAsyncForRangeLoopExpr(Expr)
title: AST class for asynchronous `For` Range Expression.
attributes:
kind:
type: ASTKind
variable:
type: InlineVariableDeclaration
start:
type: Optional[Expr]
end:
type: Expr
step:
type: Optional[Expr]
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructBreakStmt(StatementType)
title: AST class for break statement.
attributes:
kind:
type: ASTKindMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructContinueStmt(StatementType)
title: AST class for continue statement.
attributes:
kind:
type: ASTKindMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructWhileStmt(StatementType)
title: AST class for `while` statement.
attributes:
kind:
type: ASTKind
condition:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructWhileExpr(Expr)
title: AST class for `while` expression.
attributes:
kind:
type: ASTKind
condition:
type: Expr
body:
type: BlockMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructCaseStmt(StatementType)
title: AST class for a case in a Switch statement.
attributes:
kind:
type: ASTKind
condition:
type: Optional[Expr]
body:
type: Block
default:
type: boolMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructSwitchStmt(StatementType)
title: AST class for Switch statements based on Rust's match syntax.
attributes:
kind:
type: ASTKind
value:
type: Expr
cases:
type: ASTNodes[CaseStmt]Methods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructGotoStmt(StatementType)
title: AST class for function `Goto` statement.
attributes:
kind:
type: ASTKind
label:
type: IdentifierMethods
get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: ReprStructDoWhileStmt(WhileStmt)
title: AST class for `do-while` statement.
attributes:
condition:
type: Expr
body:
type: Block
kind:
type: ASTKindDoWhileExpr(WhileExpr)
title: AST class for `do-while` expression.
attributes:
condition:
type: Expr
body:
type: Block
kind:
type: ASTKind