Skip to main content

bock_codegen/
lib.rs

1//! Bock codegen — target-specific code generation from typed Bock AIR.
2//!
3//! This crate provides the target profile system and code generator framework.
4//! Each supported transpilation target (JS, TS, Python, Rust, Go) is described
5//! by a [`TargetProfile`] with a capability matrix, and target-specific code
6//! generators implement the [`CodeGenerator`] trait.
7
8pub mod ai_synthesis;
9pub mod error;
10pub mod gaps;
11pub mod generator;
12pub mod go;
13pub mod js;
14pub mod profile;
15pub mod py;
16pub mod rs;
17pub mod ts;
18
19// Re-export primary public API at crate root.
20pub use ai_synthesis::{
21    cache_at, needs_ai_synthesis, synthesize_and_flush, verify_generated, AiSynthesisDriver,
22    SynthesisConfig, SynthesisOutcome, SynthesisStats,
23};
24pub use bock_ai::{Rule, RuleCache};
25pub use error::CodegenError;
26pub use gaps::{detect_gaps, CapabilityGap};
27pub use generator::{
28    CodeGenerator, GeneratedCode, OutputFile, SourceInfo, SourceMap, SourceMapEntry, SourceMapping,
29};
30pub use go::GoGenerator;
31pub use js::JsGenerator;
32pub use profile::{
33    classify_node, AsyncModel, ErrorHandling, GenericsModel, IndentStyle, MemoryModel,
34    NamingConvention, NodeKindHint, Support, TargetCapabilities, TargetConventions, TargetProfile,
35};
36pub use py::PyGenerator;
37pub use rs::RsGenerator;
38pub use ts::TsGenerator;