PHPackages                             wandu/compiler - 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. wandu/compiler

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

wandu/compiler
==============

\[EXPERIMENT\] PHP Base Compiler(Lexical Analyzer).

v3.0.4(9y ago)015MITPHPPHP &gt;=5.6

Since Jan 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Wandu/Compiler)[ Packagist](https://packagist.org/packages/wandu/compiler)[ RSS](/packages/wandu-compiler/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (18)Used By (0)

Wandu Compiler
==============

[](#wandu-compiler)

[![Latest Stable Version](https://camo.githubusercontent.com/13687bc9cb4bae8964d3d611049d77e8a9f3fc0ab459705cb86e46f537cf685c/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6d70696c65722f762f737461626c652e737667)](https://packagist.org/packages/wandu/compiler)[![Latest Unstable Version](https://camo.githubusercontent.com/877628cd6a0979b8759fe96cee7a4eb9db7ab13e5c58dab6476aecde3a625957/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6d70696c65722f762f756e737461626c652e737667)](https://packagist.org/packages/wandu/compiler)[![Total Downloads](https://camo.githubusercontent.com/51215baee6c8368882be4b220a889d77a52ea29beef6377801346148ee55251a/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6d70696c65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/wandu/compiler)[![License](https://camo.githubusercontent.com/7e07a2da0c64b52c397014a9c69c9e71392595f807bf5e34d2d690d4d897da21/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6d70696c65722f6c6963656e73652e737667)](https://packagist.org/packages/wandu/compiler)

**\[EXPERIMENT\]** PHP Base Compiler(Lexical Analyzer).

Installation
------------

[](#installation)

```
composer require wandu/compiler
```

Useage
------

[](#useage)

### LexicalAnalyzer

[](#lexicalanalyzer)

**Example.**

```
$lexer = new \Wandu\Compiler\LexicalAnalyzer([
    '\\+' => function () {
        return 't_add';
    },
    '\\-' => function () {
        return 't_minus';
    },
    '\\*' => function () {
        return 't_multi';
    },
    '\\/' => function () {
        return 't_divide';
    },
    '\\=' => function () {
        return 't_equal';
    },
    '[1-9][0-9]*|0([0-7]+|(x|X)[0-9A-Fa-f]*)?' => function ($word) {
        return "t_number";
    },
    '\s' => null,
]);

$lexer->analyze('10 + 20 = 0')); // ['t_number', 't_add', 't_number', 't_equal', 't_number',]
```

References
----------

[](#references)

- Lexer :

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity67

Established project with proven stability

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 ~20 days

Recently: every ~26 days

Total

16

Last Release

3535d ago

Major Versions

v0.1.1 → v3.0.0-beta32016-05-12

PHP version history (3 changes)v0.1.0PHP &gt;=5.6.0

v3.0.0-beta3PHP &gt;=7.0.0

v3.0.1PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b499bc2a487ec730542759876340fb439fe2474ea14f2105ca88f003717d495?d=identicon)[wan2land](/maintainers/wan2land)

---

Tags

lexercompilerwandulexyacc

### Embed Badge

![Health badge](/badges/wandu-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/wandu-compiler/health.svg)](https://phpackages.com/packages/wandu-compiler)
```

###  Alternatives

[doctrine/lexer

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

11.2k942.7M153](/packages/doctrine-lexer)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

804588.3k5](/packages/cerbero-json-parser)[creof/geo-parser

Parser for geography coordinate strings

624.6M15](/packages/creof-geo-parser)[nikic/phlexy

Lexing experiments in PHP

162599.0k14](/packages/nikic-phlexy)[creof/wkt-parser

Parser for well-known text (WKT) object strings

545.0M16](/packages/creof-wkt-parser)[tmilos/lexer

Lexical analyzer with individual token definition with regular expressions

211.9M2](/packages/tmilos-lexer)

PHPackages © 2026

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