PHPackages                             rasteiner/kel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rasteiner/kel-compiler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rasteiner/kel-compiler
======================

01PHP

Since Nov 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rasteiner/kel-compiler)[ Packagist](https://packagist.org/packages/rasteiner/kel-compiler)[ RSS](/packages/rasteiner-kel-compiler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

This parser only generates an AST for "Kirby Expression Language", which is used by Kirby's "calculated" field plugin to live evaluate expressions in the panel.

Usage example
-------------

[](#usage-example)

The following example will evaluate the expression `1 + 2` and print the JSON encoded AST.

```
use rasteiner\KEL\Compiler;

$parser = new Compiler();
$ast = $parser->parse('1+2');

echo json_encode($ast);
```

Contribute
----------

[](#contribute)

### AST Classes

[](#ast-classes)

If you change the list of AST classes, you need to update the composer autoloader by running the following command:

```
composer dumpautoload -o
```

### Generate Parser Code

[](#generate-parser-code)

You need to have antlr4 installed. The command to generate the parser code from the root directory is:

```
antlr4 -o src/KEL/generated -package "rasteiner\KEL\generated" -visitor -no-listener -Xexact-output-dir src/grammar/KEL.g4
```

### Run Tests

[](#run-tests)

```
./vendor/bin/phpunit tests
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb276f3a4ac550e7656476be61f67ddfa6c6c743f58de07b87aad66245783a07?d=identicon)[rasteiner](/maintainers/rasteiner)

---

Top Contributors

[![rasteiner](https://avatars.githubusercontent.com/u/6684137?v=4)](https://github.com/rasteiner "rasteiner (2 commits)")

### Embed Badge

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

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

###  Alternatives

[razorpay/ifsc

Razorpay IFSC Codes Library

382201.9k](/packages/razorpay-ifsc)[dominus77/yii2-sweetalert2-widget

Renders a SweetAlert2 widget for Yii2.

2070.4k1](/packages/dominus77-yii2-sweetalert2-widget)[colinodell/indentation

Library to detect and manipulate indentation in strings and files

3911.5k5](/packages/colinodell-indentation)[jeffreyvanrossum/paver

Block based drag and drop editor for developers.

473.5k2](/packages/jeffreyvanrossum-paver)[phpcfdi/sat-catalogos

Catálogos de SAT para CFDI 3.3, CFDI 4.0 y Nómina 1.2

304.6k24](/packages/phpcfdi-sat-catalogos)[inspiredminds/contao-file-usage

Contao extension that allows you to search for references of files in the database assisted file manager.

1212.7k10](/packages/inspiredminds-contao-file-usage)

PHPackages © 2026

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