PHPackages                             jojo1981/json-ast-builder - 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. jojo1981/json-ast-builder

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

jojo1981/json-ast-builder
=========================

Json AST builder

2.0.0(8mo ago)36MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4CI passing

Since Oct 18Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/jojo1981/json-ast-builder)[ Packagist](https://packagist.org/packages/jojo1981/json-ast-builder)[ RSS](/packages/jojo1981-json-ast-builder/feed)WikiDiscussions main Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

JSON AST Builder for PHP
========================

[](#json-ast-builder-for-php)

[![Build Status](https://github.com/jojo1981/json-ast-builder/actions/workflows/build.yml/badge.svg)](https://github.com/jojo1981/json-ast-builder/actions/workflows/build.yml)[![Coverage Status](https://camo.githubusercontent.com/11b6582928b867cd50c21dba665f435602738d26b448f80450dabd2a606bd61f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6a6f6a6f313938312f6a736f6e2d6173742d6275696c6465722f62616467652e737667)](https://coveralls.io/github/jojo1981/json-ast-builder)[![Latest Stable Version](https://camo.githubusercontent.com/82001a17fb3e54f7cec1a326591ef416644b6818fc1dee3c40fe75eecc88bd10/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6a6f313938312f6a736f6e2d6173742d6275696c6465722f762f737461626c65)](https://packagist.org/packages/jojo1981/json-ast-builder)[![Total Downloads](https://camo.githubusercontent.com/aa6d225efa174deedc2498a10cb7b991d74e15494d82eb0598a53aef6ab0f95b/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6a6f313938312f6a736f6e2d6173742d6275696c6465722f646f776e6c6f616473)](https://packagist.org/packages/jojo1981/json-ast-builder)[![License](https://camo.githubusercontent.com/05d2f82e9d8bcc4541229c119ef9cb8c88d63035fe361a7a63d7f6b2fc3adc49/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6a6f313938312f6a736f6e2d6173742d6275696c6465722f6c6963656e7365)](https://packagist.org/packages/jojo1981/json-ast-builder)

Author: Joost Nijhuis &lt;&gt;

A PHP Implementation for building an AST (Abstract Syntax Tree) from a `JSON` string.
The AST is visitable and can be visited by implementing a visitor (Behavioral Design Pattern Visitor).

Purposes of this library are:

- Validate JSON syntax and give the end user a precise error message about syntax errors
- Transform an AST to a JSON string and control the format
- Travers AST by implementing your own visitor

More information about the lightweight data-interchange format JSON (JavaScript Object Notation) can be found [here](https://www.json.org/).

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

[](#installation)

### Library

[](#library)

```
git clone https://github.com/jojo1981/json-ast-builder.git
```

### Composer

[](#composer)

[Install PHP Composer](https://getcomposer.org/doc/00-intro.md)

```
composer require jojo1981/json-ast-builder
```

Usage
-----

[](#usage)

```
