CODETRANSFORMER


Welcome | Company profile | Products | Freware | Private

CodeTransformer

'CodeTransformer' is an application for parsing, manipulating and generating OMG IDL and 'C++' files. If you are implementing CORBA objects in 'C++' or even just writing plain 'C++' code, 'CodeTransformer' can save you a lot of trivial typing. The application is written in SML'97 and is available under the GPL licence (not LGPL), both as sourcecode and as a binary distribution for 'Linux/x86'. I reserve the right to change the licence in future versions of the software.

Very small tutorial

If you need to implement an 'IDL' interface as a 'CORBA' object in 'C++' you can do the trivial typing work with 'CodeTransformer' like this:

<start CodeTransformer>
loadIDL myfile.idl
mapToCPP
saveCPP myfile

You should now have the files 'myfile.hh' and 'myfile.cpp' (fileextensions may vary depending on your configuration). Since 'CodeTransformer' can not do a complete language mapping from 'IDL' to 'C++' you might have to alter a few things in the 'C++' headerfile. When you have done this you can generate a new matching 'C++' Implementation file with 'CodeTransformer' like this:

loadCPPHeader myfile.hh
saveCPPImpl myfile.cpp

In 'CodeTransformer' the command 'display' is always handy to display how 'CodeTransformer' interprets the data it has read, so it's a good idea to use this command frequently.

Another use for 'CodeTransformer' is if you're implementing plain 'C++' classes. One typical way to do it is like this:

<start CodeTransformer>
newClassFile myClass myNewFile
saveCPPHeader myNewFile.hh
quit
<edit the file myNewFile.hh by adding the methods you want>
<start CodeTransformer>
loadCPPHeader myNewFile.hh
saveCPPImpl myfile.cpp

I hope you get the idea about how the software can be used...

Downloading

You can download the following distributions:

They are all packed with tar and gzip, so to unpack you do something like

gzip -d 
tar -xvf 

Installing

To install a binary version, you need to add the location of the CodeTransformer/bin/ct file in the distribution to your path. You must also have a configurationfile called 'CodeTransformer.config' in the directory where you start 'CodeTransformer' or supply the filename and path for a configurationfile as an arguement when you start 'CodeTransformer'. This is described more in detail in the documentation in the distribution in the CodeTransformer/docs/ directory.

Compiling

To compile the source code you will need an SML'97-compiler with ML-Lex and ML-yacc. I am currently using Standard ML of New Jersey and there are compilationmanager (sources.cm) files included in the source code distribution.

To compile it with SML/NJ, frist start up SML/NJ in the CodeTransformer/srcSML/ directory with the command sml-cm, then execute CM.make() in the SML/NJ system. To create a binary file you can use the function SMLofNJ.exportFn and the program heap2exec which are all part of the SML/NJ system.

I have compiled the Win32 binaries with MLWorks2.0 but the project files are not included in this release.


- ÁNOQ of the Sun


Modified: 1999-04-17
E-mail:anoq@HardcoreProcessing.com