#parser-tools #compiler #parser

no-std peggen-core

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

3 releases

new 0.2.2 Aug 31, 2024
0.2.1 Aug 21, 2024
0.2.0 Aug 16, 2024

#921 in Programming languages

Download history 153/week @ 2024-08-12 167/week @ 2024-08-19 188/week @ 2024-08-26

508 downloads per month
Used in 2 crates

MIT/Apache

13KB
299 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–13MB
~132K SLoC