I wouldn't know where to start but I'd be more than happy to help in implementing a JavaScript parser to generate AST's from source code.