C++ to D converter based on clang

Loïc HAMOT via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sat May 28 04:02:37 PDT 2016


Hello,

I am working on a C++ to D converter.
The project is opensource, on github : 
https://github.com/lhamot/CPP2D

Clang is used to parse the C++ code and get the abstract syntax 
tree. Then I can visit the AST to print it to D language.
Some tricks are used to convert the simplest macros to mixin.

Some C++ features which are not straightforward to convert are 
already handled, like (A not exhaustive list):
     class
         constructor/destructor
         virtual
         abstract
         override
         initialization list
         call base constructor
     Operator overloading
         member
         free
             left or right
     Template
         function
         function specialization
         class
         class/struct specialization
         class/struct partial specialization
     arrays
         static
         dynamic

Some examples here : 
https://github.com/lhamot/CPP2D/wiki/Conversion-samples

If somebody is interested to use this software, or to 
participate, do not hesitate to contact me.

Regards


More information about the Digitalmars-d-announce mailing list