Usage

The IDL-to-Pascal compiler is integrated into the Delphi IDE via a Wizard (File | New | Other). It is also a separate utility program that can be run from the command line. The compiler is written in Java and requires a JDK (Java Development Kit) or JRE (Java Runtime Environment) in order to run. A suitable JRE is supplied as part of Delphi 6.

The compiler is distributed as a JAR file (idl2pas.jar) which contains all of the required java classes. A batch file is also provided (idl2pas.bat) and can be used to run the the compiler as described below.

The Run time Library is supplied as a Windows DLL file. This provides a Delphi interface to the VisiBroker C++ ORB DLL which allows Delphi to use the standard VisiBroker ORB as if it were a native Delphi ORB.

Compiling IDL files from the Command Line

To use the idl2pas compiler on the command line, type the following:

idl2pas [options] [filename.idl ...]
This will run the idl2pas.bat batch file which will in turn launch the Java virtual machine which loads the idl2pas.jar file and launches the compiler. The compiler processes the specified IDL file(s) and outputs one or more generated pascal files.

The compiler generates a pascal 'I' file, a pascal 'C' file, a pascal 'S' file, and a pascal 'Impl' for each IDL module it encounters. The generated files are named for the modules from which they originate. (e.g. IDL module MyMod would result in generated files MyMod_i.pas, MyMod_c.pas, MyMod_s.pas, and MyMod_Impl.pas). If no module is specified the compiler creates files named for the IDL file. (eg; IDL file test.idl would result in generated files test_i.pas, test_c.pas, test_s.pas and test_Impl.pas if it did not contain a module.) Nested modules are placed in separate files with concatenated file names.

Under certain circumstances the compiler may generate empty pascal units. These units are redundant. By default the compiler does not write files for empty units. Use the -[no_]write_empty_units compiler option to control this behavior.

The 'I' file contains the interface information and the 'C' file contains the client side stub code. The 'S' file contains the skeleton code and the 'Impl' file is a template that you fill in for your server's implementation code.

The examples show how to make console and GUI client DPR files that uses these generated files. More details concerning the mapping of IDL to Pascal can be found in chapter two of the VisiBroker for Delphi manual.

When compiling very large IDL files you may encounter Java heap overflow errors. These can be avoided by increasing the size of the heap allocated by the Java Virtual Machine by modifying the line in the idl2pas.bat file to include the -mx option;

jre -mx40000000 com.inprise.vbroker.compiler.tools.idl2pas %1 ... %9
This option sets the heap size to the specified number of bytes. Note: If you are using VisiBroker 4, you have to have JDK 1.2.2 or higher. The command line would use "java" instead of "jre".

Obtaining the version number

If you want to display the version number for the IDL2PAS compiler, type:

idl2pas -version

Other command line switches

The compiler will print a list of switches if launched with no parameters. Most are supported but the "Driver Options" should be ignored. Supported for these is pending incorporation of the compiler into the IDE.

More details on the use of the compiler and runtime can be found in chapter one of the VisiBroker for Delphi manual.