项目作者: loophp

项目描述 :
Generates Abstrax Syntax Tree (AST) of a PHP script in DOT (Graphviz) or Image (PNG, JPG, SVG) formats.
高级语言: PHP
项目地址: git://github.com/loophp/phptree-ast-generator.git
创建时间: 2020-03-02T19:49:11Z
项目社区:https://github.com/loophp/phptree-ast-generator

开源协议:MIT License

下载


Latest Stable Version
GitHub stars
Total Downloads
GitHub Workflow Status
Scrutinizer code quality
Code Coverage
Mutation testing badge
License
Donate!

PHPTree AST Generator

Description

An AST generator based on loophp/phptree.

Demo

Requirements

Installation

composer require loophp/phptree-ast-generator

Usage

Very basic usage

```shell script
./path/to/bin/ast generate /path/to/php/file.php

  1. To generate the `dot` script for Graphviz
  2. ```shell script
  3. ./path/to/bin/ast generate src/Command/Generator.php

Use the -c option to generate a fancy export, user-friendly and less verbose.

```shell script
./path/to/bin/ast generate -c src/Command/Generator.php

  1. To generate an image
  2. ```shell script
  3. ./path/to/bin/ast generate -c -t image -f png -d graph.png src/Command/Generator.php

The generator supports 3 PHP parsers:

Use the -p option to change it, default is nikic.

```shell script
./path/to/bin/ast generate -p microsoft -t image -d graph.svg src/Command/Generator.php

  1. You will find more documentation within the help of the command:
  2. ```shell script
  3. ./path/to/bin/ast generate -h

Contributing

Feel free to contribute to this library by sending Github pull requests. I’m quite reactive :-)