Reputation: 95
I need to obtain the AST of a JS code from C++. I know that Spidermonkey's (unlike V8's generated) ASTs follow a standard that I could use.
Can I pass it a code (string or JS file) from a C++ program and get the AST? If so how?
Upvotes: 1
Views: 812
Reputation: 447
I just answered a similar question here. The short version is:
JS_InitReflect
with your global to instantiate the Reflect
object in the global scope (documentation)Upvotes: 2