arena_terms_parser/lib.rs
1//! # Arena Terms Parser
2//!
3//! Parser for arena-backed Prolog-like terms.
4//!
5//! This crate provides a parser for reading and interpreting Prolog-style terms
6//! into the compact, bump-allocated arena representation provided by the
7//! [`arena_terms`] crate. It is built on top of the [`parlex`] core library and uses
8//! lexer and parser code generated by the [`parlex-gen`] tools **Alex** (lexer)
9//! and **ASLR** (parser).
10//!
11//! # Overview
12//! The parser is designed for performance and memory efficiency, making it
13//! suitable for large-scale term manipulation, logic engines, and symbolic
14//! computation. It supports the full range of Prolog term constructs, including
15//! atoms, numbers, lists, and compound structures, while maintaining tight
16//! control over allocation through arena-based storage.
17//!
18//! # Modules
19//! - [`lexer`]: Performs tokenization and value extraction (atoms, numbers, dates, etc.).
20//! - [`oper`]: Defines operator fixity, precedence, and associativity rules.
21//! - [`parser`]: Implements an SLR parser that constructs `arena_terms::Term` values.
22//!
23//! # Dependencies
24//! - [`arena_terms`]: Provides the arena-backed term data structures.
25//! - [`parlex`]: Core support library for lexing and parsing.
26//! - [`parlex-gen`]: Code generation utilities for **Alex** and **ASLR**.
27//!
28//! ## License
29//!
30//! Copyright (c) 2005–2025 IKH Software, Inc.
31//!
32//! Released under the terms of the GNU Lesser General Public License, version 3.0 or
33//! (at your option) any later version (LGPL-3.0-or-later).
34//!
35//! ## See Also
36//!
37//! - [arena-terms](https://crates.io/crates/arena-terms) — arena backed terms library
38//! - [parlex](https://crates.io/crates/parlex) — lexer and parser generators core support library
39//! - [parlex-gen](https://crates.io/crates/parlex-gen) — lexer and parser generators ALEX and ASLR
40
41mod lexer;
42mod parser;
43mod token;
44
45pub use lexer::{TermLexer, TermLexerDriver};
46pub use parser::parser_data::TokenID;
47pub use parser::{TermParser, TermParserDriver, TermTokenParser, define_opers};
48pub use token::{TermToken, Value};