#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

#737 in Programming languages

32 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

~5–13MB
~157K SLoC