# foonathan/lexy

C++ parsing DSL

Repository: https://github.com/foonathan/lexy
Canonical: https://ross.abutalabs.com/products/lexy
Homepage: https://lexy.foonathan.net
Language: C++
License: BSL-1.0
License Family: other
Topics: parser, grammar, parser-combinators, text
Last push: 2025-10-18T15:36:27+00:00

## Health v2 (maintenance only)
Score: 44/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 47, release rhythm 8, longevity 100
- inputs: {"age_days": 2581, "days_push": 319, "days_rel": 461, "gap_med": null, "n_releases_24m": 1}
- flags: no_readme
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1254, forks 84 (observed 2026-08-28T04:04:08.643175+00:00)

## What it is
lexy is a parser combinator library for C++17 and onwards that lets you define grammars directly in C++ as a DSL. It generates hand-written-style recursive descent parsers with full control over backtracking and lookahead, without external grammar files.

## Use cases
- parse structured text formats like IPv4 addresses or config files in C++
- write a DSL or expression parser without a parser generator
- replace hand-written recursive descent parsers with declarative grammar rules
- build a compiler or interpreter front-end in C++
- parse custom file formats with precise control over backtracking and error reporting

## When to choose
- you want parser combinator flexibility embedded directly in C++ code
- you need fine-grained control over parsing behavior, backtracking, and lookahead
- you want good error reporting and tracing for grammar debugging
- you prefer no external grammar files or code generation steps

## When to avoid
- you need a table-driven parser generator like yacc/ANTLR with automatic ambiguity resolution
- your project targets C++ standards older than C++17
- you need parsing in a language other than C++

## Facets
- artifact type: library
- maturity: active
- function: parser
- domain: parsers, developer-tools, programming-languages
- platform: cpp, cross-platform
- tags: parser-combinators, parsing-dsl, recursive-descent, c++17, header-only

## Member repositories
- foonathan/lexy (main) score 44

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:08.643175+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-30T05:07:24.098039+00:00, confidence not recorded.
  - homepage: https://lexy.foonathan.net (fetched 2026-08-29T12:17:50.593283+00:00, sha 7b833e9038f8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
