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