Subj : Re: Need to walk the JavaScript parse tree To : Lyle Coder From : Brendan Eich Date : Mon May 12 2003 03:03 pm Lyle Coder wrote: >After a JavaScript section has been parsed, I need to walk the parse >tree and re-generate the JavaScript (create a new string that contains >the original program). The reason I do this is because I look for >certain key words and perform some operation on them > What kinds of operations? What keywords? >What is the best way to do this? > Can't tell without more info, see above. > I am current looking at the function >CompileTokenStream, which calls "Statements". The result is a >JSParseNode. I assume I can walk that some how and re-create the >original JS program? > > If you're reading the code, keep reading. But you shouldn't overlook the JS_FRIEND_API declaration of js_ParseTokenStream in jsparse.h. /be >Thanks >Lyle > > .