NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

6.2 Import directives

Import directives import the names of entities into a source file, allowing the names to be referenced without qualification. All import directives must appear after any option directives but before any type declarations. The compilation environment may also define implicit import directives.

Import directives make names available in a source file, but do not declare anything in the global namespace's declaration space. The scope of the names imported by an import directive extends over the source file. The scope of an import directive specifically does not include other import directives, nor does it include other source files. Import directives may not refer to one another.

It is important to note that the namespace or type names that appear in import directives must always be fully qualified. That is, the leftmost identifier in a namespace or type name is always resolved in the global namespace and then resolution proceeds according to normal name resolution rules. This is the only place in the language where such a rule applies and it ensures that there is no way to make a name completely hidden from qualification. If this rule did not exist, once a name in the global namespace was hidden in a particular source file, it would be impossible to specify any names from that namespace in a qualified way.

ImportsDirective ::= Imports ImportsClauses LineTerminator
ImportsClauses ::=
 ImportsClause |
 ImportsClauses
, ImportsClause
ImportsClause ::= ImportsAliasClause | ImportsNamespaceClause