[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Separate compilation

The GNU CHILL compiler supports modular programming. It allows the user to control the visibility of variables and modes, outside of a MODULE, by the use of GRANT and SEIZE directives. Any location or mode may be made visible to another MODULE by GRANTing it in the MODULE where it is defined, and SEIZEing it in another MODULE which needs to refer to it.

When variables are GRANTed in one or more modules of a CHILL source file, the compiler outputs a grant file, with the original source file name as the base name, and the extension `.grt'. All of the variables and modes defined in the source file are written to the grant file, together with any use_seize_file directives, and the GRANT directives. A grant file is created for every such source file, except if an identical grant file already exists. This prevents unnecessary makefile activity.

The referencing source file must:

  1. specify the grant file in a use_seize_file directive, and
  2. SEIZE each variable or mode definition that it needs.

An attempt to SEIZE a variable or mode which is not GRANTed in some seize file is an error.

An attempt to refer to a variable which is defined in some seize file, but not explicitly granted, is an error.

An attempt to GRANT a variable or mode which is not defined in the current MODULE is an error.

Note that the GNU CHILL compiler will *not* write out a grant file if:

Otherwise, a grant file is an automatic, unsuppressable result of a successful CHILL compilation.

A future release will also support using remote spec modules in a similar (but more Blue Book-conforming) manner.

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by GCC Administrator on March, 17 2001 using texi2html