macOS
brew install peglocal Homebrew formula metadata
安装
brew install peglocal Homebrew formula metadata
sudo apk add pegAlpine Linux edge package indexes · peg · 来源: dl-cdn.alpinelinux.org
nix profile install nixpkgs#pegnixpkgs package indexes · pkgs/by-name/pe/peg/package.nix · 来源: api.github.com
sudo pacman -S pegArch Linux sync databases · peg · 来源: geo.mirror.pkgbuild.com
sudo zypper install pegopenSUSE Tumbleweed package metadata · peg · 来源: download.opensuse.org
概览
Program to perform pattern matching on text
历史
peg and leg are recursive-descent parser generators for C. They process Parsing Expression Grammars and generate C parsers, with `peg` following Bryan Ford's original PEG syntax and `leg` using conventions intended as an alternative to lex and yacc.
Ian Piumarta's official page lists peg/leg as tools for generating recursive-descent parsers from Parsing Expression Grammars. The first public release in the official version history is 0.1.1 on 2007-05-15.
The manual page explains that peg reads grammar files or standard input and generates C source defining `yyparse()`, while leg uses a syntax intended to make it attractive to users familiar with lex and yacc workflows.
The official version history shows steady maintenance through 0.1.19 stable in 2023, including reentrant parsing support, error actions, UTF-8 fixes, C++ support improvements, and Windows/Mac build files.
peg/leg spread through Unix-like package managers as a small C parser-generation tool: the input metadata lists Homebrew, Debian, Ubuntu, Arch, MacPorts, Nix, Alpine, and openSUSE package names.
Its niche is smaller than yacc-family tools, but it remains useful where a project wants PEG-style ordered choice, unlimited backtracking, and combined scanning and parsing in generated C.
Typical use is to run `peg` or `leg` over a grammar file and compile or include the generated C source in a client program.
The official manual documents options such as `-o` for output file selection, `-P` for suppressing `#line` directives, `-v` for verbose mode, and `-V` for version output.
peg/leg is package-manager-friendly because it is a compact C command-line tool with a stable manual page, source tarballs, and a long version history.
For package nerds it is also a useful contrast with lex/yacc: a small PEG-based generator that produces embeddable C parsers without requiring a larger parser framework.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
leg | cli | 全局可执行文件 | |
peg | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://www.piumarta.com/software/peg/
安装元数据
| 软件包键 | brew:peg |
|---|---|
| 版本 | 0.1.19 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/peg |
| 主页 | https://www.piumarta.com/software/peg/ |
| 上游文档 | https://www.piumarta.com/software/peg |
| 许可证 | MIT |
| 源码归档 | https://www.piumarta.com/software/peg/peg-0.1.19.tar.gz |
| 最后更新 | 2026-06-14T14:47:59+02:00 |
| Pulse | updated |
| Bottle | 可用 (于 arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, monterey, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | peg |
| Aliases |
|
| Version Scheme | 0 |
| Revision | 0 |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
peg 0.1.20+really0.1.18-1
recursive-descent parser generators for C
https://piumarta.com/software/peg/
sudo apt install pegpeg
nix profile install nixpkgs#pegpeg 0.1.18-1build1
recursive-descent parser generators for C
http://piumarta.com/software/peg/
sudo apt install pegpeg 0.1.18-r1
Recursive-descent parser generators for C
https://www.piumarta.com/software/peg/
sudo apk add pegpeg-doc 0.1.18-r1
Recursive-descent parser generators for C (documentation)
https://www.piumarta.com/software/peg/
sudo apk add peg-docpeg 0.1.19-1
recursive-descent parser generators for C
http://piumarta.com/software/peg/
sudo pacman -S pegpeg 0.1.20-1.7
Recursive-Descent parser generators for C
https://piumarta.com/software/peg/
sudo zypper install pegpeg
sudo port install peg来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.