Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

14.3 Semantic pipeline

Analysis rules, typing, mod analyze/rewrite, and the diagnostic registry.

Semantic pipeline

Parsing proves you speak Beskid syntax. Semantic analysis proves you meant something allowed.

Hub: Rules pipeline contract.

  • Staged rules in beskid_analysis::analysis::rules::staged
  • Diagnostic codes in Diagnostic code registry
  • Language-meta bands (e.g. E16xx contracts) referenced, not duplicated

After optional generate/merge/reparse, mods run analyze and rewrite on the merged program:

flowchart LR
  parse[Parsed AST]
  gen[mod.generate + merge]
  sem[Semantic rules]
  rewrite[mod.rewrite fixes]
  lower[codegen.lower]
  parse --> gen --> sem --> rewrite --> lower

Runs analysis without requiring a successful JIT—your CI friend for “no, you cannot call that.”

Book reference: Semantic analysis, Semantic rules.

Codegen and IR