Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: nikic / PHP-Parser AST compatibility #104

Open
oscarnevarezleal opened this issue Apr 5, 2020 · 3 comments
Open

Question: nikic / PHP-Parser AST compatibility #104

oscarnevarezleal opened this issue Apr 5, 2020 · 3 comments

Comments

@oscarnevarezleal
Copy link

Does the AST data structure generated by this project share similarity with its counterpart on the PHP language ( nikic/PHP-Parser ) ?

I'm trying to parse as a significant amount of files and z7zmey/php-parser would be a deal-breaker for its speed, the problem is that I have several features depending on nikic/PHP-Parser mainly because of its AST Builder.

If I could share the same AST interoperability would be perfect.

@sohaha
Copy link

sohaha commented Nov 2, 2020

Same needs, looking forward to follow-up support

@z7zmey
Copy link
Owner

z7zmey commented Feb 13, 2021

hi @oscarnevarezleal and @sohaha. At 0.8 I have changed the AST structure back to be as same as possible as nikic/php-parser

Do you have any idea how AST could be transferred from Golang to PHP?
I think about dumping to PHP deserializable string.

@oscarnevarezleal
Copy link
Author

Hey, @z7zmey I'll take a look at it this week.

Regarding your question, nikic/PHP-Parser contains some utilities to convert an AST into JSON and back, I'd dig into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants