Arena Terms Parser
Parser for arena-backed, Prolog-like terms.
This crate provides a lexer, parser, and operator handling for Prolog-style
terms. It depends on the arena_terms
crate to store terms efficiently in an arena and is built on top of the
parlex runtime library.
Features
-
Lexer Tokenizes atoms, variables, numbers, strings, dates, and symbols.
-
Parser An SLR(1) parser (generated by
parlex-gen) that producesarena_terms::Termvalues. -
Operators Dynamically handles operator fixity, associativity, and precedence rules.
-
Arena-backed Terms are stored compactly in arenas for efficient allocation and traversal.
Installation
Add this crate to your Cargo.toml:
[]
= "0.1"
Also add:
[]
= "0.1"
= "0.1"
Usage
Parsing a string into arena terms:
use parse_term;
use Arena;
CLI
Build the binary with:
Then run:
Documentation
For detailed API documentation, visit docs.rs/parlex.
License
Copyright (c) 2005–2025 IKH Software, Inc.
Released under the terms of the GNU Lesser General Public License, version 3.0 or (at your option) any later version (LGPL-3.0-or-later).
See Also
- parlex - Parlex core runtime library
- parlex-gen - Lexer and parser generation tools (
alexandaslr) - arena-terms - Arena-backed Prolog-like terms