Titan



import


The statement makes it possible to reuse all or some of the definitions specified in the module definitions part of a different module.

Related keywords:


1. Importing everything from a module

import from module_identifier [.objid(object_identifier) ] [ language "language_identifier" ] all;

TITAN specific restriction compared to the standard:

  •  objid(object_identifier) is not implemented. When encountered in the TTCN-3 program, it will be discarded without evaluation.


Example 1a:

import from Ce_mod all;

All definitions from the module Ce_mod will be imported.


Example 1b:

import from Ia_mod.objid{0 4 0 127 5 0} all;

All definitions will be imported from the module Ia_mod with the object identifier 0.4.0.127.5.0 in the module name.


Example 1c:

import from Muj_mod language "ASN.1:2002" all;

All definitions from the module Muj_mod written in the 2002 version of ASN.1 will be imported.


2. Selective import

TITAN specific restriction compared to the standard:

 Selective import is not implemented. When encountered in the TTCN-3 program, it will be treated as a statement for importing all definitions.

 

import from module_identifier [.objid(object_identifier) ] [ language "language_identifier" ] all except {exception_list};

TITAN specific restriction compared to the standard:

  •  objid(object_identifier) is not implemented. When encountered in the TTCN-3 program, it will be discarded without evaluation.


Example 2a:

import from Min_mod all except {testcase tc_one, tc_deux; function f_tre()};

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().


import from module_identifier [.objid(object_identifier) ] [ language "language_identifier" ] [ recursive ] {importation_list};

TITAN specific restriction compared to the standard:

  •  objid(object_identifier) is not implemented. When encountered in the TTCN-3 program, it will be discarded without evaluation.


Example 2b:

import from Mon_Mod {const c_derde, c_fjaerde; var v_cinquieme; template all};

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.


Example 2c:

import from Mon_Mod recursive {const c_hetedik};

The constant c_hetedik will be imported from the module Mon_mod along with the definitions required by c_hetedik.


3. Importing of import statements

import from module_identifier [.objid(object_identifier) ] [ language "language_identifier" ] { import all; }

TITAN specific restriction compared to the standard:

  •  objid(object_identifier) is not implemented. When encountered in the TTCN-3 program, it will be discarded without evaluation.


Example 1a:

import from G_mod { import all };

All visible import statements from the module G_mod will be imported. This has the same effect as if the visible import statements of module G_mod were copied into the importing module.


Note that the visibility of import statements is by default private. For an import statement to be visible, it must be made public, or the importing module has to be declared as friend of the module containing the import statement.

BNF definition of import