I've seen a couple of Python Javascript tokenizers and a cryptic document on Mozilla.org about a Javascript Lexer but can't find any Javascript tokenizers for PHP specifically. Are there any?
Thanks
I've seen a couple of Python Javascript tokenizers and a cryptic document on Mozilla.org about a Javascript Lexer but can't find any Javascript tokenizers for PHP specifically. Are there any?
Thanks
Check out Javascript for PHP5
http://j4p5.sourceforge.net/
(It's an older project, but IIRC had a pretty complete tokenizer.)
I have no experience with either, so I can't tell you anything about what they do and in what detail they tokenize code into, but I can see two:
JSLint is an executable but comes with a PHP interface - probably not enough for you, as it probably doesn't publish the raw tokenization to the calling program
PHPSniffer claims to come with a full Javascript tokenizer that you can maybe tap into. This looks the most interesting.