Crate parlex

Crate parlex 

Source
Expand description

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).

Runtime support library for lexers and parsers generated by parlex-gen.

parlex defines the generic traits and core data structures that generated lexers and parsers use at runtime. You typically depend on this crate alongside the code produced by the alex (lexer) and aslr (parser) generators from parlex-gen. See the crate README for a feature overview, usage, and docs.rs links.

  • Generic traits for lexical analysis and parsing
  • Core data structures used by generated code
  • Foundation for building custom lexers and parsers

For more background and examples, see the parlex README on GitHub and docs.rs.

§Crates.io

Published at crates.io/crates/parlex.

Structs§

LexerCtx
Core lexer execution context.
LexerStats
Statistics collected by the lexer during processing.
ParserCtx
Core parser execution context.
ParserStats
Statistics collected during the parsing process.

Enums§

ParserAction
Parser action used by the parsing automaton.

Traits§

Lexer
Defines the core lexer interface responsible for processing input streams and producing tokens.
LexerData
Defines the data and configuration used by a lexer. Provides access to lexer modes, rules, DFA data, and lookup utilities.
LexerMode
A trait representing a lexer mode used during lexical analysis. Each mode can be converted into an index and defines a total count of modes.
LexerRule
A trait representing a lexer rule used for token matching. Each rule can be converted into an index and defines a total count of rules along with a designated end rule.
Parser
Defines the core parser interface responsible for driving the parsing process.
ParserAmbigID
A trait representing an identifier for an ambiguity in the grammar.
ParserData
Defines the data and configuration used by a parser. Provides access to parser states, productions, ambiguities, and lookup tables.
ParserProdID
A trait representing an identifier for a grammar production rule.
ParserStateID
A trait representing an identifier for a parser state.
ParserTokenID
A trait representing an identifier for a terminal or nonterminal token in the grammar.
Token
A trait representing a token in lexical analysis or parsing.