Paul Houle wrote:
Note that there is a PHP tokenizer built into PHP which makes it
straightforward to develop tools like this in PHP:
http://php.net/manual/en/book.tokenizer.php
A practical example can be found here
http://gen5.info/q/2009/01/09/an-awesome-autoloader-for-php
Now, it would be nice to have a parser available that can see the
tree structure.
The tokenizer is slow. It's not worth taking it out for this.