3

Mozilla.org で Javascript Lexer に関する 2 つの Python Javascript トークナイザーと不可解なドキュメントを見てきましたが、特に PHP 用の Javascript トークナイザーは見つかりませんでした。いずれかがあります?

ありがとう

4

4 に答える 4

2

Check out Javascript for PHP5
http://j4p5.sourceforge.net/
(It's an older project, but IIRC had a pretty complete tokenizer.)

于 2010-08-26T00:49:06.687 に答える
2

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.

于 2010-08-26T00:49:29.900 に答える
2

jTokenizer / jParser . jTokenizer は、PHP トークナイザーを模倣します。jParser は、走査および操作が可能な解析ツリーを生成します。

于 2016-03-16T08:25:41.580 に答える
2

JSMin+は、JSTokenizer を含む PHP での javascript minify 実装です。

Mozilla のNarcissusを出発点として使用しました。

于 2011-10-09T08:52:02.987 に答える