aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ic/doc/src/ch_introduction.xml
blob: 9ac2f96a9523bb5547c5d9c21e0d0acc0fe8e41b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>1998</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      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.
    
    </legalnotice>

    <title>Using the IC Compiler</title>
    <prepared></prepared>
    <docno></docno>
    <date>2002-08-02</date>
    <rev>PB1</rev>
    <file>ch_introduction.xml</file>
  </header>

  <section>
    <title>Introduction</title>
    <p>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.</p>
    <p>The first group consists of a CORBA back-end:</p>
    <taglist>
      <tag>IDL to Erlang CORBA</tag>
      <item>
        <p>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
          <em>Orber</em> application User's Guide and manuals for
          further details.</p>
      </item>
    </taglist>
    <p>The second group consists of a simple Erlang back-end:</p>
    <taglist>
      <tag>IDL to plain Erlang</tag>
      <item>
        <p>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. </p>
        <p>This back-end can be considered a short-circuit version of
          the IDL to Erlang gen_server back-end (see further below).</p>
      </item>
    </taglist>
    <p>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
      <em>erl_interface</em> and <em>jinterface</em> for C and Java,
      respectively.</p>
    <p>All back-ends of the third group generate code compatible with
      the Erlang gen_server behavior protocol. Thus generated client
      code corresponds to <c>call()</c> or <c>cast()</c> of an Erlang
      <c>gen_server</c>. Similarly, generated server code corresponds
      to <c>handle_call()</c> or <c>handle_cast()</c> of an Erlang
      <c>gen_server</c>.</p>
    <p>The back-ends of the third group are:
      </p>
    <taglist>
      <tag>IDL to Erlang gen_server</tag>
      <item>
        <p>Client stubs and server skeletons are generated. Data types
          are mapped according to the IDL to Erlang mapping described
          in the <em>Orber User's Guide</em>.</p>
        <p></p>
      </item>
      <tag>IDL to C client</tag>
      <item>
        <p>Client stubs are generated. The mapping of data types is
          described further on in the C client part of this guide.</p>
      </item>
      <tag>IDL to C server</tag>
      <item>
        <p>Server skeletons are generated. The mapping of data types is
          described further on in the C server part of this guide.</p>
      </item>
      <tag>IDL to Java</tag>
      <item>
        <p>Client stubs and server skeletons are generated. The mapping
          of data types is described further on in the Java part of
          this guide.</p>
      </item>
    </taglist>
  </section>

  <section>
    <title>Compilation of IDL Files</title>
    <p>The IC compiler is invoked by executing the generic <c>erlc</c>
      compiler from a shell:</p>
    <code type="none">
%> erlc +'{be,BackEnd}' File.idl
    </code>
    <p>where <c>BackEnd</c> is according to the table below, and
      <c>File.idl</c> is the IDL file to be compiled.</p>
    <table>
      <row>
        <cell align="left" valign="middle"><em>Back-end</em></cell>
        <cell align="left" valign="middle"><c>BackEnd</c>option</cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to CORBA</cell>
        <cell align="left" valign="middle"><c>erl_corba</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to CORBA template</cell>
        <cell align="left" valign="middle"><c>erl_template</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to plain Erlang</cell>
        <cell align="left" valign="middle"><c>erl_plain</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to Erlang gen_server</cell>
        <cell align="left" valign="middle"><c>erl_genserv</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to C client</cell>
        <cell align="left" valign="middle"><c>c_client</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to C server</cell>
        <cell align="left" valign="middle"><c>c_server</c></cell>
      </row>
      <row>
        <cell align="left" valign="middle">IDL to Java</cell>
        <cell align="left" valign="middle"><c>java</c></cell>
      </row>
      <tcaption>Compiler back-ends and options</tcaption>
    </table>
    <p>For more details on IC compiler options consult the ic(3) manual page.</p>
  </section>
</chapter>