[phc-general] how to dump an AST?

Tim Fletcher twoggle at gmail.com
Fri Aug 1 17:34:54 IST 2008


> Sadly, I haven't had the change to update the documentation in quite a
> while. Sorry about that.

No problem. Just a bit confusing when "--dump-php" didn't work!


> So it depends on what you're trying to do. If you want to do source
> analysis at a high level, use the AST. If you'd like to keep the
> program as close to the original state as possible (say for
> refactoring), use the AST. If you'd like to do deeper analysis on PHP,
> use the HIR or the MIR, depending on your preference.

Thanks, that makes sense. I tried "ast" as it was the obvious choice,
but wanted to check if it was the correct one.


> What are you trying to do?

Static analysis, but not in C++ :)


More information about the phc-general mailing list