JavaScript parser in Python
Frantisek Fuka
fuka at fuxoft.cz
Wed Jun 4 02:45:42 EDT 2003
Ian Bicking wrote:
> 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 am intersted in checking the file to see if it is syntactically correct,
>>as well as possibly stripping out whitespace and comments. I found a couple
>>JavaScript compression utilities after doing a Google search, but many of
>>them are themselves written in JavaScript, execute in a browser, and tend to
>>be somewhat slow for very large JavaScript files. A pythonic solution has a
>>certain appeal to me because I have always found Python very easy an
>>intuitive to use in the past. Thanks in advance.
>
>
> Well, I think that Javascript has tokens that pretty much match
> Python's, except for whitespace. That at least would make compression
> fairly easy, though a more general parser would be able to do more.
And what about Python script that could disassemble the compiled Java
file into the primitive "Java-assembler" instructions? (i.e. not Java
source)
More information about the Python-list
mailing list