Skip to main content

bock_air/
lib.rs

1//! Bock AIR — Bock Intermediate Representation node definitions.
2//!
3//! All four AIR layers (S-AIR, T-AIR, C-AIR, TR-AIR) share the same
4//! [`AIRNode`] / [`NodeKind`] types. Later compiler passes progressively fill
5//! in the optional layer slots (`type_info`, `ownership`, `context`, `target`).
6//!
7//! # Module layout
8//! - [`node`] — [`AIRNode`], [`NodeKind`], [`NodeIdGen`], auxiliary types.
9//! - [`stubs`] — placeholder types for each layer slot.
10//! - [`visitor`] — [`Visitor`] trait and `walk_*` helpers for tree traversal.
11
12pub mod compose_context;
13pub mod context;
14pub mod lower;
15pub mod node;
16pub mod prelude_vocab;
17pub mod registry;
18pub mod resolve;
19pub mod scope;
20pub mod stubs;
21pub mod validate_context;
22pub mod verify_capabilities;
23pub mod visitor;
24
25// Re-export the most-used types at the crate root.
26pub use compose_context::compose_context;
27pub use context::interpret_context;
28pub use lower::lower_module;
29pub use node::{
30    AIRNode, AirArg, AirHandlerPair, AirInterpolationPart, AirMapEntry, AirRecordField,
31    AirRecordPatternField, EnumVariantPayload, NodeId, NodeIdGen, NodeKind, ResultVariant,
32};
33pub use registry::{
34    EnumVariantExport, ExportDetail, ExportKind, ExportedSymbol, ModuleExports, ModuleId,
35    ModuleRegistry, RegistryError,
36};
37pub use resolve::{
38    resolve_names, resolve_names_with_registry, Binding, NameKind, ResolvedName, Scope, SymbolTable,
39};
40pub use scope::{
41    build_scope_tree, Binding as ScopeBinding, Scope as ScopeNode, ScopeId, ScopeTree,
42};
43pub use stubs::{
44    security_level_rank, BehavioralModifier, ByteSize, Capability, ContextBlock, ContextMarker,
45    Duration, EffectRef, OwnershipInfo, OwnershipState, PerformanceBudget, SecurityInfo, SizeUnit,
46    TargetInfo, TimeUnit, TypeInfo, TypeRef, Value, KNOWN_CAPABILITIES, SECURITY_LEVELS,
47};
48pub use validate_context::{validate_context, StrictnessLevel};
49pub use verify_capabilities::{verify_capabilities, CompletenessReport, VerificationMode};
50pub use visitor::Visitor;