# kevinmehall/rust-peg

Parsing Expression Grammar (PEG) parser generator for Rust

Repository: https://github.com/kevinmehall/rust-peg
Canonical: https://ross.abutalabs.com/products/rust-peg
Homepage: https://crates.io/crates/peg
Language: Rust
License: MIT
License Family: permissive
Topics: parsing-expression-grammars, peg, rust, grammar, parsing, parser-generator
Last push: 2026-05-04T21:01:19+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 80, release rhythm 50, longevity 100
- inputs: {"age_days": 4763, "days_push": 121, "days_rel": 121, "gap_med": 428, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1606, forks 118 (observed 2026-08-28T04:05:10.413406+00:00)

## What it is
rust-peg is a Parsing Expression Grammar (PEG) parser generator for Rust, provided as a proc macro that builds a recursive descent parser from a grammar definition. It supports parsing &str, &[u8], &[T], and custom input types, with precedence climbing, parameterized rules, and customizable error reporting.

## Use cases
- write a parser for a custom DSL in Rust
- parse structured text like config or data formats
- build an expression parser with operator precedence
- parse token sequences or byte arrays
- generate a recursive descent parser from a grammar

## When to choose
- you want grammar and action code together in one Rust macro
- you need precedence climbing for infix/prefix/postfix expressions
- you want parameterized rules and custom input types
- you prefer PEG semantics over LR or combinator parsing

## When to avoid
- you need streaming input
- you want grammar definitions in separate files like pest
- you need LR(1) parsing power for ambiguous grammars
- you're parsing binary data with combinators and nom fits better

## Facets
- artifact type: library
- maturity: stable
- function: parser, compiler
- domain: parsers, programming-languages, developer-tools
- platform: rust
- tags: peg, parser-generator, proc-macro, recursive-descent, grammar

## Member repositories
- kevinmehall/rust-peg (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:10.413406+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:52:14.360997+00:00, confidence not recorded.
  - readme: https://github.com/kevinmehall/rust-peg (fetched 2026-08-28T04:05:10.413406+00:00, sha 7e81e63ceeb4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
