hamelin_translation 0.4.3

Lowering and IR for Hamelin query language
Documentation
//! Hamelin Translation Crate
//!
//! This crate provides lowering from Hamelin's type-checked AST to a lowered
//! intermediate representation (IR) suitable for backend translation.
//!
//! The IR enforces constraints that make backend translation simpler:
//! - No assignment to compound identifiers (all assignments use `SimpleIdentifier`)
//! - No `Range` type or range operators
//! - No high-level commands that can be expressed in terms of simpler ones
//!
//! # Usage
//!
//! Simple case with defaults:
//! ```
//! use std::sync::Arc;
//! use hamelin_lib::tree::ast::{IntoTyped, TypeCheckExecutor};
//! use hamelin_lib::tree::builder::{pipeline, select_command};
//! use hamelin_translation::lower;
//!
//! let typed = pipeline()
//!     .command(select_command().named_field("x", 1).build())
//!     .build()
//!     .typed_with()
//!     .typed();
//!
//! // lower(typed) would convert to IR
//! ```
//!
//! With custom options:
//! ```
//! use std::sync::Arc;
//! use hamelin_lib::func::registry::FunctionRegistry;
//! use hamelin_translation::lower_with;
//!
//! let options = lower_with()
//!     .with_registry(Arc::new(FunctionRegistry::default()))
//!     .with_timestamp_field("ts");
//!
//! // options.lower(typed_statement) would convert to IR
//! ```

mod ir;
mod lower;
mod normalize;
pub mod window_frame;

// Re-export IR types
pub use ir::{
    IRAggCommand, IRAssignment, IRCommand, IRCommandKind, IRExplodeCommand, IRExpression,
    IRFromCommand, IRInput, IRJoinCommand, IRLimitCommand, IRPipeline, IRSelectCommand,
    IRSideEffect, IRSortCommand, IRSortExpression, IRStatement, IRWhereCommand, IRWindowCommand,
    IRWithClause, JoinType,
};

// Re-export window frame types
pub use window_frame::{RangeBound, RowBound, WindowFrame};

// Re-export lowering entry points
pub use lower::{lower, lower_with, LoweringOptions};