[pypy-dev] Parsing in PyPy (and runicode)

Leonardo Santagada santagada at gmail.com
Thu Feb 26 20:55:11 CET 2009

On Feb 26, 2009, at 3:44 PM, Jim Baker wrote:

> Perhaps consider 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 http://www.antlr.org/grammar/list, 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.

Yep this could be done, if so I would use this grammar file http://research.xebic.com/es3/ 
  and then put the code for JS 1.5+ in it as we start supporting those  

> Some potential issues:
> 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.

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 :)

Leonardo Santagada
santagada at gmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20090226/34e15d27/attachment.html>

More information about the Pypy-dev mailing list