I'm thinking of making a Python-JavaScript converter/compile. I've been wondering about the pros and cons of the following methods to parse the Pythonic code, into JavaScript equivalent.
- Working with the output of
ast.dump(ast.parse(code))
- Working with tokens.
I've been trying weigh the pros and cons of these methods, but well I'm unable to think of any major one, as I've never used them..
So, Basically could someone help me by telling me what the pros and cons of the two methods I've mentioned above are?
Also, if there is something better that I can use for this purpose, notify me about it..
PS: I'll be using Python to write the converter..