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.Block
parse_if_stmt(self) -> astx.IfStmt
title: Parse the `if` expression.
returns:
  type: astx.IfStmt
parse_while_stmt(self) -> astx.WhileStmt
title: Parse the `while` expression.
returns:
  type: astx.WhileStmt
parse_for_stmt(self) -> astx.AST
title: Parse for-loop expressions.
returns:
  type: astx.AST
parse_for_count_stmt(self, for_loc: SourceLocation) -> astx.ForCountLoopStmt
title: Parse count-style for loop.
parameters:
  for_loc:
    type: SourceLocation
returns:
  type: astx.ForCountLoopStmt
parse_inline_var_declaration(self) -> astx.InlineVariableDeclaration
title: Parse inline variable declaration used by count-style for loops.
returns:
  type: astx.InlineVariableDeclaration
parse_var_expr(self) -> astx.VariableDeclaration
title: Parse typed variable declarations.
returns:
  type: astx.VariableDeclaration
parse_assert_stmt(self) -> astx.AssertStmt
title: Parse one fatal assertion statement.
returns:
  type: astx.AssertStmt
parse_return_function(self) -> astx.FunctionReturn
title: Parse the return expression.
returns:
  type: astx.FunctionReturn