TysonAndre / php-parser-to-php-ast

Abandoned. Supports only PHPParser 3. convert PHPParser\Node to \ast\Node. See https://github.com/TysonAndre/tolerant-php-parser-to-php-ast/ for better error tolerance.
MIT License
1 stars 2 forks source link
ast php php-ast php-parser

PHP-Parser to php-ast

Build Status Build status (Windows)

This converts ASTs(Abstract Syntax Trees) from PHP-Parser to php-ast. It can be used as a PHP-only implementation of php-ast. It can alternatively be used as a best-effort parser for syntactically valid PHP code.

Also see https://github.com/TysonAndre/tolerant-php-parser-to-php-ast (in progress, may have better results)

Supported php-ast AST versions: 40, 45, 50

Current Status

No tests are failing

Current Issues

Remaining work:

Usage

Using it as a slow substitute for php-ast

Using it as an error-tolerant substitute for php-ast: (e.g. for use in IDEs)

Running unit tests

To run unit tests, you must install nikic/php-ast. A version supporting AST versions 40 and/or 50 should be installed (~0.1.5 is preferred)

Possible Future Enhancements