Crate arena_terms_parser

Crate arena_terms_parser 

Source
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 constructs arena_terms::Term values.

§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§

TermLexer
The lexer for Prolog-like terms.
TermLexerDriver
Stateful driver that handles rule matches from the generated DFA.
TermParser
Prolog-like term parser with operator precedence and associativity handling.
TermParserDriver
A driver that defines semantic actions for the term parser.
TermToken
A token produced by the [TermLexer] for Prolog-like term parsing.
TermTokenParser
Prolog-like term parser with operator precedence and associativity handling.

Enums§

TokenID
Value
Represents a generic value emitted by the lexer.

Functions§

define_opers
Defines or extends operator definitions directly from a Prolog-like op/6 term list read from an input source.