1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! 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
//! ```
// Re-export IR types
pub use ;
// Re-export window frame types
pub use ;
// Re-export lowering entry points
pub use ;