macOS
brew install bnfclocal Homebrew formula metadata
brew
BNF Converter. Version 2.9.6.3 via Homebrew; verified from local package data.
install
brew install bnfclocal Homebrew formula metadata
sudo apt install bnfcDebian stable package indexes · bnfc · source: deb.debian.org
sudo pacman -S bnfcArch Linux sync databases · bnfc · source: geo.mirror.pkgbuild.com
overview
BNF Converter
history
BNFC, the BNF Converter, is a compiler-construction tool that turns a Labelled BNF grammar into a compiler front end: abstract syntax, lexer, parser, pretty-printer, test bench, and documentation.
BNFC started at Chalmers and the University of Gothenburg. A 2004 Haskell workshop demonstration by Markus Forsberg and Aarne Ranta says Forsberg and Ranta began development in 2002 as a tool generating Haskell.
The same source records that Michael Pellauer retargeted BNFC to C, C++, and Java in 2003, moving it from a Haskell-only generator toward a multilingual compiler-front-end generator.
Modern BNFC documentation describes the LBNF formalism independently of any one output language, and the project now advertises generation for Haskell, Agda, C, C++, Java, OCaml, XML representations, and Pygments syntax highlighters.
BNFC found adoption in programming-languages courses, research prototypes, and small language implementations where the grammar is the most stable artifact and hand-written front ends would be repetitive.
Its package-manager footprint is narrower than mainstream parser generators but meaningful: Homebrew, Debian/Ubuntu, Arch, and Haskell package ecosystems carry it for developers who want an executable generator rather than a library-only parser toolkit.
A user writes an LBNF grammar, runs bnfc, and then compiles the generated lexer/parser and abstract-syntax code with the target language's usual parser tooling, such as Alex and Happy for Haskell or Flex/Bison-style tools for C-family output.
BNFC is especially useful when the same grammar should produce both implementation artifacts and a readable language specification, keeping parser code, AST constructors, pretty printers, and documentation aligned.
BNFC is package-nerd-significant because it packages an academic compiler-construction idea as a practical command-line generator. It is not just yacc with another syntax; its labeled grammar rules become typed abstract syntax across target languages.
For language-tooling nerds, BNFC sits in the interesting space between parser generators, syntax-specification formalisms, and teaching tools. It makes a grammar file the source of truth for several generated artifacts that are otherwise easy to let drift.
Its long survival in package managers matters because many compiler-course and research tools depend on old but useful grammar generators being installable without reconstructing a Chalmers-era toolchain by hand.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
bnfc | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
install metadata
| Package key | brew:bnfc |
|---|---|
| Version | 2.9.6.3 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/bnfc |
| Homepage | https://github.com/BNFC/bnfc |
| Repository | https://github.com/BNFC/bnfc |
| Upstream docs | https://bnfc.readthedocs.io/en/latest |
| License | BSD-3-Clause |
| Source archive | https://github.com/BNFC/bnfc/archive/refs/tags/v2.9.6.3.tar.gz |
| Dependencies | gmp |
| Build dependencies | cabal-install, ghc, sphinx-doc |
| Uses from macOS | libffi |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | bnfc |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
bnfc 2.9.5-1
Compiler front-end generator based on Labelled BNF
https://bnfc.digitalgrammars.com/
sudo apt install bnfcbnfc 2.9.5-1
Compiler front-end generator based on Labelled BNF
https://bnfc.digitalgrammars.com/
sudo apt install bnfcbnfc 2.9.6.3-18
A compiler front-end generator.
https://bnfc.digitalgrammars.com/
sudo pacman -S bnfcsource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.