arx.parser.control_flow
arx.parser.control_flow
Source: packages/arx/src/arx/parser/control_flow.py
title: Control-flow parser mixin.
summary: >-
Parse blocks, statements, and control-flow constructs that operate on parsed
expressions.Classes
ControlFlowParserMixin(ParserMixinBase)
title: Control-flow parser mixin.Methods
parse_block(self, allow_docstring: bool=False, declared_names: tuple[str, ...]=(), declared_lists: tuple[str, ...]=(), declared_tensors: dict[str, TensorBinding | None] | None=None, declared_dataframes: dict[str, DataFrameBinding | None] | None=None) -> astx.Block
title: Parse a block of nodes.
parameters:
allow_docstring:
type: bool
declared_names:
type: tuple[str, Ellipsis]
declared_lists:
type: tuple[str, Ellipsis]
declared_tensors:
type: dict[str, TensorBinding | None] | None
declared_dataframes:
type: dict[str, DataFrameBinding | None] | None
returns:
type: astx.Blockparse_if_stmt(self) -> astx.IfStmt
title: Parse the `if` expression.
returns:
type: astx.IfStmtparse_while_stmt(self) -> astx.WhileStmt
title: Parse the `while` expression.
returns:
type: astx.WhileStmtparse_for_stmt(self) -> astx.AST
title: Parse for-loop expressions.
returns:
type: astx.ASTparse_for_count_stmt(self, for_loc: SourceLocation) -> astx.ForCountLoopStmt
title: Parse count-style for loop.
parameters:
for_loc:
type: SourceLocation
returns:
type: astx.ForCountLoopStmtparse_inline_var_declaration(self) -> astx.InlineVariableDeclaration
title: Parse inline variable declaration used by count-style for loops.
returns:
type: astx.InlineVariableDeclarationparse_var_expr(self) -> astx.VariableDeclaration
title: Parse typed variable declarations.
returns:
type: astx.VariableDeclarationparse_assert_stmt(self) -> astx.AssertStmt
title: Parse one fatal assertion statement.
returns:
type: astx.AssertStmtparse_return_function(self) -> astx.FunctionReturn
title: Parse the return expression.
returns:
type: astx.FunctionReturn