Expand description
§Arena Terms Parser
Parser for arena-backed Prolog-like terms.
This crate provides a parser for reading and interpreting Prolog-style terms
into the compact, bump-allocated arena representation provided by the
arena_terms crate. It is built on top of the parlex core library and uses
lexer and parser code generated by the [parlex-gen] tools Alex (lexer)
and ASLR (parser).
§Overview
The parser is designed for performance and memory efficiency, making it suitable for large-scale term manipulation, logic engines, and symbolic computation. It supports the full range of Prolog term constructs, including atoms, numbers, lists, and compound structures, while maintaining tight control over allocation through arena-based storage.
§Modules
- [
lexer]: Performs tokenization and value extraction (atoms, numbers, dates, etc.). - [
oper]: Defines operator fixity, precedence, and associativity rules. - [
parser]: Implements an SLR parser that constructsarena_terms::Termvalues.
§Dependencies
arena_terms: Provides the arena-backed term data structures.parlex: Core support library for lexing and parsing.- [
parlex-gen]: Code generation utilities for Alex and ASLR.
§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
- arena-terms — arena backed terms library
- parlex — lexer and parser generators core support library
- parlex-gen — lexer and parser generators ALEX and ASLR
Structs§
- Term
Lexer - The lexer for Prolog-like terms.
- Term
Lexer Driver - Stateful driver that handles rule matches from the generated DFA.
- Term
Parser - Prolog-like term parser with operator precedence and associativity handling.
- Term
Parser Driver - A driver that defines semantic actions for the term parser.
- Term
Token - A token produced by the [
TermLexer] for Prolog-like term parsing. - Term
Token Parser - Prolog-like term parser with operator precedence and associativity handling.
Enums§
Functions§
- define_
opers - Defines or extends operator definitions directly from a Prolog-like
op/6term list read from an input source.