óÀ½, ÀÌÀü, ´ÙÀ½, ¸¶Áö¸· Àý·Î °¡±â, ¸ñÂ÷.
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:
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.
¿ø¹®½ÃÀÛ
Separate compilation
¿ø¹®³¡
GNU CHILL ÄÄÆÄÀÏ·¯´Â ¸ðµâ ÇÁ·Î±×·¡¹ÖÀ» Áö¿øÇÑ´Ù. ±×°ÍÀº »ç¿ëÀÚ°¡ GRANT¿Í SEIZE Áö½Ã¹®À» »ç¿ëÇؼ ¾î¶² MODULE ¹ÛÀÇ º¯¼ö¿Í ¸ðµåÀÇ ½Ã°è(ãÊÍ£;visibility)¸¦ Á¶Á¤ÇÒ ¼ö ÀÖµµ·Ï ÇØÁØ´Ù. ¾î¶² À§Ä¡³ª ¸ðµå´Â ±×°ÍÀÌ Á¤ÀǵǾîÀÖ´Â MODULE³»¿¡¼ ¾çµµ(GRANT)ÇÔÀ¸·Î½á, ±×¸®°í ±×°ÍÀ» ÂüÁ¶ÇÒ ÇÊ¿ä°¡ ÀÖ´Â ´Ù¸¥ MODULE¾ÈÀ¸·Î Æ÷ȹ(SEIZE)µÊÀ¸·Î½á ´Ù¸¥ MODULE¿¡°Ô °¡½ÃÈ µÉÁöµµ ¸ð¸¥´Ù.
º¯¼ö°¡ ¾î¶² CHILL ¿ø½Ã ÆÄÀÏÀÇ Çϳª ¶Ç´Â ±× ÀÌ»óÀÇ ¸ðµâ·Î ¾çµµ(GRANT)µÉ ¶§, ÄÄÆÄÀÏ·¯´Â ±âº»ÆÄÀϸíÀ¸·Î ¿ø·¡ÀÇ ¿ø½Ã ÆÄÀϸí°ú È®ÀåÀÚ '.grt'¸¦ °¡Áö´Â grant ÆÄÀÏÀ» Ãâ·ÂÇÑ´Ù. ¿ø½Ã ÆÄÀÏ¿¡ Á¤ÀÇµÈ ¸ðµç º¯¼ö¿Í ¸ðµå´Â ¾î¶² use_seize_file Áö½Ã¹®°ú GRANT Áö½Ã¹®°ú ÇÔ²² grant ÆÄÀÏ·Î ÀÛ¼ºµÈ´Ù. grant ÆÄÀÏÀº ±×·¯ÇÑ ¿ø½Ã ÆÄÀϸ¶´Ù »ý¼ºµÈ´Ù. ±×·¯³ª µ¿ÀÏÇÑ grant ÆÄÀÏÀÌ Á¸ÀçÇÏ´Â °æ¿ì¿¡´Â Á¦¿ÜµÈ´Ù. ÀÌ°ÍÀº ºÒÇÊ¿äÇÑ makefile µ¿ÀÛÀ» ¸·´Â´Ù.
ÂüÁ¶ÇÏ´Â ¿ø½Ã ÆÄÀÏÀº ²À ¾Æ·¡¿Í °°¾Æ¾ß ÇÑ´Ù:
¸î¸î Æ÷ȹ ÆÄÀϳ»¿¡ ¾çµµ(GRANT)µÇÁö ¾ÊÀº ¾î¶² º¯¼ö³ª ¸ðµå¸¦ Æ÷ȹ(SEIZE)ÇÏ·Á°í ÇÏ´Â °ÍÀº ¿À·ù´Ù.
¸î¸î Æ÷ȹ ÆÄÀϳ»¿¡ Á¤ÀǵǾî ÀÖÀ¸³ª ¸íÈ®È÷ ¾çµµµÇÁö ¾ÊÀº ¾î¶² º¯¼ö¸¦ ÂüÁ¶ÇÏ·Á°í ÇÏ´Â °ÍÀº ¿À·ù´Ù.
ÇöÀç MODULE¿¡ Á¤ÀǵÇÁö ¾ÊÀº º¯¼ö³ª ¸ðµå¸¦ ¾çµµ(GRANT)ÇÏ·Á°í ÇÏ´Â °ÍÀº ¿À·ù´Ù.
¸¸¾à ´ÙÀ½°ú °°Àº °æ¿ì¿¡´Â GNU CHILL ÄÄÆÄÀÏ·¯°¡ grant ÆÄÀÏÀ» ÀÛ¼ºÇÏÁö ¾ÊÀ» °ÍÀÓÀ» ÁÖÁöÇ϶ó:
¸¸¾à ±×·¸Áö ¾ÊÀ¸¸é, grant ÆÄÀÏÀº ¼º°øÀûÀÎ CHILL ÄÄÆÄÀÏÀÇ ÀÚµ¿ÀûÀÌ¸ç ¿ÏÀüÇÑ °á°úÀÌ´Ù.
Â÷ÈÄÀÇ ¸±¸®Áî(release)´Â ¶ÇÇÑ À¯»çÇÑ(but more Blue Book-conforming) ¹æ¹ýÀ¸·Î ¿ø°Ý ÁöÁ¤ ¸ðµâ(remote spec module)À» ÀÌ¿ëÇÏ´Â °ÍÀ» Áö¿øÇÒ °ÍÀÌ´Ù.