#parser-tools #compiler #parser

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

#743 in Programming languages

Download history 9/week @ 2024-10-04 14/week @ 2024-10-11 12/week @ 2024-10-18 4/week @ 2024-10-25 4/week @ 2024-11-01 1/week @ 2024-11-08 2/week @ 2024-11-15 1/week @ 2024-11-22 24/week @ 2024-12-06 4/week @ 2024-12-13

299 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

~3–11MB
~122K SLoC