macOS
brew install bnfclocal Homebrew formula metadata
brew / rank 6563
BNF Converter. Version 2.9.6.3 via Homebrew; verified 2026-07-22. Also installable with debian: sudo apt install bnfc.
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 | executable | indexed executable | Discovered from the local executable index. |
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 |
| Homepage | https://github.com/BNFC/bnfc |
| Repository | https://github.com/BNFC/bnfc |
| Last updated | 2026-07-22T02:42:18Z |
| Pulse | updated |
| Bottle | not recorded |
| Service | none declared |
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-35
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.