# 使用 Homebrew, apt, MacPorts, Nix, zypper, dnf 安装 antlr

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

## 安装

```sh
sudo av install brew:antlr
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install antlr
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install antlr
```

  证据: MacPorts ports tree: lang/antlr/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install antlr
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#antlr
```

  证据: nixpkgs package indexes: antlr from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- zypper (92%):

```sh
sudo zypper install antlr
```

  证据: openSUSE Tumbleweed package metadata: antlr from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

- dnf (92%):

```sh
sudo dnf install antlr-C++
```

  证据: Fedora Rawhide package metadata: antlr-C++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:antlr
- **软件包管理器:** Homebrew
- **版本:** 4.13.2
- **来源摘要:** ANother Tool for Language Recognition
- **主页:** <https://www.antlr.org/>
- **最后更新:** 2026-06-22T14:02:43-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- antlr (别名)
- grun (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 4.13.2
## 项目历史与用法

ANTLR, short for ANother Tool for Language Recognition, is a long-running parser-generator project led by Terence Parr. Its package-manager identity is the classic command-line compiler-tool shape: install a runtime/tool, write a grammar, generate parser code, and wire that generated code into a language, protocol, data-format, or DSL implementation.

### 项目历史

The official site describes ANTLR as a parser generator for reading, processing, executing, or translating structured text or binary files, and notes that Parr has worked on language tools since 1989. ANTLR 4 is the modern generation of the project; its repository documentation says major version bumps happen when the tool is rewritten for a new generation, specifically citing the ANTLR 3 to ANTLR 4 move from LL(*) to ALL(*) parsing.

ANTLR 4 consolidated the tool and runtimes in one coordinated release line. The README explains that a release covers the tool plus all supported runtimes at the same version, because cross-target consistency is part of the project contract. That policy makes ANTLR feel unlike many single-language packages: a Homebrew user installing the CLI is also installing into a cross-language ecosystem.

### 采用历史

ANTLR became important wherever teams needed maintainable parsers without hand-writing lexers and recursive-descent parsers. The official README says it is widely used to build languages, tools, and frameworks, and the docs point to grammars-v4 as a companion repository of reusable grammars.

The ANTLR 4 line broadened adoption by supporting multiple code-generation targets. The README currently lists C++, C#, Dart, Java, JavaScript, PHP, Python 3, Swift, TypeScript, and Go, with a dedicated Go runtime repository for Go module consumption while development still happens in the main repository.

### 使用方式

The package is used from the command line to turn a grammar into parser and lexer code, then optionally inspect parse trees during development. The official site's quick start shows installing the modern antlr4-tools wrapper, writing an Expr.g4 grammar, using antlr4-parse to visualize a parse tree, and running antlr4 to generate source files.

In package-manager culture, ANTLR sits with bison, yacc, ragel, tree-sitter, and compiler toolchains: it is not usually an end-user app, but it is a dependency that creates other code. That makes version pinning and generated-output reproducibility matter, especially because the README recommends regenerating parsers with each minor release.

### 为什么软件包爱好者会关心

ANTLR is a package nerd's parser-generator benchmark: old enough to have multiple major generations, portable enough to ship runtimes for many languages, and opinionated enough that its release policy is explicitly documented. The Homebrew formula name is the short historical name, while upstream's current docs distinguish the ANTLR 4 tool, runtimes, generated parsers, and related grammar collections.

It also illustrates why source packages and generated-code packages are different operational animals. Updating the CLI can imply regenerating checked-in parser code, updating runtime packages in several languages, and checking target-specific compatibility rather than treating the version as a simple semver patch.

### 时间线

- 1989: Terence Parr is described by the official site as having worked on language tools since this year.
- 2012: ANTLR 4 documentation includes Pragmatic Bookshelf copyright and material from The Definitive ANTLR 4 Reference.
- 2023: ANTLR 4.13.1 release notes show continued maintenance across C#, Go, Java, JavaScript, and Swift targets.
- 2024: ANTLR 4.13.2 is published as a minor update release.

### Related projects

- grammars-v4 provides a large official collection of action-free grammars for use with ANTLR.
- antlr4-go is the dedicated Go runtime repository used for Go module imports while runtime development remains in antlr/antlr4.
- antlr4-tools is the official-site-recommended helper for installing Java and ANTLR and exposing antlr4 and antlr4-parse commands.

### 来源

- Official ANTLR homepage, README, docs index, and GitHub release feed.


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

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

- Debian apt - antlr - 2.7.7+dfsg-14: normalized package name match | Debian stable package indexes: antlr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Debian apt - antlr-doc - 2.7.7+dfsg-14: normalized package name match | Debian stable package indexes: antlr-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Debian apt - libantlr-dev - 2.7.7+dfsg-14: normalized package name match | Debian stable package indexes: libantlr-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Debian apt - libantlr-java - 2.7.7+dfsg-14: normalized package name match | Debian stable package indexes: libantlr-java from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language tool for constructing recognizers, compilers etc (java library) | https://www.antlr2.org
- Debian apt - python3-antlr - 2.7.7+dfsg-14: normalized package name match | Debian stable package indexes: python3-antlr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language tool for constructing recognizers, compilers etc - Python 3.x | https://www.antlr2.org
- Nix - antlr: normalized package name match | nixpkgs package indexes: antlr from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - antlr - 2.7.7+dfsg-13build1: normalized package name match | Ubuntu 24.04 LTS package indexes: antlr from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Ubuntu apt - antlr-doc - 2.7.7+dfsg-13build1: normalized package name match | Ubuntu 24.04 LTS package indexes: antlr-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Ubuntu apt - libantlr-dev - 2.7.7+dfsg-13build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libantlr-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language tool for constructing recognizers, compilers etc | https://www.antlr2.org
- Ubuntu apt - libantlr-java - 2.7.7+dfsg-13build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libantlr-java from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language tool for constructing recognizers, compilers etc (java library) | https://www.antlr2.org
- Ubuntu apt - python3-antlr - 2.7.7+dfsg-13build1: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-antlr from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language tool for constructing recognizers, compilers etc - Python 3.x | https://www.antlr2.org
- dnf - antlr-C++ - 2.7.7-90.fc44: normalized package name match | Fedora Rawhide package metadata: antlr-C++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | C++ bindings for antlr2 generated parsers | http://www.antlr2.org/
- dnf - antlr-manual - 2.7.7-90.fc44: normalized package name match | Fedora Rawhide package metadata: antlr-manual from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Manual for antlr | http://www.antlr2.org/
- dnf - antlr-tool - 2.7.7-90.fc44: normalized package name match | Fedora Rawhide package metadata: antlr-tool from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | ANother Tool for Language Recognition | http://www.antlr2.org/
- zypper - antlr - 2.7.7-126.4: normalized package name match | openSUSE Tumbleweed package metadata: antlr from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Another Tool for Language Recognition | https://www.antlr.org/
- zypper - antlr-devel - 2.7.7-126.4: normalized package name match | openSUSE Tumbleweed package metadata: antlr-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | ANother Tool for Language Recognition (c++ runtime) | https://www.antlr.org/


## Combined YAML source

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


## 来源

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