node.js - Turn JavaScript code into an AST? -
i write function in node.js receives function parameter, , returns function ast. e.g.:
var fn = function (x) { return x > 23; }; var ast = generateastfrom(fn); console.log(ast); // => abstract syntax tree representing // expression "return x > 23"
now wonder whether possible @ all. main problem have absolutely no idea or how begin.
any hints?
ps: know can .js
files using projects such esprima, function in memory. maybe i'm missing right kick-off point here?
Comments
Post a Comment