www.digitalmars.com         C & C++   DMDScript  

D - .h to .d converter

reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Is anyone working on one yet?

I think it would be good if it could:

- do as much conversion as it can do mechanically, alerting the user to 
any need to intervene
- allow you to specify values/definednesses to be assumed for 
identifiers #if/#ifdef/#ifndef, or that they should be converted to 
version blocks (where this is possible)
- ...

For example, it would somewhat simplify the task of translating all the 
Windows API headers....

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the 
unfortunate victim of intensive mail-bombing at the moment.  Please keep 
replies on the 'group where everyone may benefit.
Apr 26 2004
parent J Anderson <REMOVEanderson badmama.com.au> writes:
Stewart Gordon wrote:

 Is anyone working on one yet?

 I think it would be good if it could:

 - do as much conversion as it can do mechanically, alerting the user 
 to any need to intervene
 - allow you to specify values/definednesses to be assumed for 
 identifiers #if/#ifdef/#ifndef, or that they should be converted to 
 version blocks (where this is possible)
 - ...

 For example, it would somewhat simplify the task of translating all 
 the Windows API headers....

 Stewart.

I was thinking off working on one in the future (distant future). I was thinking about making a kinda pluginable one, with a few different phases, that people could keep improving as they find thing it doesn't do. One phase could be a find->replace that probably could be setup by a script file (users could be easily encouraged to contribute here). Actually I think something like my glee.d port could be done completely without human intervention (and I don't want to spend hours doing it by hand next time). Using the pre-processing on the files caused many other unnessary bits a pieces. ie you don't want to import the entire openGL header file into an SDL project. I think the extra symbols could be worked out and placed in kinda private junk-files (ie opengljunk.d), in the short term. Manually, I was commenting out the #include files and seeing what symbol errors the D compiler brought up after conversion. Then I could put these missing symbols in the junk files. Of course you could recreate every file that is referenced. Anyway start of simple. Also eventual support for C++ should be considered. So if you start making one I wouldn't mind helping you in the distant (a few months) future. -- -Anderson: http://badmama.com.au/~anderson/
Apr 26 2004