Hi.
On Mon, Sep 16, 2013 at 02:47:10PM -0700, Ivan P. wrote:
> Yes, I know, but this is what I'm asking about - does anyone could get it
> out from the deep inside of v8 and make use of it?
I might be doing something related that involves me having to inspect
the AST.
> In other worlds, what needs to be done to instantiate v8's parser object,
> run parsing and achieve AST? Any examples of the code?
What I just did was to hook into MakeCode of compiler.cc.
I put my own AST traversal class in this chain, somewhere before GenerateCode:
return Rewriter::Rewrite(info) && Scope::Analyze(info) && GenerateCode(info);
As there doesn't seem to be a generic AST traversal class, I just copied the
prettyprinter and replaced the printing logic with my own.
HTH,
Tobi