Language workbench written in python3

Ramchandra Apte maniandram01 at gmail.com
Sat Sep 8 11:09:59 EDT 2012


On Friday, 7 September 2012 01:18:45 UTC+5:30, Nestor Arocha  wrote:
> On Thursday, September 6, 2012 2:53:15 PM UTC+1, Ramchandra Apte wrote:
> 
> > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel  wrote:
> 
> > 
> 
> > > On 09/06/2012 09:34 AM, Ramchandra Apte wrote:
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > Translator means what precisely?
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > Examples of translators include compilers, assemblers, and
> 
> > 
> 
> > > 
> 
> > 
> 
> > > interpreters.  They also include implementations like cfront, which
> 
> > 
> 
> > > 
> 
> > 
> 
> > > translates from one high-level language to another lower-level
> 
> > 
> 
> > > 
> 
> > 
> 
> > > language.  (high and low being relative)
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > -- 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > DaveA
> 
> > 
> 
> > 
> 
> > 
> 
> > Is conversion from Python to C++ possible from this project?
> 
> 
> 
> No, it is not currently possible for several reasons: 
> 
>    * current parser implementation is a recursive descent parser. I haven't implemented an LR parser yet, although PLY lexers and parsers are supported.
> 
>    * Syntax Directed Translator is not fully implemented either.
> 
>    * Parser Trees are supported, but there is no clear method defined for converting them into ASTs (like antlr grammars)
> 
>    * Even with AST and SDT support, a Python to C++ translator will require more complex tools and a lot of coding.
> 
> 
> 
> This tool is oriented to small DSLs parsing and translation; grammars like Python or C++ are too complex for the current implementation

I was thinking I could use it for my Python to C/C++ converter - py2c @ code.google.com/p/py2c (py2c would love a developer so join and contribute)



More information about the Python-list mailing list