# bnfc を Homebrew, apt, pacman でインストール

bnfc のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:bnfc
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install bnfc
```

  証拠: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install bnfc
```

  証拠: Debian stable package indexes: bnfc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- pacman (92%):

```sh
sudo pacman -S bnfc
```

  証拠: Arch Linux sync databases: bnfc from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## パッケージ情報

- **パッケージキー:** brew:bnfc
- **パッケージマネージャ:** Homebrew
- **パッケージマネージャページ:** <https://formulae.brew.sh/formula/bnfc>
- **バージョン:** 2.9.6.3
- **ソース概要:** BNF Converter
- **ホームページ:** <https://github.com/BNFC/bnfc>
- **リポジトリ:** <https://github.com/BNFC/bnfc>
- **ライセンス:** BSD-3-Clause
- **ソースアーカイブ:** <https://github.com/BNFC/bnfc/archive/refs/tags/v2.9.6.3.tar.gz>
- **最終更新:** 2026-07-22T02:42:18Z
- **生成日時:** 2026-08-04T22:13:35+00:00

## 実行可能ファイル

- bnfc (cli)
- bnfc (エイリアス)

## 依存関係

- gmp

## ビルド依存関係

- cabal-install
- ghc
- sphinx-doc

## macOS 提供ライブラリ

- libffi

## インストール挙動

- post-install フック: 未定義
- Bottle: 利用可能 対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## バージョンと鮮度

- ページ生成日: 2026-08-04
- マネージャ版: 2.9.6.3
- マネージャ更新日: 2026-07-22
- ローカルデータ: OK
- 上流リポジトリ: https://github.com/BNFC/bnfc
- 情報: No cached GitHub release or tag data was available.
## プロジェクトの歴史と使われ方

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.

### タイムライン

- 2002: Forsberg and Ranta start BNFC as a Haskell-generating tool.
- 2003: BNFC is retargeted to C, C++, and Java by Michael Pellauer.
- 2004: BNFC is demonstrated at the ACM SIGPLAN Haskell workshop.
- 2010s: BNFC migrates into modern package managers and public GitHub maintenance.
- 2020s: BNFC documentation lists target-language support including Haskell, Agda, C, C++, Java, and OCaml.

### Related projects

- Alex and Happy: Haskell lexer and parser tools often used with BNFC's Haskell backend.
- Flex and Bison: traditional lexer/parser tools related to BNFC's C/C++ style generated front ends.
- ANTLR, yacc, and Menhir: parser-generator neighbors with different grammar models and target ecosystems.
- LBNF: the Labelled BNF grammar formalism used by BNFC.

### ソース

- <https://bnfc.digitalgrammars.com/>
- <https://bnfc.digitalgrammars.com/tutorial/bnfc-tutorial.html>
- <https://bnfc.readthedocs.io/_/downloads/en/v2.9.6.1/pdf/>
- <https://bnfc.readthedocs.io/en/latest>
- <https://github.com/BNFC/bnfc>
- <https://github.com/BNFC/bnfc/blob/master/README.md>
- <https://www.cse.chalmers.se/alumni/markus/BNFC/BNFC_HW2004.pdf>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals

## ソースデータベース詳細

- **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:** head, stable

## 他のパッケージマネージャ記録

- Debian apt - bnfc - 2.9.5-1: normalized package name match | Debian stable package indexes: bnfc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Compiler front-end generator based on Labelled BNF | https://bnfc.digitalgrammars.com/
- Ubuntu apt - bnfc - 2.9.5-1: normalized package name match | Ubuntu 24.04 LTS package indexes: bnfc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Compiler front-end generator based on Labelled BNF | https://bnfc.digitalgrammars.com/
- pacman - bnfc - 2.9.6.3-35: normalized package name match | Arch Linux sync databases: bnfc from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A compiler front-end generator. | https://bnfc.digitalgrammars.com/


## 関連リンク

- [Source-control packages](https://pkg.so/ja/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/ja/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/ja/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/ja/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [sphinx-doc](https://pkg.so/ja/brew/sphinx-doc/) - Build dependency declared by Homebrew.
- [cabal-install](https://pkg.so/ja/brew/cabal-install/) - Build dependency declared by Homebrew.
- [ghc](https://pkg.so/ja/brew/ghc/) - Build dependency declared by Homebrew.
- [javacc](https://pkg.so/ja/brew/javacc/) - Shares pkgdb curated category or tags: cli, developer-tools, grammar, parser-generator.
- [menhir](https://pkg.so/ja/brew/menhir/) - Shares pkgdb curated category or tags: cli, developer-tools, grammar, parser-generator.
- [bison](https://pkg.so/ja/brew/bison/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [tree-sitter-cli](https://pkg.so/ja/brew/tree-sitter-cli/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [byacc](https://pkg.so/ja/brew/byacc/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [antlr](https://pkg.so/ja/brew/antlr/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [lemon](https://pkg.so/ja/brew/lemon/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [kaitai-struct-compiler](https://pkg.so/ja/brew/kaitai-struct-compiler/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.
- [packcc](https://pkg.so/ja/brew/packcc/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, generator, parser.
- [bsc](https://pkg.so/ja/brew/bsc/) - Local package facts share a topical domain. Shared terms: cli, compiler, developer, developer-tools, gmp.
- [cloog](https://pkg.so/ja/brew/cloog/) - Local package facts share a topical domain. Shared terms: cli, compiler, developer, developer-tools, gmp.

## Combined YAML source

View the package source record on GitHub. [combined/bnfc.yml](https://github.com/mxcl/pkgdb/blob/main/combined/bnfc.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
