no-std peggen-core

Generate recursive-descent & precedence climbing parsers. (traits)

4 releases

0.2.6 Sep 22, 2024
0.2.2 Aug 31, 2024
0.2.1 Aug 21, 2024
0.2.0 Aug 16, 2024
Download history 153/week @ 2024-08-12 167/week @ 2024-08-19 188/week @ 2024-08-26 13/week @ 2024-09-02 101/week @ 2024-09-16 77/week @ 2024-09-23 16/week @ 2024-09-30 8/week @ 2024-10-07

202 downloads per month
Used in 2 crates

MIT/Apache

15KB
354 lines

peggen-core

Two-phase Parsing w/o Memorization

In most PEG-based approaches, the target type is constructed during parsing. However, some of them might be discarded in the near future, causing unwanted allocation/deallocation. In this crate, we seperate parsing and type construction into two phases. In the first phase, syntax items are represented as tags, which are storage-agnostic. Then, an analysis pass run over the tags and generate a final result.

Dependencies

~4–12MB
~133K SLoC