Module analyze

Module analyze 

Source
Expand description

Semantic analysis passes.

Provides analysis passes that transform parsed AST into analyzed form:

  • Name resolution (symbol_table)
  • Dependency analysis and recursion detection (dependencies)
  • Type inference (type_check)
  • Grammar linking (link)
  • Semantic validation (validation)

Modules§

dependencies
Dependency analysis for definitions.
link
Link pass: resolve node types and fields against tree-sitter grammar.
refs
Utilities for working with definition references in expressions.
symbol_table
Symbol table: name resolution and reference checking.
type_check
Unified type checking pass.
validation
Semantic validation passes.
visitor
AST Visitor pattern.

Structs§

DependencyAnalysis
Result of dependency analysis.
LinkOutput
Output from the link phase for binary emission.
SymbolTable
Registry of named definitions in a query.
TypeContext
Central registry for types, symbols, and expression metadata.

Constants§

UNNAMED_DEF
Sentinel name for unnamed definitions (bare expressions at root level). Code generators can emit whatever name they want for this.

Traits§

Visitor

Functions§

infer_types
Run type inference on all definitions.
primary_def_name
Get the primary definition name (first non-underscore, or underscore if none).
validate_alt_kinds
validate_anchors
validate_empty_constructs
validate_predicates
validate_recursion
Validate recursion using the pre-computed dependency analysis.
walk_expr