🍺 BREW Explorer

← all formulae

flex

brew install flex v2.6.4_2 BSD-2-Clause keg-only

Lexical analyzer generator that produces C/C++ tokenizers from pattern specifications.

Why you might care

Flex is the standard tool for building scanners and lexers in compiler/parser pipelines. It's keg-only because macOS ships its own (often outdated) version; install this for modern flex features and to avoid conflicts. Used alongside Bison for full grammar-based language implementations.

Categories

Alternatives

lex re2c ragel
2.2k
30-day installs · #940
9.8k
90-day · #821
32.5k
365-day · #849
4.0k
★ GitHub stars · updated 12d ago

Runtime dependencies

Build dependencies

GitHub topics

c flex lexer lexer-generator

Links

Keg-only reason

:provided_by_macos

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "lex",
    "re2c",
    "ragel"
  ],
  "build_dependencies": [
    "help2man"
  ],
  "categories": [
    "lexer",
    "compiler",
    "parser"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [
    "gettext"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Fast Lexical Analyzer, generates Scanners (tokenizers)",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:37:42+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "flex",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-06-08T14:49:29Z",
  "github_readme_excerpt": "[![Build Status](https://github.com/westes/flex/actions/workflows/build.yml/badge.svg)](https://github.com/westes/flex/actions/workflows/build.yml)\n\n\nThis is flex, the fast lexical analyzer generator.\n\nflex is a tool for generating scanners: programs which recognize\nlexical patterns in text.\n\nThe flex codebase is kept in\n[Git on GitHub.](https://github.com/westes/flex) Source releases of flex with some intermediate files already built can be found on [the github releases page.](https://github.com/westes/flex/releases)\n\nUse GitHub\u0027s [issues](https://github.com/westes/flex/issues) and\n[pull request](https://github.com/westes/flex) features to file bugs\nand submit patches.\n\nThere are several mailing lists available as well:\n\n* flex-announce@lists.sourceforge.net - where posts will be made\n  announcing new releases of flex.\n* flex-help@lists.sourceforge.net - where you can post questions about\n  using flex\n* flex-devel@lists.sourceforge.net - where you can discuss development\n  of flex itself\n\nFind information on subscribing to the mailing lists or search in the\narchive at: https://sourceforge.net/p/flex/mailman/\nNote: Posting is only allowed from addresses that are subscribed to\nthe lists.\n\nThe flex distribution contains the following files which may be of\ninterest:\n\n* README.md - This file.\n* NEWS - current version number and list of user-visible changes.\n* INSTALL.md - basic installation information.\n* ABOUT-NLS - description of internationalization support in flex.\n* COPYING - flex\u0027s copyright and license.\n* doc/ - user documentation.\n* examples/ - containing examples of some possible flex scanners and a\n              few other things. See the file examples/README for more\n              details.\n* tests/ - regression tests. See tests/README for details.\n* po/ - internationalization support files.\n\n---\n\nThis file is part of flex.\n\nThis code is derived from software contributed to Berkeley by\nVern Paxson.\n\nThe United States Government has rights in this work pursuant\n",
  "github_repo": "westes/flex",
  "github_stars": 4027,
  "github_topics": [
    "c",
    "flex",
    "lexer",
    "lexer-generator"
  ],
  "homepage": "https://github.com/westes/flex",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 2178,
  "installs_365d": 32511,
  "installs_90d": 9773,
  "keg_only": 1,
  "keg_only_reason": ":provided_by_macos",
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "BSD-2-Clause",
  "llm_generated_at": "2026-06-20T23:48:02+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "flex",
  "oldnames": [],
  "one_liner": "Lexical analyzer generator that produces C/C++ tokenizers from pattern specifications.",
  "optional_dependencies": [],
  "rank_30d": 940,
  "rank_365d": 849,
  "rank_90d": 821,
  "raw_hash": "4b48e3dea0116d71",
  "recommended_dependencies": [],
  "revision": 2,
  "ruby_source_path": "Formula/f/flex.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    {
      "bison": "build"
    },
    "m4"
  ],
  "version_head": "HEAD",
  "version_stable": "2.6.4",
  "versioned_formulae": [],
  "why_use_this": "Flex is the standard tool for building scanners and lexers in compiler/parser pipelines. It\u0027s keg-only because macOS ships its own (often outdated) version; install this for modern flex features and to avoid conflicts. Used alongside Bison for full grammar-based language implementations."
}