4 ms·
It seems like you could have saved yourself quite a bit of parsing/lexing work if you had used the parser that ships with PHP: http://us3.php.net/manual/en/fun
by icheishvili 15y ago
It seems like you could have saved yourself quite a bit of parsing/lexing work if you had used the parser that ships with PHP:
http://us3.php.net/manual/en/function.token-get-all.php http://us3.php.net/manual/en/function.token-get-all.php
http://us3.php.net/manual/en/function.token-name.php http://us3.php.net/manual/en/function.token-name.php
Very cool nonetheless.
- mfonda 15y agoThey are very different things. token_get_all just tokenizes the code, but this tool parses PHP code into an AST. If you look at the source of this project, you'll notice that it does indeed use token_get_all to handle the lexing.
- icheishvili 15y agoI just went and read Lexer.php to see what you mean. Never mind on my previous comment :) Well done with the project--I have a use case for it regarding enforcing PHP style guide @ $work.