irx.analysis.api
irx.analysis.api
Source: packages/irx/src/irx/analysis/api.py
title: Public semantic-analysis API entry points.
summary: >-
Expose the stable semantic-analysis entry points that hosts and backend
lowering call before code generation begins, while keeping the concrete
analyzer implementation in smaller internal modules.Functions
analyze(node: astx.AST) -> astx.AST
title: Analyze one AST root and attach semantic sidecars.
summary: >-
Run the stable single-root semantic-validation path, attach node.semantic
sidecars to analyzed nodes, and raise SemanticError before lowering when
diagnostics exist.
parameters:
node:
type: astx.AST
returns:
type: astx.ASTanalyze_module(module: astx.Module) -> astx.Module
title: Analyze an AST module.
summary: >-
Convenience wrapper around analyze(...) for module roots with the same
semantic-error boundary and sidecar guarantees.
parameters:
module:
type: astx.Module
returns:
type: astx.Moduleanalyze_modules(root: ParsedModule, resolver: ImportResolver) -> CompilationSession
title: Analyze a reachable graph of host-provided parsed modules.
summary: >-
Run the stable multi-module semantic pipeline: expand the reachable
module graph, predeclare top-level members, resolve top-level imports,
attach semantic sidecars, and raise SemanticError before lowering when
diagnostics exist.
parameters:
root:
type: ParsedModule
resolver:
type: ImportResolver
returns:
type: CompilationSession