views:

357

answers:

2

I can see that there are tools for converting .h to Python, Perl, D, Pascal etc. Are there any for VB6 or any other VB-alike tool (like Jabaco for instance)?

A: 

If you have enough time you can write the one by yourself using TXL transformation language.

But of course the question rises is it worth to put a time to learn new tools against doing that manually or some other way.

msorc
Yes, I've heard about TXL. Pretty steep learning curve, however. Thanks.
boost
If the volume for work is large enough we can discuss the possible ways to make the converter
msorc
+1  A: 

As other answers have observed, you can use a program transformation engine to automate the generation of such headers from C source code.

However, what you really need is a program transformation engine that already understands C, because parsing C and knowing what the types are is a very difficult task. (Ask the GNU compiler guys, or just look at GCC's source code). Pure transformation systems (e.g., those that don't have C front ends) will serve you poorly, as you'll have to generate all that symbol table data yourself.

The DMS Software Reengineering Toolkit is a full-featured program transformation, that has a a full featured C front end, including preprocessor, AST construction, symbol table building, control and data flow analysis, points-to analysis, call graph construction, ... All of these results can be used in the transformation process to make your job easier.

Like other program transformation systems, there is a steep learning curve. However, you need to compare that to the cost of a) not having an answer and doing all that translation by hand, repeatedly, and b) the cost of constructing your own C front end, and c) it significantly raises the probability that you will actually get a result that works. From that point of view, IMHO it is dirt cheap.

Ira Baxter