JavaScript parser in Python

John J. Lee jjl at pobox.com
Thu Jun 5 02:45:25 CEST 2003


> > > On Wed, 2003-06-04 at 02:32, Carl Waldbieser wrote:
> > >
> > >>Does anyone know of a Python module that can parse a JavaScript source file?
[...]

I don't know of one, and I did look quite carefully a while back
(though for an interpreter, not a parser).

The Mozilla project has two implementations -- one in C
(SpiderMonkey), one in Java (called Rhino).  Presumably they export a
parser interface of some sort.  You could use Jython or JPE to get at
Rhino, or SWIG, boost python, ctypes, or whatever to get at the C
version.

Let us know if you do it.


John




More information about the Python-list mailing list