Crates.io | lalry |
lib.rs | lalry |
version | 0.1.0 |
source | src |
created_at | 2024-06-08 14:32:42.412909 |
updated_at | 2024-06-08 14:32:42.412909 |
description | a library for creating LALR(1) parsers from context-free grammars |
homepage | |
repository | https://github.com/jsinger67/lalry |
max_upload_size | |
id | 1265778 |
size | 68,330 |
lalry
- a library for creating LALR(1) parsers from context-free grammarsThis is a fork of the great lalr crate, a library for creating LALR(1) parsers from context-free grammars.
lalr
To make the generation of parse tables more flexible lalry
adds a way to control this process.
The trait Config
is used for this and a custom implementation can be provided to deviate from the
default.
To keep the default behavior as in previous versions the user can use the DefaultConfig
structure
that provides the implementation of the standard behavior.
lalry
lalry
, although not the main goal, is functionally fully compatible with it's ancestor lalr
.
It can be used as drop-in replacement with only minor adaptions.
All you need to do is to create a DefaultConfig
and hand it over to the call to lalr1
:
let config = DefaultConfig::new();
let parse_table = grammar.lalr1(&config).unwrap();
By using a default configuration you get the exact same functionality as if you had called
let parse_table = grammar.lalr1(|_, _| true, |_, _| 0).unwrap();
with lalr
style API.