arx.parser.declarations
arx.parser.declarations
Source: packages/arx/src/arx/parser/declarations.py
title: Declaration parser mixin.
summary: >-
Parse functions, classes, templates, modifiers, and related declaration
constructs.Classes
DeclarationParserMixin(ParserMixinBase)
title: Declaration parser mixin.Methods
parse_function(self, template_params: tuple[astx.TemplateParam, ...]=()) -> astx.FunctionDef
title: Parse the function definition expression.
parameters:
template_params:
type: tuple[astx.TemplateParam, Ellipsis]
returns:
type: astx.FunctionDefparse_extern(self) -> astx.FunctionPrototype
title: Parse the extern expression.
returns:
type: astx.FunctionPrototypeparse_class_decl(self, annotations: ParsedAnnotation | None=None) -> astx.ClassDefStmt
title: Parse one class declaration.
parameters:
annotations:
type: ParsedAnnotation | None
returns:
type: astx.ClassDefStmtparse_class_body(self) -> tuple[list[astx.VariableDeclaration], list[astx.FunctionDef]]
title: Parse a class body.
returns:
type: tuple[list[astx.VariableDeclaration], list[astx.FunctionDef]]parse_field_decl(self, modifiers: ParsedAnnotation | None=None) -> astx.VariableDeclaration
title: Parse one class field declaration.
parameters:
modifiers:
type: ParsedAnnotation | None
returns:
type: astx.VariableDeclarationparse_method_decl(self, modifiers: ParsedAnnotation | None=None, template_params: tuple[astx.TemplateParam, ...]=()) -> astx.FunctionDef
title: Parse one class method declaration.
parameters:
modifiers:
type: ParsedAnnotation | None
template_params:
type: tuple[astx.TemplateParam, Ellipsis]
returns:
type: astx.FunctionDefparse_method_signature(self, *, allow_receiver: bool) -> tuple[astx.FunctionPrototype, str | None]
title: Parse one class method signature.
parameters:
allow_receiver:
type: bool
returns:
type: tuple[astx.FunctionPrototype, str | None]parse_declaration_prefixes(self, *, body_indent: int | None=None) -> ParsedDeclarationPrefixes
title: Parse declaration prefixes that precede one declaration.
parameters:
body_indent:
type: int | None
returns:
type: ParsedDeclarationPrefixesparse_declaration_prefix(self) -> ParsedDeclarationPrefixes
title: Parse one declaration prefix.
returns:
type: ParsedDeclarationPrefixesparse_template_param_block(self) -> tuple[astx.TemplateParam, ...]
title: Parse one template-parameter block.
returns:
type: tuple[astx.TemplateParam, Ellipsis]parse_template_argument_list(self) -> tuple[astx.DataType, ...]
title: Parse one explicit template-argument list.
returns:
type: tuple[astx.DataType, Ellipsis]parse_modifier_list(self) -> ParsedAnnotation
title: Parse one annotation-line modifier list.
returns:
type: ParsedAnnotationparse_prototype(self, expect_colon: bool) -> astx.FunctionPrototype
title: Parse function/extern prototypes.
parameters:
expect_colon:
type: bool
returns:
type: astx.FunctionPrototype