varpulis_core/lib.rs
1#![warn(clippy::unwrap_used)]
2//! # Varpulis Core
3//!
4//! Foundational types and AST definitions for the VPL language.
5//!
6//! This crate provides the core data structures used throughout the Varpulis
7//! streaming analytics engine, including:
8//!
9//! - **AST (Abstract Syntax Tree)**: Complete representation of VPL programs
10//! - **Type System**: Type definitions for the language
11//! - **Values**: Runtime value representation
12//! - **Source Spans**: Location tracking for error reporting
13//!
14//! ## Features
15//!
16//! - Zero-copy parsing support via spans
17//! - Serialization support via `serde`
18//! - Comprehensive AST for all VPL constructs
19//!
20//! ## Modules
21//!
22//! - [`ast`]: Program structure, statements, expressions, and SASE patterns
23//! - [`types`]: Type system definitions (`Int`, `Float`, `String`, etc.)
24//! - [`value`]: Runtime values with type coercion and operations
25//! - [`span`]: Source location tracking for diagnostics
26//!
27//! ## Quick Start
28//!
29//! ```rust,ignore
30//! use varpulis_core::{Program, Stmt, Value};
31//!
32//! // Values are the runtime representation
33//! let int_val = Value::Int(42);
34//! let float_val = Value::Float(3.14);
35//! let str_val = Value::Str("hello".into());
36//!
37//! // Check value types
38//! assert!(int_val.is_int());
39//! assert!(float_val.is_float());
40//! ```
41//!
42//! ## AST Structure
43//!
44//! A VPL program consists of statements:
45//!
46//! - `StreamDecl`: Stream definitions with operations
47//! - `EventDecl`: Event type definitions
48//! - `PatternDecl`: SASE+ pattern definitions
49//! - `FnDecl`: User-defined functions
50//! - `Config`: Configuration blocks
51//!
52//! ## See Also
53//!
54//! - [`varpulis_parser`](../varpulis_parser): Parsing VPL source code
55//! - [`varpulis_runtime`](../varpulis_runtime): Executing VPL programs
56
57pub mod ast;
58pub mod event;
59pub mod pagination;
60pub mod plan;
61pub mod security;
62pub mod span;
63pub mod types;
64pub mod validate;
65pub mod value;
66
67pub use ast::*;
68pub use event::{Event, FieldKey, SharedEvent};
69pub use span::Span;
70pub use types::*;
71pub use value::Value;