GNU Chill

William Cox, Per Bothner, Wilfried Moser


Table of Contents


1 Compiler options

Invoking the compiler:

The GNU CHILL compiler supports several new command line options, and brings a new use to another:

-lang-chill
This option instructs gcc that the following file is a CHILL source file, even though its extension is not the default `.ch'.
-flocal-loop-counter
The CHILL compiler makes a separate reach, or scope, for each DO FOR loop. If -flocal-loop-counter is specified, the loop counter of value enumeration and location enumeration is automatically declared inside that reach. This is the default behavior, required by Z.200.
-fno-local-loop-counter
When this option is specified, the above automatic declaration is not performed, and the user must declare all loop counters explicitly.
-fignore-case
When this option is specified, the compiler ignores case. All identifiers are converted to lower case. This enables the usage of C runtime libraries.
-fno-ignore-case
Ignoring the case of identifiers is turned off.
-fruntime-checking
The CHILL compiler normally generates code to check the validity of expressions assigned to variables or expressions passed as parameters to procedures and processes, if those expressions cannot be checked at compile time. This is the default behavior, required by Z.200. This option allows you to re-enable the default behavior after disabling it with the -fno-runtime-checking option.
-fno-runtime-checking
The CHILL compiler normally generates code to check the validity of expressions assigned to variables, or expressions passed as parameters to procedures and processes. This option allows you to disable that code generation. This might be done to reduce the size of a program's generated code, or to increase its speed of execution. Compile time range-checking is still performed.
-fgrant-only
-fchill-grant-only
This option causes the compiler to stop successfully after creating the grant file specified by the source file (see modular programming in CHILL). No code is generated, and many categories of errors are not reported.
-fold-string
Implement the semantics of Chill 1984 with respect to strings: String indexing yields a slice of length one; CHAR is similar to CHAR(1) (or CHARS(1)); and BOOL is similar to BIT(1) (or BOOLS(1)).
-fno-old-string
Don't implement 1984 Chill string semantics. This is the default.
-Iseize_path
This directive adds the specified seize path to the compiler's list of paths to search for seize files. When processing a USE_SEIZE_FILE directive, the compiler normally searches for the specified seize file only in the current directory. When one or more seize paths are specified, the compiler also searches in those directories, in the order of their specification on the command line, for the seize file.
-c
This C-related switch, which normally prevents gcc from attempting to link, is *not* yet implemented by the chill command, but you can use the gcc command with this flag.

2 Implemented and missing parts of the Chill language

The numbers in parentheses are Z.200(1988) section numbers.

3 GNU-specific enhancements to the Chill language

4 Value and location conversions

Value and location conversions are highly dependent on the target machine. They are also very loosely specified in the 1988 standard. (The 1992 standard seems an improvement.)

The GNU Chill compiler interprets mode(exp) as follows:

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.

6 Differences to Z.200/1988

This chapter lists the differences and extensions between GNUCHILL and the CCITT recommendation Z.200 in its 1988 version (reffered to as Z.200/1988).

7 Compiler Directives

8 Language Definition References

Z.200 is mostly a language-lawyer's document, but more readable than most. The User's Guide is more readable by far, but doesn't cover the whole language. Our copies of these documents came through Global Engineering Documents, in Irvine, CA, USA. (714)261-1455.


This document was generated on 7 June 2000 using the texi2html translator version 1.51a.