1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
26
<title>Using the IC Compiler</title>
29
<date>2002-08-02</date>
34
<title>Introduction</title>
35
<p>The IC application is an IDL compiler implemented in Erlang.
36
The IDL compiler generates client stubs and server skeletons.
37
Several back-ends are supported, and they fall into three main
39
<p>The first group consists of a CORBA back-end:</p>
41
<tag>IDL to Erlang CORBA</tag>
43
<p>This back-end is for CORBA communication and implementation,
44
and the generated code uses the CORBA specific protocol for
45
communication between clients and servers. See the
46
<em>Orber</em> application User's Guide and manuals for
50
<p>The second group consists of a simple Erlang back-end:</p>
52
<tag>IDL to plain Erlang</tag>
54
<p>This back-end provides a very simple Erlang client
55
interface. It can only be used within an Erlang node,
56
and the communication between client and "server" is
57
therefore in terms of ordinary function calls. </p>
58
<p>This back-end can be considered a short-circuit version of
59
the IDL to Erlang gen_server back-end (see further below).</p>
62
<p>The third group consists of backends for Erlang, C, and
63
Java. The communication between clients and servers is by the
64
Erlang distribution protocol, facilitated by
65
<em>erl_interface</em> and <em>jinterface</em> for C and Java,
67
<p>All back-ends of the third group generate code compatible with
68
the Erlang gen_server behavior protocol. Thus generated client
69
code corresponds to <c>call()</c> or <c>cast()</c> of an Erlang
70
<c>gen_server</c>. Similarly, generated server code corresponds
71
to <c>handle_call()</c> or <c>handle_cast()</c> of an Erlang
72
<c>gen_server</c>.</p>
73
<p>The back-ends of the third group are:
76
<tag>IDL to Erlang gen_server</tag>
78
<p>Client stubs and server skeletons are generated. Data types
79
are mapped according to the IDL to Erlang mapping described
80
in the <em>Orber User's Guide</em>.</p>
83
<tag>IDL to C client</tag>
85
<p>Client stubs are generated. The mapping of data types is
86
described further on in the C client part of this guide.</p>
88
<tag>IDL to C server</tag>
90
<p>Server skeletons are generated. The mapping of data types is
91
described further on in the C server part of this guide.</p>
93
<tag>IDL to Java</tag>
95
<p>Client stubs and server skeletons are generated. The mapping
96
of data types is described further on in the Java part of
103
<title>Compilation of IDL Files</title>
104
<p>The IC compiler is invoked by executing the generic <c>erlc</c>
105
compiler from a shell:</p>
107
%> erlc +'{be,BackEnd}' File.idl
109
<p>where <c>BackEnd</c> is according to the table below, and
110
<c>File.idl</c> is the IDL file to be compiled.</p>
113
<cell align="left" valign="middle"><em>Back-end</em></cell>
114
<cell align="left" valign="middle"><c>BackEnd</c>option</cell>
117
<cell align="left" valign="middle">IDL to CORBA</cell>
118
<cell align="left" valign="middle"><c>erl_corba</c></cell>
121
<cell align="left" valign="middle">IDL to CORBA template</cell>
122
<cell align="left" valign="middle"><c>erl_template</c></cell>
125
<cell align="left" valign="middle">IDL to plain Erlang</cell>
126
<cell align="left" valign="middle"><c>erl_plain</c></cell>
129
<cell align="left" valign="middle">IDL to Erlang gen_server</cell>
130
<cell align="left" valign="middle"><c>erl_genserv</c></cell>
133
<cell align="left" valign="middle">IDL to C client</cell>
134
<cell align="left" valign="middle"><c>c_client</c></cell>
137
<cell align="left" valign="middle">IDL to C server</cell>
138
<cell align="left" valign="middle"><c>c_server</c></cell>
141
<cell align="left" valign="middle">IDL to Java</cell>
142
<cell align="left" valign="middle"><c>java</c></cell>
144
<tcaption>Compiler back-ends and options</tcaption>
146
<p>For more details on IC compiler options consult the ic(3) manual page.</p>