Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

15.2 Mod SDK

compiler-sdk package, Beskid.Syntax mirror, Collector contract hierarchy, query pipeline.

Mod SDK

The compiler-sdk package is the Beskid-side API for mods—contracts and Beskid.Syntax operations, not string templates.

Full normative article: Compiler Mod SDK.

ContractRole
CollectorDeclarative target collection and scope narrowing
GeneratorTyped AST contributions (incremental by default)
AnalyzerDiagnostics + rewrite fixes on merged program
Rewriter<TSource, TTarget>Result<TTarget, FixError> Rewrite(...)
AttributeGeneratorExported attributes (e.g. serialization mods)
  • Node is a contract; traversal uses NodeRef { syntaxGenerationId, nodeId }
  • Beskid.Compiler.Query + fluent DSL (Select, WhereKind, Replace, …)
  • No source text emission—hosts merge typed trees, then re-parse under bounds

Generated mirrors come from beskid_ast_reflect_gen—Rust AST is canonical; SDK sources are not hand-duplicated parallel syntax.

Implementation specs under Compiler mods:

Generator, Analyzer, Rewriter