scato/phpeg

PEG Parser Generator

Maintainers

Details

github.com/scato/phpeg

Source

Issues

Installs: 851

Dependents: 2

Suggesters: 0

Security: 0

Stars: 8

Watchers: 2

Forks: 1

Open Issues: 0

pkg:composer/scato/phpeg

1.0.2 2015-03-29 09:50 UTC

This package is not auto-updated.

Last update: 2025-10-11 22:37:45 UTC


README

PEG Parser Generator

This project is still unstable. Some features like case-insensitive literals are stil missing. The rest should work, though.

Usage

Install this tool as a dev requirement:

"require-dev": {
    "scato/phpeg": "1.*"
}

You can now generate (and regenerate) parsers using the command line tool:

$ vendor/bin/phpeg generate <input-file> [<output-file>]

Read the grammar section in the documentation for help on the grammar syntax. Read the usage section for more details on both basic and advanced usage.

About

PHPeg is a PEG parser generator.

The generated parser is a PEG parser that uses memoization. This effectively makes it a Packrat Parser, or so I'm told.

PHPeg is heavily inspired by PEG.js. The grammar section contains details on the differences.