PHPackages                             fpoirotte/php\_parsergenerator\_installer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. fpoirotte/php\_parsergenerator\_installer

ActiveComposer-plugin[Parsing &amp; Serialization](/categories/parsing)

fpoirotte/php\_parsergenerator\_installer
=========================================

Automatically compiles parsers upon a package's installation

0.1.4(8y ago)03524BSD-3-ClausePHP

Since May 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fpoirotte/PHP_ParserGenerator_Installer)[ Packagist](https://packagist.org/packages/fpoirotte/php_parsergenerator_installer)[ Docs](https://github.com/fpoirotte/PHP_ParserGenerator_Installer)[ RSS](/packages/fpoirotte-php-parsergenerator-installer/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (4)

Compile parsers automatically upon installation
===============================================

[](#compile-parsers-automatically-upon-installation)

This repository contains a custom Composer installer meant for projects that use parsers written using the [fpoirotte/php\_parsergenerator](https://packagist.org/packages/fpoirotte/php_parsergenerator)Composer package.

When a package relying on this installer is installed or updated, its parsers will automatically be rebuilt if necessary, based on their source grammar. Likewise, those parsers are automatically erased when the package is uninstalled.

Usage
-----

[](#usage)

To use this installer, edit your project's `composer.json` file:

- Set the type to `php-parsers`
- Add a requirement on `fpoirotte/php_parsergenerator_installer`
- Declare your parsers using the `php-parsers` extra option

The extra option may contain either:

- A list of relative paths to grammars: for each such grammar, a parser will be generated in the same folder with the same base name (eg. `src/Foo.y` gets compiled into `src/Foo.php`)
- A mapping between the expected parsers and their source grammar (see below)

For example, the `erebot/intl` Composer package uses the following configuration to build a parser in `src/PluralParser.php` based on the contents of the grammar located in `data/PluralParser.y`, relative to the package's root directory:

```
{
     "name": "erebot/intl",
     "type": "php-parsers",
     "require": {
         "fpoirotte/php_parsergenerator_installer": "^0.1.0"
     },
     "extra": {
         "php-parsers": {
             "src/PluralParser.php": "data/PluralParser.y"
         }
     }
 }
```

Now, when installing/updating a package that uses this installer, you will see output similar to this one:

```
clicky@localhost:~/git/Erebot/Styling$ composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 34 installs, 0 updates, 0 removals
  - Installing fpoirotte/php_parsergenerator (0.2.3): Loading from cache
  - Installing fpoirotte/php_parsergenerator_installer (0.1.4): Loading from cache
  ...
Generating autoload files
Compiling '.../vendor/erebot/intl/src/PluralParser.php' from '.../vendor/erebot/intl/data/PluralParser.y'
Parser statistics: 28 terminals, 3 nonterminals, 27 rules
                   55 states, 0 parser table entries, 20 conflicts
20 parsing conflicts.
Compiling 'src/Styling/Parser.php' from 'data/Styling.y'
Parser statistics: 8 terminals, 3 nonterminals, 9 rules
                   17 states, 0 parser table entries, 0 conflicts
```

Copyright and license
---------------------

[](#copyright-and-license)

Copyright (c) 2018, François Poirotte. This installer is licensed under the 3-clause BSD License, see the [LICENSE file](https://github.com/fpoirotte/PHP_ParserGenerator_Installer/blob/master/LICENSE)for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

2923d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3349e240558c2c63c2488ec7ddc04f623fad0adec6ff13ff4d58047b3facded4?d=identicon)[fpoirotte](/maintainers/fpoirotte)

---

Top Contributors

[![fpoirotte](https://avatars.githubusercontent.com/u/499919?v=4)](https://github.com/fpoirotte "fpoirotte (16 commits)")

---

Tags

parsergeneratorcompilerlemonlempar

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fpoirotte-php-parsergenerator-installer/health.svg)

```
[![Health](https://phpackages.com/badges/fpoirotte-php-parsergenerator-installer/health.svg)](https://phpackages.com/packages/fpoirotte-php-parsergenerator-installer)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[phpowermove/docblock

PHP Docblock parser and generator. An API to read and write Docblocks.

2524.0M4](/packages/phpowermove-docblock)[mishal/iless

Less.js port to PHP

4737.0k3](/packages/mishal-iless)[gajus/paggern

Pattern interpreter for generating random strings.

3045.1k1](/packages/gajus-paggern)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
