views:

66

answers:

1

Dear All:

I am looking for a robust Javascript parser written in Java - by which I mean a Javascript parser that is able to handle most real world Javascript.

I am only interested in parsing Javascript, not in executing it.

I have found Rhino: http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/1eff23a8ee57b991

Am I missing anything? Is this the best solution?

Thank you! Misha

+4  A: 

That's probably the best Java one. As you probably know, it's developed by Mozilla (though it's not used by their browsers), and it's also bundled by Sun.

Matthew Flaschen
In other words, it's built-in in Java's standard library, see the package `javax.script`.
Jesper
Thank you. Unfortunately JDK 6 is out for me, as Mac support for this platform seems to be ... not quite there :(
Misha Koshelev
@Misha, you don't have to use JDK 6. The [download](ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip) includes js-14.jar, which supports as early as 1.4.
Matthew Flaschen
Thank you. I meant I can't use javax.script as that is part of JDK 6. Thank you!
Misha Koshelev