irx.analysis.factories
irx.analysis.factories
Source: packages/irx/src/irx/analysis/factories.py
title: Semantic entity factories.
summary: >-
Build semantic sidecar entities and visible binding wrappers in one place so
analyzer visitors can focus on traversal and rule orchestration.Classes
SemanticEntityFactory
title: Central semantic entity construction.
summary: >-
Create semantic symbols, functions, structs, modules, and visible
bindings with consistent ids and qualified names.
attributes:
context:
type: SemanticContextMethods
make_variable_symbol(self, module_key: ModuleKey, name: str, type_: astx.DataType, *, is_mutable: bool, declaration: astx.AST | None, kind: str='variable') -> SemanticSymbol
title: Create a variable-like semantic symbol.
parameters:
module_key:
type: ModuleKey
name:
type: str
type_:
type: astx.DataType
is_mutable:
type: bool
declaration:
type: astx.AST | None
kind:
type: str
returns:
type: SemanticSymbolmake_parameter_symbol(self, module_key: ModuleKey, argument: astx.Argument) -> SemanticSymbol
title: Create one function-parameter semantic symbol.
parameters:
module_key:
type: ModuleKey
argument:
type: astx.Argument
returns:
type: SemanticSymbolmake_parameter_spec(self, argument: astx.Argument) -> ParameterSpec
title: Create one canonical semantic parameter specification.
parameters:
argument:
type: astx.Argument
returns:
type: ParameterSpecmake_function_signature(self, prototype: astx.FunctionPrototype, *, calling_convention: CallingConvention, is_variadic: bool, is_extern: bool, symbol_name: str, required_runtime_features: tuple[str, ...]=(), ffi: FFICallableInfo | None=None) -> FunctionSignature
title: Create one canonical semantic function signature.
parameters:
prototype:
type: astx.FunctionPrototype
calling_convention:
type: CallingConvention
is_variadic:
type: bool
is_extern:
type: bool
symbol_name:
type: str
required_runtime_features:
type: tuple[str, Ellipsis]
ffi:
type: FFICallableInfo | None
returns:
type: FunctionSignaturemake_function(self, module_key: ModuleKey, prototype: astx.FunctionPrototype, *, signature: FunctionSignature, definition: astx.FunctionDef | None=None, args: tuple[SemanticSymbol, ...] | None=None) -> SemanticFunction
title: Create one semantic function entity.
parameters:
module_key:
type: ModuleKey
prototype:
type: astx.FunctionPrototype
signature:
type: FunctionSignature
definition:
type: astx.FunctionDef | None
args:
type: tuple[SemanticSymbol, Ellipsis] | None
returns:
type: SemanticFunctionmake_callable_resolution(self, function: SemanticFunction) -> CallableResolution
title: Create one resolved callable wrapper.
parameters:
function:
type: SemanticFunction
returns:
type: CallableResolutionmake_struct(self, module_key: ModuleKey, node: astx.StructDefStmt) -> SemanticStruct
title: Create one semantic struct entity.
parameters:
module_key:
type: ModuleKey
node:
type: astx.StructDefStmt
returns:
type: SemanticStructmake_class(self, module_key: ModuleKey, node: astx.ClassDefStmt) -> SemanticClass
title: Create one semantic class entity.
parameters:
module_key:
type: ModuleKey
node:
type: astx.ClassDefStmt
returns:
type: SemanticClassmake_class_member(self, class_: SemanticClass, *, name: str, kind: ClassMemberKind, declaration: astx.AST, visibility: astx.VisibilityKind, is_static: bool, is_constant: bool, is_mutable: bool, is_abstract: bool=False, type_: astx.DataType | None=None, signature: FunctionSignature | None=None, signature_key: str | None=None, overrides: str | None=None, dispatch_slot: int | None=None, lowered_function: SemanticFunction | None=None) -> SemanticClassMember
title: Create one semantic class-member record.
parameters:
class_:
type: SemanticClass
name:
type: str
kind:
type: ClassMemberKind
declaration:
type: astx.AST
visibility:
type: astx.VisibilityKind
is_static:
type: bool
is_constant:
type: bool
is_mutable:
type: bool
is_abstract:
type: bool
type_:
type: astx.DataType | None
signature:
type: FunctionSignature | None
signature_key:
type: str | None
overrides:
type: str | None
dispatch_slot:
type: int | None
lowered_function:
type: SemanticFunction | None
returns:
type: SemanticClassMembermake_module(self, module_key: ModuleKey, *, display_name: str | None=None) -> SemanticModule
title: Create one semantic module entity.
parameters:
module_key:
type: ModuleKey
display_name:
type: str | None
returns:
type: SemanticModulemake_function_binding(self, function: SemanticFunction) -> SemanticBinding
title: Create a visible binding for a function.
parameters:
function:
type: SemanticFunction
returns:
type: SemanticBindingmake_struct_binding(self, struct: SemanticStruct) -> SemanticBinding
title: Create a visible binding for a struct.
parameters:
struct:
type: SemanticStruct
returns:
type: SemanticBindingmake_class_binding(self, class_: SemanticClass) -> SemanticBinding
title: Create a visible binding for a class.
parameters:
class_:
type: SemanticClass
returns:
type: SemanticBindingmake_module_binding(self, module: SemanticModule) -> SemanticBinding
title: Create a visible binding for a module.
parameters:
module:
type: SemanticModule
returns:
type: SemanticBindingmake_import_binding(self, *, local_name: str, requested_name: str, source_module_key: ModuleKey, binding: SemanticBinding) -> ResolvedImportBinding
title: Create one resolved import binding record.
parameters:
local_name:
type: str
requested_name:
type: str
source_module_key:
type: ModuleKey
binding:
type: SemanticBinding
returns:
type: ResolvedImportBinding