Imports
A
module may
import
any number of modules via
import_declarations. An
import_declaration, given in module
X,
specifies a name of a module
Y
prefixed with the name of the
package
in which the module
Y was defined. The
terms,
types, and
shaders of
Y
are then accessible in
X by qualifying
their names with
Y. As an example:
Because two modules defined in different packages can have the
same names, it is possible for imports to collide:
If a X imports both
modules com.example_0.Y and
com.example_1.Y, then
the name Y will be introduced twice.
An import_declaration may therefore provide
an optional name to disambiguate imported modules:
If a module X
imports a module
Y as Z,
the
terms, types, and
shaders of Y
are then accessible in
X by qualifying
their names with Z.
The imported names of modules are not
visible outside of the module in which they are imported. For example, if
a module X imports a module
Y, and Y
imports a module Z, the module
Z is
not
visible as
Y.Z.
Syntax
The precise syntax of module declarations is given by the following
EBNF: