Documentation
arx.parser
arx.parser
Source: packages/arx/src/arx/parser/__init__.py
title: parser module gather all functions and classes for parsing.
Classes
Parser(ExceptionParserMixin, ImportParserMixin, DeclarationParserMixin, ExpressionParserMixin, ControlFlowParserMixin, TypeParserMixin, ParserCore)
title: Parser class.
attributes:
bin_op_precedence:
type: dict[str, int]
indent_level:
type: int
known_class_names:
type: set[str]
imported_type_names:
type: set[str]
namespace_roots:
type: set[str]
builtin_type_bindings:
type: dict[str, astx.DataType]
tensor_scopes:
type: list[dict[str, TensorBinding | None]]
return_type_scopes:
type: list[astx.DataType]
template_type_scopes:
type: list[dict[str, astx.DataType]]
type_aliases:
type: dict[str, astx.DataType]
value_scopes:
type: list[set[str]]
tokens:
type: TokenList
Methods
parse(self, tokens: TokenList, module_name: str='main', *, builtin_types: dict[str, astx.DataType] | None=None) -> astx.Module
title: Parse tokens and attach the active token location to failures.
parameters:
tokens:
type: TokenList
module_name:
type: str
builtin_types:
type: dict[str, astx.DataType] | None
returns:
type: astx.Module