Please feel free to use our Python parser, it's licensed under the original BSD license from Terrence Parr. https://jython.svn.sourceforge.net/svnroot/jython/trunk/jython/grammar/
I don't know where the 3.0 work is currently located, in any event it's something we have put on hold for the moment as we get the 2.5 release out. I cc-ed in Frank to ensure he is in the loop here. In terms of the parser itself: there's a modest amount of Java code in the actions, but that should be easy to convert. Supporting RPython generation in Antlr then makes even more sense in this case: as I understand it, Antlr uses TP's other project, StringTemplate, to simplify the construction of multiple backends. - Jim On Thu, Feb 26, 2009 at 12:55 PM, Leonardo Santagada <[email protected]>wrote: > > 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 features. > > > 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 > > > > -- Jim Baker [email protected]
_______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
