~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/ic/doc/src/ch_introduction.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
 
3
 
 
4
<chapter>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1998</year>
 
8
      <year>2008</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
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/.
 
17
 
 
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
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>Using the IC Compiler</title>
 
27
    <prepared></prepared>
 
28
    <docno></docno>
 
29
    <date>2002-08-02</date>
 
30
    <rev>PB1</rev>
 
31
  </header>
 
32
 
 
33
  <section>
 
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
 
38
      groups.</p>
 
39
    <p>The first group consists of a CORBA back-end:</p>
 
40
    <taglist>
 
41
      <tag>IDL to Erlang CORBA</tag>
 
42
      <item>
 
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
 
47
          further details.</p>
 
48
      </item>
 
49
    </taglist>
 
50
    <p>The second group consists of a simple Erlang back-end:</p>
 
51
    <taglist>
 
52
      <tag>IDL to plain Erlang</tag>
 
53
      <item>
 
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>
 
60
      </item>
 
61
    </taglist>
 
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,
 
66
      respectively.</p>
 
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:
 
74
      </p>
 
75
    <taglist>
 
76
      <tag>IDL to Erlang gen_server</tag>
 
77
      <item>
 
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>
 
81
        <p></p>
 
82
      </item>
 
83
      <tag>IDL to C client</tag>
 
84
      <item>
 
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>
 
87
      </item>
 
88
      <tag>IDL to C server</tag>
 
89
      <item>
 
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>
 
92
      </item>
 
93
      <tag>IDL to Java</tag>
 
94
      <item>
 
95
        <p>Client stubs and server skeletons are generated. The mapping
 
96
          of data types is described further on in the Java part of
 
97
          this guide.</p>
 
98
      </item>
 
99
    </taglist>
 
100
  </section>
 
101
 
 
102
  <section>
 
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>
 
106
    <code type="none">
 
107
%> erlc +'{be,BackEnd}' File.idl
 
108
    </code>
 
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>
 
111
    <table>
 
112
      <row>
 
113
        <cell align="left" valign="middle"><em>Back-end</em></cell>
 
114
        <cell align="left" valign="middle"><c>BackEnd</c>option</cell>
 
115
      </row>
 
116
      <row>
 
117
        <cell align="left" valign="middle">IDL to CORBA</cell>
 
118
        <cell align="left" valign="middle"><c>erl_corba</c></cell>
 
119
      </row>
 
120
      <row>
 
121
        <cell align="left" valign="middle">IDL to CORBA template</cell>
 
122
        <cell align="left" valign="middle"><c>erl_template</c></cell>
 
123
      </row>
 
124
      <row>
 
125
        <cell align="left" valign="middle">IDL to plain Erlang</cell>
 
126
        <cell align="left" valign="middle"><c>erl_plain</c></cell>
 
127
      </row>
 
128
      <row>
 
129
        <cell align="left" valign="middle">IDL to Erlang gen_server</cell>
 
130
        <cell align="left" valign="middle"><c>erl_genserv</c></cell>
 
131
      </row>
 
132
      <row>
 
133
        <cell align="left" valign="middle">IDL to C client</cell>
 
134
        <cell align="left" valign="middle"><c>c_client</c></cell>
 
135
      </row>
 
136
      <row>
 
137
        <cell align="left" valign="middle">IDL to C server</cell>
 
138
        <cell align="left" valign="middle"><c>c_server</c></cell>
 
139
      </row>
 
140
      <row>
 
141
        <cell align="left" valign="middle">IDL to Java</cell>
 
142
        <cell align="left" valign="middle"><c>java</c></cell>
 
143
      </row>
 
144
      <tcaption>Compiler back-ends and options</tcaption>
 
145
    </table>
 
146
    <p>For more details on IC compiler options consult the ic(3) manual page.</p>
 
147
  </section>
 
148
</chapter>
 
149