HI Everyone,
I used the following code to get the ast tree for my test JavaScript
...
ScriptOrFnNode tree = parser.parse(reader, sourceURI, 1);

I output the tree by using "tree.toStringTree(tree)", it gives me a pretty
looking ast output.

Now, my question is "Is there any method that can output the tree to a
JavaScript file?"

The reason I have that question is because I would like to get the "tree"
and then do some changes on it(mount some new nodes on the tree). Next I
would like to output the tree to a JavaScript that involves my changes...

I know I could go thought the ast tree and output each node according to the
JavaScript specification, but I am wondering if Rhino has already
implemented this function and I can just use it?


Cheers
Peng
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to