Automic VaultAutomic Vault

brew

使用 Homebrew, apk, apt, MacPorts, Nix, pacman, zypper 安装 peg

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install peg

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install peg

MacPorts ports tree · devel/peg/Portfile · 来源: api.github.com

Linux

Alpine Linux apk已验证 · 92%
sudo apk add peg

Alpine Linux edge package indexes · peg · 来源: dl-cdn.alpinelinux.org

Debian apt已验证 · 92%
sudo apt install peg

Debian stable package indexes · peg · 来源: deb.debian.org

Nix已验证 · 92%
nix profile install nixpkgs#peg

nixpkgs package indexes · pkgs/by-name/pe/peg/package.nix · 来源: api.github.com

Arch Linux pacman已验证 · 92%
sudo pacman -S peg

Arch Linux sync databases · peg · 来源: geo.mirror.pkgbuild.com

openSUSE zypper已验证 · 92%
sudo zypper install peg

openSUSE Tumbleweed package metadata · peg · 来源: download.opensuse.org

概览

软件包摘要

Program to perform pattern matching on text

命令和别名

  • leg
  • peg

历史

项目历史与用法

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.

时间线

  • 2007-05-15: First public release, 0.1.1.
  • 2013-06-03: 0.1.11 added error actions, C++ support improvements, and Win32/Mac build files.
  • 2016-07-22: 0.1.18 added the `-P` option to disable `#line` directives.
  • 2023-03-06: 0.1.19 stable added experimental re-entrant parsing through `yyparsefrom_r()`.
  • 2023-11-19: 0.1.20 development version listed with experimental inline-action variables and semantic values.

Related projects

  • Bryan Ford's 2004 Parsing Expression Grammars paper is the formal grammar reference cited by the official page.
  • lex and yacc are the comparison point used by the official page and manual.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 10 个平台目标。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
legcli全局可执行文件
pegcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本0.1.19
管理器更新时间2026-06-14
本地数据OK
上游not checked
检测到的最新版本未检测到

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
Pulseupdated
Bottle可用 (于 arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, monterey, sonoma, ventura, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namepeg
Aliases
  • leg
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Debian apt95%

peg 0.1.20+really0.1.18-1

recursive-descent parser generators for C

https://piumarta.com/software/peg/

sudo apt install peg
  • Section: devel
  • Architecture: amd64
  • 1 依赖
  • normalized package name match
  • 匹配方式:Peg
Debian stable package indexes · deb.debian.org · Debian stable package indexes: peg from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

peg

nix profile install nixpkgs#peg
  • normalized package name match
  • 匹配方式:Peg
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/pe/peg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

peg 0.1.18-1build1

recursive-descent parser generators for C

http://piumarta.com/software/peg/

sudo apt install peg
  • Section: universe/devel
  • Architecture: amd64
  • 1 依赖
  • normalized package name match
  • 匹配方式:Peg
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: peg from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

peg 0.1.18-r1

Recursive-descent parser generators for C

https://www.piumarta.com/software/peg/

sudo apk add peg
  • License: MIT
  • Architecture: x86_64
  • Source Package: peg
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Peg
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: peg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

peg-doc 0.1.18-r1

Recursive-descent parser generators for C (documentation)

https://www.piumarta.com/software/peg/

sudo apk add peg-doc
  • License: MIT
  • Architecture: x86_64
  • Source Package: peg
  • normalized package name match
  • 匹配方式:Peg
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: peg-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
pacman95%

peg 0.1.19-1

recursive-descent parser generators for C

http://piumarta.com/software/peg/

sudo pacman -S peg
  • License: MIT
  • Architecture: x86_64
  • normalized package name match
  • 匹配方式:Peg
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: peg from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz
zypper95%

peg 0.1.20-1.7

Recursive-Descent parser generators for C

https://piumarta.com/software/peg/

sudo zypper install peg
  • License: MIT
  • Category: Development/Tools/Building
  • Architecture: x86_64
  • Source Package: peg
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Peg
openSUSE Tumbleweed package metadata · download.opensuse.org · openSUSE Tumbleweed package metadata: peg from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst
MacPorts95%

peg

sudo port install peg
  • normalized package name match
  • 匹配方式:Peg
MacPorts ports tree · api.github.com · MacPorts ports tree: devel/peg/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment