From: Aaron Patterson Date: 2008-12-31T03:54:54+09:00 Subject: Re: [ANN] racc 1.4.6 release On Wed, Dec 31, 2008 at 03:24:36AM +0900, Phlip wrote: >>>> racc 1.4.6 has been released! >>> YAY!! > > Can it lex JavaScript? I'm glad you asked! Of course it can! For parsing JavaScript, I present to you two solutions. One is pure ruby and kind of slow, and the other one is C and super fast! RKelly is a pure ruby javascript parser that uses racc: http://github.com/tenderlove/rkelly/tree/master I haven't released a gem yet, but I could be persuaded to since I'm not really doing much with it lately. RKelly will give you an AST of your javascript. Your second option is Johnson. It uses Spidermonkey, is really fast, and can return a JavaScript AST: http://github.com/jbarnette/johnson/tree/master I haven't documented the parser too much, so take a look at parser_test.rb for examples. Hope that helps -- Aaron Patterson http://tenderlovemaking.com/