最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a Javascript lexertokenizer (in PHP)? - Stack Overflow

programmeradmin7浏览0评论

I've seen a couple of Python Javascript tokenizers and a cryptic document on Mozilla 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 about a Javascript Lexer but can't find any Javascript tokenizers for PHP specifically. Are there any?

Thanks

Share Improve this question asked Aug 26, 2010 at 0:39 TomTom 1,0452 gold badges14 silver badges23 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 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 es 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 e with a full Javascript tokenizer that you can maybe tap into. This looks the most interesting.

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

JSMin+ a javascript minify implementation in PHP which includes a JSTokenizer.

It used Narcissus from Mozilla as a starting point.

jTokenizer / jParser. jTokenizer mimics the PHP tokenizer. jParser generates a parse tree, which can be traversed and manipulated.

发布评论

评论列表(0)

  1. 暂无评论