Commit | Line | Data |
---|---|---|
970ed795 | 1 | <!-- |
3abe9331 | 2 | Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
3 | |
4 | All rights reserved. This program and the accompanying materials | |
5 | are made available under the terms of the Eclipse Public License v1.0 | |
6 | which accompanies this distribution, and is available at | |
7 | http://www.eclipse.org/legal/epl-v10.html | |
8 | --> | |
9 | <html> | |
10 | <head> | |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
12 | <meta http-equiv="Content-Language" content="en-us"> | |
13 | <title>import</title> | |
14 | </head> | |
15 | <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> | |
16 | <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> | |
17 | <tr> | |
18 | <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td> | |
19 | </tr> | |
20 | </table> | |
21 | <table border="0" align="right" cellpadding="0" cellspacing="0"> | |
22 | <tr> | |
23 | <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> | |
24 | <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> | |
25 | <td><a href="ifpresent.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> | |
26 | <td><a href="in.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> | |
27 | </tr> | |
28 | </table> | |
29 | <p><br clear="all"> | |
30 | </p> | |
31 | <hr> | |
32 | <h1>import</h1> | |
33 | <hr align="left" width="75%"> | |
34 | <p>The statement makes it possible to <a href="#selective"> reuse all</a> or <a href="#selective">some of the definitions</a> specified in the module definitions part of a different module.</p> | |
35 | <ul> | |
36 | <li><a name="stop_all">The</a> keyword <a href="objid.html"><b><font face="Courier New" color="#003258" size="4">objid</font></b></a> is optionally used when the source <a href="#timer_start">module | |
37 | has an object identifier</a>.</li> | |
38 | <li><a name="stop_all">The</a> keyword <a href="language.html"><b><font face="Courier New" color="#003258" size="4">language</font></b></a> is used when importing <a href="#default">from a | |
39 | non-TTCN-3 module</a>.</li> | |
40 | <li><a name="stop_all">The</a> keyword <a href="except.html"><b><font face="Courier New" color="#003258" size="4">except</font></b></a> is used when there is a need <a href="#default">to | |
41 | exclude some of the definitions</a> from the import.</li> | |
42 | <li> | |
43 | <p>The keyword <a href="recursive.html"><font face="Courier New" size="4"><b>recursive</b></font> </a> means that every definition required by the specified definitions must also be imported. It | |
44 | can only be used with selective import.</p> | |
45 | </li> | |
46 | </ul> | |
47 | <p>Related keywords:</p> | |
48 | <ul> | |
49 | <li><a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a></li> | |
50 | <li><a href="except.html"><b><font face="Courier New" color="#003258" size="4">except</font></b></a></li> | |
51 | <li><a href="from.html"><b><font face="Courier New" color="#003258" size="4">from</font></b></a></li> | |
52 | <li><a href="language.html"><b><font face="Courier New" color="#003258" size="4">language</font></b></a></li> | |
53 | <li><a href="language.html"><b><font face="Courier New" color="#003258" size="4">objid</font></b></a></li> | |
54 | </ul> | |
55 | <hr align="left" width="50%"> | |
56 | <p>1. <a name="timer">Importing everything from a module</a></p> | |
57 | <div align="center"> | |
58 | <center> | |
59 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
60 | <tr> | |
61 | <td width="100%"> | |
62 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>import from </b></font><i>module_identifier</i> [<font face="Courier New" color="#003258" size="5"><b>.objid(</b></font><i>object_identifier</i><font | |
63 | face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>language "</b></font><i>language_identifier</i><font face="Courier New" | |
64 | color="#003258" size="5"><b>"</b></font> ] <font face="Courier New" color="#003258" size="5"><b>all;</b></font></h3> | |
65 | </td> | |
66 | </tr> | |
67 | </table> | |
68 | </center> | |
69 | </div> | |
70 | <ul> | |
71 | <li> | |
72 | <p><font face="Courier New" size="4"><b>import from</b></font> is a keyword of two parts, they together introduce the import definition.</p> | |
73 | </li> | |
74 | <li> | |
75 | <p><i>module_identifier</i> is the name used to refer to the module where the definitions are imported from. It must begin with a letter, may contain letters, numbers and underscore | |
76 | characters.</p> | |
77 | </li> | |
78 | </ul> | |
79 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
80 | <tr> | |
81 | <td width="100%"> | |
82 | <blockquote> | |
83 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
84 | </blockquote> | |
85 | <ul> | |
86 | <li> | |
87 | <p> <font face="Courier New" size="4"><b>objid(</b></font><i>object_identifier</i><font face="Courier New" size="4"><b>)</b></font> is not implemented. When encountered in the TTCN-3 | |
88 | program, it will be discarded without evaluation.</p> | |
89 | </li> | |
90 | </ul> | |
91 | </td> | |
92 | </tr> | |
93 | </table> | |
94 | <ul> | |
95 | <li> | |
96 | <p><font face="Courier New" size="4"><b>language</b></font><font face="Courier New" color="#003258" size="5"><b>"</b></font><i>language_identifier</i><font face="Courier New" | |
97 | color="#003258" size="5"><b>"</b></font> is used when definitions are imported from sources other than TTCN-3 modules to denote the language (=<i>language_identifier</i>) of that source.</p> | |
98 | </li> | |
99 | <li> | |
100 | <p><font face="Courier New" size="4"><b>all</b></font> means that every definition must be imported from the source.</p> | |
101 | </li> | |
102 | </ul> | |
103 | <hr align="left" width="50%"> | |
104 | <p><a name="timer_start">Example 1a</a>: | |
105 | <p><font face="Courier New">import from Ce_mod all;<br> | |
106 | </font> | |
107 | <p>All definitions from the module Ce_mod will be imported.</p> | |
108 | <hr align="left" width="50%"> | |
109 | <p><a name="timer_start">Example 1b</a>: | |
110 | <p><font face="Courier New">import from Ia_mod.objid{0 4 0 127 5 0} all;<br> | |
111 | </font> | |
112 | <p>All definitions will be imported from the module Ia_mod with the object identifier 0.4.0.127.5.0 in the module name.</p> | |
113 | <hr align="left" width="50%"> | |
114 | <p><a name="default">Example 1c:</a> | |
115 | <p><font face="Courier New">import from Muj_mod language "ASN.1:2002" all;<br> | |
116 | </font> | |
117 | <p>All definitions from the module Muj_mod written in the 2002 version of ASN.1 will be imported.</p> | |
118 | <hr align="left" width="75%"> | |
119 | <p>2. <a name="selective">Selective import</a></p> | |
120 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
121 | <tr> | |
122 | <td width="100%"> | |
123 | <blockquote> | |
124 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
125 | </blockquote> | |
126 | <p> Selective import is not implemented. When encountered in the TTCN-3 program, it will be treated as a statement for importing all definitions.</p> | |
127 | </td> | |
128 | </tr> | |
129 | </table> | |
130 | <p> </p> | |
131 | <div align="center"> | |
132 | <center> | |
133 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
134 | <tr> | |
135 | <td width="100%"> | |
136 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>import from </b></font><i>module_identifier</i> [<font face="Courier New" color="#003258" size="5"><b>.objid(</b></font><i>object_identifier</i><font | |
137 | face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>language "</b></font><i>language_identifier</i><font face="Courier New" | |
138 | color="#003258" size="5"><b>"</b></font> ] <font face="Courier New" color="#003258" size="5"><b>all except {</b></font><i>exception_list</i><font face="Courier New" color="#003258" size="5"><b>};</b></font> | |
139 | </h3> | |
140 | </td> | |
141 | </tr> | |
142 | </table> | |
143 | </center> | |
144 | </div> | |
145 | <ul> | |
146 | <li> | |
147 | <p><font face="Courier New" size="4"><b>import from</b></font> is a keyword of two parts, they together introduce the import definition.</p> | |
148 | </li> | |
149 | <li> | |
150 | <p><i>module_identifier</i> is the name used to refer to the module where the definitions are imported from. It must begin with a letter, may contain letters, numbers and underscore | |
151 | characters.</p> | |
152 | </li> | |
153 | </ul> | |
154 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
155 | <tr> | |
156 | <td width="100%"> | |
157 | <blockquote> | |
158 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
159 | </blockquote> | |
160 | <ul> | |
161 | <li> | |
162 | <p> <font face="Courier New" size="4"><b>objid(</b></font><i>object_identifier</i><font face="Courier New" size="4"><b>)</b></font> is not implemented. When encountered in the TTCN-3 | |
163 | program, it will be discarded without evaluation.</p> | |
164 | </li> | |
165 | </ul> | |
166 | </td> | |
167 | </tr> | |
168 | </table> | |
169 | <ul> | |
170 | <li> | |
171 | <p><font face="Courier New" size="4"><b>language</b></font><font face="Courier New" color="#003258" size="5"><b> "</b></font><i>language_identifier</i><font face="Courier New" | |
172 | color="#003258" size="5"><b>"</b></font> is used when definitions are imported from sources other than TTCN-3 modules to denote the language (=<i>language_identifier</i>) of that source.</p> | |
173 | </li> | |
174 | <li> | |
175 | <p><font face="Courier New" size="4"><b>all</b></font> means that every definition must be imported from the source.</p> | |
176 | </li> | |
177 | <li><font face="Courier New" size="4"><b>except</b></font><font face="Courier New" color="#003258" size="5"><b> {</b></font><i>exception_list</i><font face="Courier New" color="#003258" | |
178 | size="5"><b>}</b></font> is used to exclude some of the definitions of the source module. <br> | |
179 | <i>exception_list</i> may contain one of the following definitions: modulepar | const | type | signature | template | function | altstep | testcase | group. <br> | |
180 | It is possible to list several restrictions of the same type separated by comma and enumerate several types of restrictions separated by semicolon..</li> | |
181 | </ul> | |
182 | <hr align="left" width="50%"> | |
183 | <p><a name="except">Example 2a:</a> | |
184 | <p><font face="Courier New">import from Min_mod all except {testcase tc_one, tc_deux; function f_tre()};<br> | |
185 | </font> | |
186 | <p>All definitions from the module Min_mod will be imported except the test cases tc_one and tc_deux as well as the function f_tre().</p> | |
187 | <hr align="left" width="50%" color="#0094D2"> | |
188 | <div align="center"> | |
189 | <center> | |
190 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
191 | <tr> | |
192 | <td width="100%"> | |
193 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>import from </b></font><i>module_identifier</i> [<font face="Courier New" color="#003258" size="5"><b>.objid(</b></font><i>object_identifier</i><font | |
194 | face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>language "</b></font><i>language_identifier</i><font face="Courier New" | |
195 | color="#003258" size="5"><b>"</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>recursive</b></font> ]<font face="Courier New" color="#003258" size="5"><b> | |
196 | {</b></font><i>importation_list</i><font face="Courier New" color="#003258" size="5"><b>};</b></font></h3> | |
197 | </td> | |
198 | </tr> | |
199 | </table> | |
200 | </center> | |
201 | </div> | |
202 | <ul> | |
203 | <li> | |
204 | <p><font face="Courier New" size="4"><b>import from</b></font> is a keyword of two parts, they together introduce the import definition.</p> | |
205 | </li> | |
206 | <li> | |
207 | <p><i>module_identifier</i> is the name used to refer to the module where the definitions are imported from. It must begin with a letter, may contain letters, numbers and underscore | |
208 | characters.</p> | |
209 | </li> | |
210 | </ul> | |
211 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
212 | <tr> | |
213 | <td width="100%"> | |
214 | <blockquote> | |
215 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
216 | </blockquote> | |
217 | <ul> | |
218 | <li> | |
219 | <p> <font face="Courier New" size="4"><b>objid(</b></font><i>object_identifier</i><font face="Courier New" size="4"><b>)</b></font> is not implemented. When encountered in the TTCN-3 | |
220 | program, it will be discarded without evaluation.</p> | |
221 | </li> | |
222 | </ul> | |
223 | </td> | |
224 | </tr> | |
225 | </table> | |
226 | <ul> | |
227 | <li> | |
228 | <p><font face="Courier New" size="4"><b>language</b></font><font face="Courier New" color="#003258" size="5"><b> "</b></font><i>language_identifier</i><font face="Courier New" | |
229 | color="#003258" size="5"><b>"</b></font> is used when definitions are imported from sources other than TTCN-3 modules to denote the language (=<i>language_identifier</i>) of that source.</p> | |
230 | </li> | |
231 | <li> | |
232 | <p><font face="Courier New" size="4"><b>recursive</b></font> means that every definition required by the specified definitions must also be imported.</p> | |
233 | </li> | |
234 | <li><i>importation_list</i> is used to enumerate the definitions of the source module to be imported. <br> | |
235 | It may contain one of the following definitions: modulepar | const | type | signature | template | function | altstep | testcase | group. <br> | |
236 | It is possible to list several definitions of the same type separated by comma and enumerate several types of definitions separated by semicolon..</li> | |
237 | </ul> | |
238 | <hr align="left" width="50%"> | |
239 | <p><a name="list">Example 2b:</a> | |
240 | <p><font face="Courier New">import from Mon_Mod {const c_derde, c_fjaerde; var v_cinquieme; template all};</font> | |
241 | <p>The constants c_derde and c_fjaerde as well as the variable v_cinquieme together with all templates will be imported from the module Mon_mod.</p> | |
242 | <hr align="left" width="50%"> | |
243 | <p><a name="recursive">Example 2c:</a> | |
244 | <p><font face="Courier New">import from Mon_Mod recursive {const c_hetedik};</font> | |
245 | <p>The constant c_hetedik will be imported from the module Mon_mod along with the definitions required by c_hetedik.</p> | |
246 | <hr align="left" width="75%"> | |
247 | <p>3. <a name="timer">Importing of import statements</a></p> | |
248 | <div align="center"> | |
249 | <center> | |
250 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
251 | <tr> | |
252 | <td width="100%"> | |
253 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>import from </b></font><i>module_identifier</i> [<font face="Courier New" color="#003258" size="5"><b>.objid(</b></font><i>object_identifier</i><font | |
254 | face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>language "</b></font><i>language_identifier</i><font face="Courier New" | |
255 | color="#003258" size="5"><b>"</b></font> ] <font face="Courier New" color="#003258" size="5"><b>{ import all; }</b></font></h3> | |
256 | </td> | |
257 | </tr> | |
258 | </table> | |
259 | </center> | |
260 | </div> | |
261 | <ul> | |
262 | <li> | |
263 | <p><font face="Courier New" size="4"><b>import from</b></font> is a keyword of two parts, they together introduce the import definition.</p> | |
264 | </li> | |
265 | <li> | |
266 | <p><i>module_identifier</i> is the name used to refer to the module where the definitions are imported from. It must begin with a letter, may contain letters, numbers and underscore | |
267 | characters.</p> | |
268 | </li> | |
269 | </ul> | |
270 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
271 | <tr> | |
272 | <td width="100%"> | |
273 | <blockquote> | |
274 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
275 | </blockquote> | |
276 | <ul> | |
277 | <li> | |
278 | <p> <font face="Courier New" size="4"><b>objid(</b></font><i>object_identifier</i><font face="Courier New" size="4"><b>)</b></font> is not implemented. When encountered in the TTCN-3 | |
279 | program, it will be discarded without evaluation.</p> | |
280 | </li> | |
281 | </ul> | |
282 | </td> | |
283 | </tr> | |
284 | </table> | |
285 | <ul> | |
286 | <li> | |
287 | <p><font face="Courier New" size="4"><b>language</b></font><font face="Courier New" color="#003258" size="5"><b>"</b></font><i>language_identifier</i><font face="Courier New" | |
288 | color="#003258" size="5"><b>"</b></font> is used when definitions are imported from sources other than TTCN-3 modules to denote the language (=<i>language_identifier</i>) of that source.</p> | |
289 | </li> | |
290 | <li> | |
291 | <p><font face="Courier New" size="4"><b>import all</b></font> means that every visible<a href="#visible"><sup>*</sup></a> import statement must be imported from the source.</p> | |
292 | </li> | |
293 | </ul> | |
294 | <hr align="left" width="50%"> | |
295 | <p><a name="timer_start">Example 1a</a>: | |
296 | <p><font face="Courier New">import from G_mod { import all };<br> | |
297 | </font> | |
298 | <p>All visible import statements from the module G_mod will be imported. | |
299 | This has the same effect as if the visible import statements of module G_mod were copied into the importing module.</p> | |
300 | <hr align="left" width="75%"> | |
301 | <a name="visible">Note that the visibility of import statements is by default <a href="private.html">private</a>. | |
302 | For an import statement to be visible, it must be made <a href="public.html">public</a>, or the importing module | |
303 | has to be declared as <a href="friend.html">friend</a> of the module containing the import statement.</a> | |
304 | <p><a HREF="BNF.html#importdef">BNF definition</a> of <font face="Courier New">import</font></p> | |
305 | </body> | |
306 | </html> |