PDA

View Full Version : BabelCode: a .NET translator



Legolas
06-10-2006, 06:33 PM
If you are in stuck converting C# or VB .NET code to Delphi .NET, Borl... aehm Inpr... *ouch!* DevCo (:?:) has made a tool that translates it automatically:

http://dotnet.borland.com/babelcode/

It's released as a web service and seems that it works very well :)

This (http://bdn.borland.com/article/0,1410,32338,00.html) article explains how to use that web service in your applications :wink:

savage
06-10-2006, 07:24 PM
What they need to add is a C/C++ to Pascal capability, that would speed up the FreeSpace and other conversions :).

WILL
06-10-2006, 11:55 PM
I remember a 'Dr. Dobbs' project that was made some time ago that tried to create a 'do-it-all' C to Pascal converter. I cannot recall if it was C to 'Turbo' Pascal or C to Object Pascal though...

Either way, it had it's flaws of course.

But if you think about it... wouldn't it make sense that a C/C++ to ObjectPascal converter was entirely possible. You can take both languages and turn them into Assembly... and even ones that turn Assembly into Pascal or C... the difference here though is that you have all the proper variable names instead of having to use nonsensical symbols.

Eh... just a thought.


But yeah, cool tool! :thumbup:

savage
07-10-2006, 07:32 AM
I remember a 'Dr. Dobbs' project

Could you be referring to Dr. Bob :)

WILL
07-10-2006, 09:02 PM
Thats it! Dr. Bob. :P

cairnswm
09-10-2006, 05:44 AM
One of my pet projects at the moment is LCD (Lowest Common Denominator) Game Code a cross language Translator. http://thegamedeveloper.co.za/?cat=1

Surprisingly there is very little information on Langauge-to-Language translators out there.

Basically a Language-To-Language translator has to first compile to an intermediate code level and then from that into the final language. To achieve this a certtain amount of interpretation of the language is needed. Obviously making the translator understand the full language is a lot harder than making it understand a significant subset.

(LCD will predefine the sub set, and use customized libraries in the final languages to achieve multiple language/maultiple platform compatability)

JernejL
09-10-2006, 07:22 AM
My idea of a pascal compiler is, to either convert it proceduraly, such as with a tokenizer and a syntax pre"compiler" (which would check for people doing c/c++ tricks and fix such stuff with proper code), and convert the code as it sees it, it would just read it, each procedure by procedure and definition by definition in precompiling part, then create a pascal unit, properly handling defines, processing procedure declarations and comments.

That would work best for C, for c++ it would get a little more sophisticated.

Ofcourse, one could as well take GCC and create a "pascal cpu" port for it ;)

marcov
20-11-2006, 08:12 PM
I remember a 'Dr. Dobbs' project

Could you be referring to Dr. Bob :)

No. That was afaik only a header conversion tool (like FPC's h2pas), something that later evolved to Jedi Darth iirc.

Dodi (Hans Peter Mocken*) is also working on a real converter:

http://members.aol.com/vbdis/

However I think fully automated conversion will never be possible, mostly due to the fact that a lot of symbols are only defined completely by their first use.