javascriptabstract-syntax-tree

What is JavaScript AST, how to play with it?


Abstract Syntax Tree.. I always heard that compile to SpiderMonkey AST on Github.
So, is that a actual standard of JS syntax tree? And there's V8, is V8 using the same kind of AST?

How can I play with that?


Solution

  • SpiderMonkey offers the parser api. This is probably the easiest way to get your hands on the syntax objects.

    There's also open js-js parsers like Esprima (which is ECMAScript, really, but it's right up the alley)