Previous Table of Contents Next


3.6 Import Declaration

   The grammar for the import statement is described by the following BNF:

   (100) <import> ::= “import? <imported_scope> “;?

   (101) <imported_scope> ::= <scoped_name> | <string_literal>

   The <imported_scope> non-terminal may be either a fully-qualified scoped name denoting an IDL name scope, or a string containing the interface repository ID of an IDL name scope, i.e., a definition object in the repository whose interface derives from CORBA::Container.

   The definition of import obviates the need to define the meaning of IDL constructs in terms of “file scopes?. This specification defines the concepts of a specification as a unit of IDL expression. In the abstract, a specification consists of a finite sequence of ISO Latin-1 characters that form a legal IDL sentence. The physical representation of the specification is of no consequence to the definition of IDL, though it is generally associated with a file in practice.

   Any scoped name that begins with the scope token ( “::? ) is resolved relative to the global scope of the specification in which it is defined. In isolation, the scope token represents the scope of the specification in which it occurs.

   A specification that imports name scopes must be interpreted in the context of a well-defined set of IDL specifications whose union constitutes the space from within which name scopes are imported. By “a well-defined set of IDL specifications,? we mean any identifiable representation of IDL specifications, such as an interface repository. The specific representation from which name scopes are imported is not specified, nor is the means by which importing is implemented, nor is the means by which a particular set of IDL specifications (such as an interface repository) is associated with the context in which the importing specification is to be interpreted.

   The effects of an import statement are as follows: