# skvadrik/re2c

Lexer generator for C, C++, D, Go, Haskell, Java, JS, OCaml, Python, Rust, Swift, V and Zig.

Repository: https://github.com/skvadrik/re2c
Canonical: https://ross.abutalabs.com/products/re2c
Homepage: https://re2c.org
Language: C
License: NOASSERTION
License Family: other
Last push: 2026-08-26T13:46:23+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 65, longevity 100
- inputs: {"age_days": 4622, "days_push": 7, "days_rel": 159, "gap_med": 65, "n_releases_24m": 10}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1308, forks 201 (observed 2026-08-28T04:04:19.318228+00:00)

## What it is
re2c is a free and open-source lexer generator that compiles regular expressions into fast, direct-coded lexers for many languages including C/C++, Go, Rust, Python, and Java. It embeds generated finite state automata directly as conditional jumps and comparisons, producing code that is as fast as hand-written lexers and easier to debug than table-driven alternatives.

## Use cases
- generate a fast tokenizer for a C or C++ compiler
- generate lexer code in Go or Rust from regular expressions
- replace a slow table-driven lexer with direct-coded automata
- build a custom DSL parser with submatch extraction
- embed a lexer inside existing source code without a fixed program template
- generate Unicode-aware lexers with UTF-8/UTF-16/UTF-32 support

## When to choose
- you need maximum lexer performance comparable to hand-coded tokenizers
- you want generated lexer code that is readable and debuggable
- you need lexers in one of many supported target languages
- you need flexible integration of lexing into arbitrary code rather than a fixed template
- you need submatch extraction with minimal overhead

## When to avoid
- you want a full parser generator (use yacc/bison/ANTLR alongside)
- you prefer table-driven lexer generation like flex
- you need a runtime regex engine rather than compile-time code generation
- your target language is not supported and you cannot write a syntax file

## Facets
- artifact type: cli-tool
- maturity: stable
- function: parser, compiler, developer-tools
- domain: parsers, programming-languages, developer-tools, compilers
- platform: windows, cross-platform, cli
- tags: lexer-generator, regular-expressions, code-generation, dfa, tokenizer, multi-language, linux, macos

## Member repositories
- skvadrik/re2c (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:19.318228+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-30T04:50:06.129415+00:00, confidence not recorded.
  - readme: https://github.com/skvadrik/re2c (fetched 2026-08-28T04:04:19.318228+00:00, sha 309c5145d4eb)
  - homepage: https://re2c.org (fetched 2026-08-29T12:08:26.288082+00:00, sha 9a51458d3689)
  - site_page: https://re2c.org/build/build.html (fetched 2026-08-29T12:08:26.297391+00:00, sha 39763de1577f)
  - site_page: https://re2c.org/releases/release_notes.html (fetched 2026-08-29T12:08:26.299659+00:00, sha ef137703072c)
  - site_page: https://re2c.org/releases/changelog/changelog.html (fetched 2026-08-29T12:08:26.303115+00:00, sha 88c858b2c924)
- Data as of 2026-08-30T08:39:29.467469+00:00.
