PHPackages                             webapper/parzrkit - 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. webapper/parzrkit

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

webapper/parzrkit
=================

ParzRKit

1.0.0-a(10y ago)08CC-4.0PHPPHP &gt;=5.3.0

Since Apr 24Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Webapper/ParzRKit)[ Packagist](https://packagist.org/packages/webapper/parzrkit)[ Docs](https://github.com/Webapper/ParzRKit)[ RSS](/packages/webapper-parzrkit/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

ParzRKit
========

[](#parzrkit)

ParzRKit is an abstract parser library written in PHP for future purposes

This is a part of a light-weight framework, Prometheus: (language only in hungarian, sorry)

[![Creative Commons License](https://camo.githubusercontent.com/d1a392e365cf029e2205bab9b7182c337e94efaddd1d0ad315617843d71cd9cc/687474703a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792f342e302f38387833312e706e67)](http://creativecommons.org/licenses/by/4.0/)
ParzRKit by [Assarte D'Raven](http://webapper.vallalatiszolgaltatasok.hu/#!/prometheus) is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

How you help me
---------------

[](#how-you-help-me)

Feel free to use my lib, I hope that you may enjoy that and may help you on your better efficiency. Well, you should donate me some credits via PayPal if my help counts for you on your work:

[![PayPal - The safer, easier way to pay online!](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5KQ66J5DF97RA)...or give me some positive feedback on my e-mail adress (you can see that in my profile).

Thanks anyway!

How it works
------------

[](#how-it-works)

It's a quite easy way to use this lib basically:

1. Create a Lexer class which extends ParzRKit's Lexer, and create its Node classes
2. Create Linker class(es) which are extends ParzRKit's Linker - keep in mind that your Linker classes must fits your needs of your Node classes!
3. Nearly just Parser-&gt;parse()-&gt;compile()-&gt;link(); I said: *nearly*

This is a working example of usage:

```
use ParzRKit\Parser\Lexer\AbstractToken;
use ParzRKit\Parser\Lexer;
use ParzRKit\Linker;
use ParzRKit\Parser;
use ParzRKit\Compiler;
use ParzRKit\Parser\Lexer\DataStreamToken;

define('SRC', realpath(dirname(dirname(__FILE__))).'/src/vendor/assarte/parzrkit/lib/');

require SRC.'Parser/Lexer/AbstractToken.php';
require SRC.'Parser/Lexer/ComposedToken.php';
require SRC.'Parser/Lexer/DataStreamToken.php';
require SRC.'Parser/ReturnToParentException.php';
require SRC.'Parser/Lexer.php';
require SRC.'Parser.php';
require SRC.'Linker.php';
require SRC.'Compiler/CompileException.php';
require SRC.'Compiler/Exception/NotAllowedException.php';
require SRC.'Compiler/Exception/NotMetException.php';
require SRC.'Compiler/BasicNode.php';
require SRC.'Compiler/StrictNode.php';
require SRC.'Compiler/RecursiveNodeIterator.php';
require SRC.'Compiler.php';

class TestToken extends DataStreamToken
{
	public function isDataStream()
	{
		return false;
	}

	public function identifyOpenTag()
	{
		if ($this->stream{0} == '/') {
			$this->openTag = '/';
		}
	}
}

class TestSubToken extends AbstractToken
{
	public function identifyOpenTag()
	{
		if ($this->stream{0} == '[') {
			$this->openTag = '[';
		}
	}

	public function identifyCloseTag($inStream=null)
	{
		$pos = $this->getCursor();
		if ($inStream !== null) {
			$pos = 0;
		} else {
			$inStream = $this->processed;
		}

		if ($inStream{$pos} == ']') {
			$this->closeTag = ']';
			return true;
		}

		return false;
	}

	public function guessCloseTag()
	{
		return ']';
	}
}

class TestLexer extends Lexer
{
	protected function registerTokeners()
	{
		$this->addTokener('TestToken');
		$this->addTokener('TestSubToken');
	}
}

class TestLinker extends Linker
{
	public function link()
	{
		$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($this));
		foreach ($it as $link) {
			echo str_repeat('| ', $it->getDepth() - 1).'|-'.json_encode($link).'';
		}
	}
}

$stream = '[876/t687][aa[bb[dd]]cc]';
$parser = new Parser($stream, TestLexer::getLexer());
$parser->parse();
$compiler = new Compiler(new TestLinker(), $parser->getToken()->getNode());
$compiler->compile();
echo $stream.'';
$compiler->getLinker()->link();
```

The example above will print:

```
[876/t687][aa[bb[dd]]cc]
|-"[876\/t687]"
| |-"876"
| |-"\/t687"
|-"[aa[bb[dd]]cc]"
| |-"aa"
| |-"[bb[dd]]"
| | |-"bb"
| | |-"[dd]"
| |-"cc"

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3677d ago

### Community

Maintainers

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

---

Top Contributors

[![assarte](https://avatars.githubusercontent.com/u/5679362?v=4)](https://github.com/assarte "assarte (12 commits)")

---

Tags

phpparser

### Embed Badge

![Health badge](/badges/webapper-parzrkit/health.svg)

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

###  Alternatives

[doctrine/lexer

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

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

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23483.5k2](/packages/corveda-php-sandbox)[romanpitak/nginx-config-processor

Nginx configuration files processor.

7235.3k1](/packages/romanpitak-nginx-config-processor)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[leonelquinteros/php-toml

PHP parser for TOML language ( https://github.com/toml-lang/toml )

266.7k](/packages/leonelquinteros-php-toml)

PHPackages © 2026

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