lisachenko / z-engine

:zap: PHP Engine Direct API
MIT License
448 stars 22 forks source link

[Feature] Provide userland AST parsing API #25

Closed lisachenko closed 4 years ago

lisachenko commented 4 years ago

PHP7 uses an abstract syntax tree during compilation of source code which can be used for future transformation and code analysis. Need to add implementation of general node types, as well, simple parse method that will invoke internal methods zendparse() to access AST.

Later, integration with zend_ast_process can be added to provide a general userland hook implementation as was suggested in the RFC: Parser Extension API.