Language workbench written in python3

R

Ramchandra Apte

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?
 
N

Nestor Arocha

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
 
R

Ramchandra Apte

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top