# 使用 Homebrew, apt 安装 menhir

查看 menhir 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:menhir
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install menhir
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install menhir
```

  证据: Debian stable package indexes: menhir from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:menhir
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/menhir>
- **版本:** 20260209
- **来源摘要:** LR(1) parser generator for the OCaml programming language
- **主页:** <http://cristal.inria.fr/~fpottier/menhir>
- **上游文档:** <http://cristal.inria.fr/~fpottier/menhir>
- **许可证:** GPL-3.0-or-later
- **源码归档:** <https://gitlab.inria.fr/fpottier/menhir/-/archive/20260209/menhir-20260209.tar.bz2>
- **最后更新:** 2026-07-13T05:11:30Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- menhir (cli)
- menhir (别名)

## 依赖

- ocaml

## 构建依赖

- dune
- ocamlbuild

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 20260209
- 管理器更新时间: 2026-07-13
- 本地数据: OK
- 上游仓库: http://cristal.inria.fr/~fpottier/menhir
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

Menhir is an LR(1) parser generator for OCaml, created in 2005 by François Pottier and Yann Régis-Gianas. Its manual presents it as a generator that turns grammar specifications plus semantic actions into parsers, based on Knuth's LR(1) construction and inspired by yacc, ML-Yacc, and ocamlyacc while adding more modern capabilities.

### 项目历史

The project history is unusually well documented in its README. Régis-Gianas contributed the early front-end for parsing and transforming .mly grammar files, while Pottier contributed the LR(1) construction algorithms, conflict explanations, and first OCaml code backend. A table backend using menhirLib followed in 2008 with Jane Street Capital funding through the OCaml Summer Project. Jacques-Henri Jourdan implemented a Coq-table backend in 2011. Frédéric Bour contributed the incremental API, inspection API, attributes, and MenhirSdk between 2014 and 2017. The build moved to Dune in 2019, and Émile Trotignon and Pottier implemented a new efficient, well-typed code backend around StackLang in 2021.

### 使用方式

Menhir's ecosystem role is as the richer successor-style tool for OCaml parser generation. OCaml developers feed it .mly grammar files and receive parser .ml/.mli output, either as standalone generated code or table-backed parsers linked with MenhirLib. The opam package page lists many reverse users, including compiler, verification, parsing, and developer-tooling packages, which matches its place as infrastructure for OCaml language tooling.

### 来源

- <https://gallium.inria.fr/~fpottier/menhir/manual.html>
- <https://github.com/LexiFi/menhir>
- <https://inbox.ci.dev/caml-list/20051215084616.GC1966%40yquem.inria.fr/>
- <https://ocaml.org/p/menhir/20200123>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** menhir
- **Version Scheme:** 0
- **Revision:** 1
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Debian apt - libmenhir-ocaml-dev - 20240715+ds-1+b2: normalized package name match | Debian stable package indexes: libmenhir-ocaml-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Menhir library for OCaml | https://gallium.inria.fr/~fpottier/menhir/
- Debian apt - menhir - 20240715+ds-1+b2: normalized package name match | Debian stable package indexes: menhir from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Parser generator for OCaml | https://gallium.inria.fr/~fpottier/menhir/
- Debian apt - menhir-doc - 20240715+ds-1: normalized package name match | Debian stable package indexes: menhir-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation of the Menhir parser generator for OCaml | https://gallium.inria.fr/~fpottier/menhir/
- Ubuntu apt - libmenhir-ocaml-dev - 20231231+ds-1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmenhir-ocaml-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Menhir library for OCaml | https://gallium.inria.fr/~fpottier/menhir/
- Ubuntu apt - menhir - 20231231+ds-1: normalized package name match | Ubuntu 24.04 LTS package indexes: menhir from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Parser generator for OCaml | https://gallium.inria.fr/~fpottier/menhir/
- Ubuntu apt - menhir-doc - 20231231+ds-1: normalized package name match | Ubuntu 24.04 LTS package indexes: menhir-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Documentation of the Menhir parser generator for OCaml | https://gallium.inria.fr/~fpottier/menhir/


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [ocaml](https://pkg.so/zh-hans/brew/ocaml/) - Runtime dependency declared by Homebrew.
- [dune](https://pkg.so/zh-hans/brew/dune/) - Build dependency declared by Homebrew.
- [ocamlbuild](https://pkg.so/zh-hans/brew/ocamlbuild/) - Build dependency declared by Homebrew.
- [peg](https://pkg.so/zh-hans/brew/peg/) - Shares pkgdb curated category or tags: cli, compiler-tools, developer-tools, parser-generator.
- [bison](https://pkg.so/zh-hans/brew/bison/) - Shares pkgdb curated category or tags: cli, compiler-tools, developer-tools, parser-generator.
- [byacc](https://pkg.so/zh-hans/brew/byacc/) - Shares pkgdb curated category or tags: cli, compiler-tools, developer-tools, parser-generator.
- [antlr](https://pkg.so/zh-hans/brew/antlr/) - Shares pkgdb curated category or tags: cli, compiler-tools, developer-tools, parser-generator.
- [javacc](https://pkg.so/zh-hans/brew/javacc/) - Shares pkgdb curated category or tags: cli, developer-tools, grammar, parser-generator.
- [bnfc](https://pkg.so/zh-hans/brew/bnfc/) - Shares pkgdb curated category or tags: cli, developer-tools, grammar, parser-generator.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Shares pkgdb curated category or tags: cli, compiler-tools, developer-tools.
- [tree-sitter-cli](https://pkg.so/zh-hans/brew/tree-sitter-cli/) - Shares pkgdb curated category or tags: cli, developer-tools, parser-generator.

## Combined YAML source

View the package source record on GitHub. [combined/menhir.yml](https://github.com/mxcl/pkgdb/blob/main/combined/menhir.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
