# Install cpp-peglib with Homebrew, MacPorts

Header-only PEG (Parsing Expression Grammars) library for C++. Version 1.15.0 via Homebrew; verified 2026-07-03.

## Install

```sh
sudo av install brew:cpp-peglib
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cpp-peglib
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cpp-peglib
```

  Evidence: MacPorts ports tree: devel/cpp-peglib/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:cpp-peglib
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cpp-peglib>
- **Version:** 1.15.0
- **Source summary:** Header-only PEG (Parsing Expression Grammars) library for C++
- **Homepage:** <https://yhirose.github.io/cpp-peglib/>
- **Repository:** <https://github.com/yhirose/cpp-peglib>
- **Upstream docs:** <https://github.com/yhirose/cpp-peglib#readme>
- **License:** MIT
- **Source archive:** <https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.15.0.tar.gz>
- **Last updated:** 2026-07-03T00:29:13Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- peglint (cli)
- peglint (alias)

## Build dependencies

- cmake

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.15.0
- Package-manager updated: 2026-07-03
- Local data: ok
- Upstream repository: https://github.com/yhirose/cpp-peglib
- Upstream latest detected: v1.15.0 (current)
## Project history and usage

cpp-peglib is Yuji Hirose's single-header C++ PEG parser library. It packages Parsing Expression Grammar support as a C++17 header-only dependency, with peglint as the command-line tool exposed by the Homebrew formula.

### Project history

The public GitHub repository was created in February 2015. Upstream describes the project as a C++17 header-only PEG library that can be used by including peglib.h directly in a project.

The README documents support for packrat parsing, left-recursive grammars, semantic actions, grammar loading, and an online PEG Playground. That positioning makes the project attractive to users who want parser-combinator-like ergonomics without a generated parser build step.

### Adoption history

The supplied package facts list Homebrew and MacPorts. Header-only C++ libraries are often consumed directly from source, so package-manager adoption mainly helps users install the header and peglint consistently.

### How it is used

cpp-peglib is used to embed PEG grammars into C++ applications, build small DSL parsers, and lint grammar definitions. Upstream examples show calculator grammars, semantic actions, error logging, token boundaries, predicates, and packrat parsing.

### Why package nerds care

For package maintainers, cpp-peglib is a tidy example of a header-only C++ library with a useful companion executable. Its C++17 requirement and pthread note for some Linux distributions are the main packaging details.

### Timeline

- 2015: Public GitHub repository created.
- 2015: Early upstream tags include v0.1.x releases.
- 2026: Upstream releases include v1.12.0.

### Related projects

- The README links cpp-peglib to Parsing Expression Grammars and packrat parsing literature.
- PEG Playground is the upstream online demonstration for cpp-peglib.

### Sources

- <https://api.github.com/repos/yhirose/cpp-peglib>
- <https://raw.githubusercontent.com/yhirose/cpp-peglib/master/README.md>
- <https://api.github.com/repos/yhirose/cpp-peglib/releases?per_page=5>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Source Database Details

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

## Other Package-Manager Records

- MacPorts - cpp-peglib: normalized package name match | MacPorts ports tree: devel/cpp-peglib/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [cmake](https://www.automicvault.com/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [htmlcxx](https://www.automicvault.com/pkg/brew/htmlcxx/) - Shares av.db curated category or tags: c-plus-plus, cli, developer-tools, library, parser.
- [btparse](https://www.automicvault.com/pkg/brew/btparse/) - Shares av.db curated category or tags: cli, developer-tools, library, parser, parsing.
- [sqlparse](https://www.automicvault.com/pkg/brew/sqlparse/) - Shares av.db curated category or tags: cli, developer-tools, library, parser, parsing.
- [urdfdom](https://www.automicvault.com/pkg/brew/urdfdom/) - Shares av.db curated category or tags: cli, developer-tools, library, parser, parsing.
- [htmlcleaner](https://www.automicvault.com/pkg/brew/htmlcleaner/) - Shares av.db curated category or tags: cli, developer-tools, parser, parsing.
- [libfyaml](https://www.automicvault.com/pkg/brew/libfyaml/) - Shares av.db curated category or tags: cli, developer-tools, parser, parsing.
- [cctz](https://www.automicvault.com/pkg/brew/cctz/) - Shares av.db curated category or tags: c-plus-plus, cli, developer-tools, library.
- [ctemplate](https://www.automicvault.com/pkg/brew/ctemplate/) - Shares av.db curated category or tags: c-plus-plus, cli, developer-tools, library.
- [pybind11](https://www.automicvault.com/pkg/brew/pybind11/) - Local package facts share a topical domain. Shared terms: cli, cpp, developer, developer-tools, header.

## Combined YAML source

View the package source record on GitHub. [combined/cpp-peglib.yml](https://github.com/automic-vault/db/blob/main/combined/cpp-peglib.yml)


## Sources

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