# westes/flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++

Repository: https://github.com/westes/flex
Canonical: https://ross.abutalabs.com/products/westes-flex
Language: C
License: NOASSERTION
License Family: other
Topics: flex, c, lexer-generator, lexer
Last push: 2026-08-03T14:35:20+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 95, release rhythm 8, longevity 100
- inputs: {"age_days": 4670, "days_push": 30, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- 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 4039, forks 572 (observed 2026-08-28T04:08:33.497803+00:00)

## What it is
flex is the classic fast lexical analyzer generator that produces C/C++ scanner code from regular-expression pattern specifications. It is the standard successor to lex, widely used in compilers, interpreters, and text-processing tools.

## Use cases
- generate a lexer for a programming language in C
- tokenize text with regular expression patterns
- build a scanner for a compiler or interpreter
- replace hand-written string parsing with generated lexing code
- port legacy lex scanner files to modern toolchains

## When to choose
- you need a fast, battle-tested lexer generator for C or C++
- you want POSIX lex compatibility
- you are building a compiler front end and need tokenization

## When to avoid
- you need a lexer for languages other than C/C++ (consider alternatives like re2c, ANTLR, or language-native lexer libraries)
- you need full parser generation, not just lexing (pair with bison or use a parser generator)
- you want a modern regex engine embedded at runtime rather than generated code

## Facets
- artifact type: cli-tool
- maturity: stable
- function: parser, compiler, developer-tools
- domain: parsers, developer-tools, programming-languages
- platform: windows, cross-platform, cli
- tags: lexer-generator, scanner, lex, c, c++, regex, linux, macos

## Member repositories
- westes/flex (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:33.497803+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-29T18:23:46.570348+00:00, confidence not recorded.
  - readme: https://github.com/westes/flex (fetched 2026-08-28T04:08:33.497803+00:00, sha c3e61923cd60)
- Data as of 2026-08-30T08:39:29.467469+00:00.
