<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 26, 2009, at 3:44 PM, Jim Baker wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Perhaps consider&nbsp;Antlr? We've had good success with this for Jython, and it's now also used by NetBeans support for Python in general. I took a look at&nbsp;<a href="http://www.antlr.org/grammar/list" target="_blank">http://www.antlr.org/grammar/list</a>, and there are a number of options for JS. Most importantly, Antlr supports the parser chain in Python, so it's possible this could be more readily converted to RPython.</blockquote><div><br></div>Yep this could be done, if so I would use this grammar file&nbsp;<a href="http://research.xebic.com/es3/">http://research.xebic.com/es3/</a> and then put the code for JS 1.5+ in it as we start supporting those features.<br><div><br></div><br><blockquote type="cite"><div>Some potential issues:<br>Chris Lambrou has a parser for EcmaScript 3.0. But there's no license here, so you'd definitely have to contact him on this. Like standalone grammars in general, it's rather unlikely to have been extensively tested. With Jython we started with a reference parser that Terrence Parr had made, and taking CPython as reference here as to what the AST should be, over time we targeted that by explicitly comparing ASTS. Some time later, including incremental parse support and various syntax errors, we're pretty confident that it's basically done.<br></div></blockquote></div><div><br></div><div>The thing that would be great is if pypy and jython would use the same parser using antlr so the work to support python 3.0 (and 2.7, 2.8, etc) could be partially shared :)</div><br><div apple-content-edited="true"> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Leonardo Santagada</div><div>santagada at gmail.com</div><div><br></div></div><br class="Apple-interchange-newline"> </div><br></body></html>