19982013 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Using the IC Compiler 2002-08-02 PB1 ch_introduction.xml
Introduction

The IC application is an IDL compiler implemented in Erlang. The IDL compiler generates client stubs and server skeletons. Several back-ends are supported, and they fall into three main groups.

The first group consists of a CORBA back-end:

IDL to Erlang CORBA

This back-end is for CORBA communication and implementation, and the generated code uses the CORBA specific protocol for communication between clients and servers. See the Orber application User's Guide and manuals for further details.

The second group consists of a simple Erlang back-end:

IDL to plain Erlang

This back-end provides a very simple Erlang client interface. It can only be used within an Erlang node, and the communication between client and "server" is therefore in terms of ordinary function calls.

This back-end can be considered a short-circuit version of the IDL to Erlang gen_server back-end (see further below).

The third group consists of backends for Erlang, C, and Java. The communication between clients and servers is by the Erlang distribution protocol, facilitated by erl_interface and jinterface for C and Java, respectively.

All back-ends of the third group generate code compatible with the Erlang gen_server behavior protocol. Thus generated client code corresponds to call() or cast() of an Erlang gen_server. Similarly, generated server code corresponds to handle_call() or handle_cast() of an Erlang gen_server.

The back-ends of the third group are:

IDL to Erlang gen_server

Client stubs and server skeletons are generated. Data types are mapped according to the IDL to Erlang mapping described in the Orber User's Guide.

IDL to C client

Client stubs are generated. The mapping of data types is described further on in the C client part of this guide.

IDL to C server

Server skeletons are generated. The mapping of data types is described further on in the C server part of this guide.

IDL to Java

Client stubs and server skeletons are generated. The mapping of data types is described further on in the Java part of this guide.

Compilation of IDL Files

The IC compiler is invoked by executing the generic erlc compiler from a shell:

%> erlc +'{be,BackEnd}' File.idl

where BackEnd is according to the table below, and File.idl is the IDL file to be compiled.

Back-end BackEndoption IDL to CORBA erl_corba IDL to CORBA template erl_template IDL to plain Erlang erl_plain IDL to Erlang gen_server erl_genserv IDL to C client c_client IDL to C server c_server IDL to Java java Compiler back-ends and options

For more details on IC compiler options consult the ic(3) manual page.