1 @\input texinfo @c -*-texinfo-*-
2 @setfilename chill.info
3 @settitle Guide to GNU Chill
9 * Chill:: Chill compiler
16 @author William Cox, Per Bothner, Wilfried Moser
24 * Options:: Compiler options
25 * Missing:: Unimplemented parts of the Chill language
26 * Enhancements:: GNU-specific enhancements to the Chill language
27 * Conversions:: Value and location conversions
28 * Separate compilation:: Separate compilation
29 * Differences:: Differences between GNUCHILL and Z.200/1988
30 * Directives:: Implemented Compiler Directives
31 * References:: Language definition references
37 @chapter Compiler options
39 Invoking the compiler:
41 The @sc{gnu} CHILL compiler supports several new command line options, and
42 brings a new use to another:
46 This option instructs gcc that the following file is a CHILL source file,
47 even though its extension is not the default `.ch'.
49 @item -flocal-loop-counter
50 The CHILL compiler makes a separate reach, or scope,
51 for each DO FOR loop. If @code{-flocal-loop-counter} is
52 specified, the loop counter of value enumeration and location
53 enumeration is automatically declared inside that reach.
54 This is the default behavior, required by Z.200.
56 @item -fno-local-loop-counter
57 When this option is specified, the above automatic declaration
58 is not performed, and the user must declare all loop counters
62 When this option is specified, the compiler ignores case. All
63 identifiers are converted to lower case. This enables the usage
64 of C runtime libraries.
66 @item -fno-ignore-case
67 Ignoring the case of identifiers is turned off.
69 @item -fruntime-checking
70 The CHILL compiler normally generates code to check
71 the validity of expressions assigned to variables or
72 expressions passed as parameters to procedures and processes,
73 if those expressions cannot be checked at compile time.
74 This is the default behavior, required by Z.200.
75 This option allows you to re-enable the default behavior
76 after disabling it with the @code{-fno-runtime-checking}
79 @item -fno-runtime-checking
80 The CHILL compiler normally generates code to check
81 the validity of expressions assigned to variables, or
82 expressions passed as parameters to procedures and processes.
83 This option allows you to disable that code generation.
84 This might be done to reduce the size of a program's
85 generated code, or to increase its speed of execution.
86 Compile time range-checking is still performed.
89 @itemx -fchill-grant-only
90 This option causes the compiler to stop successfully
91 after creating the grant file specified by the source
92 file (see modular programming in CHILL). No code is
93 generated, and many categories of errors are not reported.
96 Implement the semantics of Chill 1984 with respect to strings:
97 String indexing yields a slice of length one; CHAR is similar
98 to CHAR(1) (or CHARS(1)); and BOOL is similar to BIT(1) (or BOOLS(1)).
100 @item -fno-old-string
101 Don't implement 1984 Chill string semantics. This is the default.
103 @item -I@var{seize_path}
104 This directive adds the specified seize path to the compiler's
105 list of paths to search for seize files. When processing a
106 USE_SEIZE_FILE directive, the compiler normally searches for
107 the specified seize file only in the current directory. When
108 one or more seize paths are specified, the compiler also
109 searches in those directories, in the order of their
110 specification on the command line, for the seize file.
113 This C-related switch, which normally prevents gcc from
114 attempting to link, is *not* yet implemented by the @code{chill} command,
115 but you can use the @code{gcc} command with this flag.
119 @chapter Implemented and missing parts of the Chill language
121 The numbers in parentheses are Z.200(1988) section numbers.
124 @item The FORBID keyword in a GRANT statement is currently ignored.
126 @item A CASE action or expression allows only a single expression
127 in a case selector list (5.3.2, 6.4).
129 @item ROW modes are not implemented (3.6.3, 3.13.4).
131 @item Due to the absence of ROW modes, DYNAMIC has no meaning in
132 connection with access and text modes.
134 @item Array and structure layout (PACK, POS, NOPACK,
135 STEP keywords) is ignored (3.12.6).
137 @item Bit-string slices are not implemented.
139 @item The support for synchronization modes and concurrent execution
140 is slightly non-standard.
142 @item Exception handling is implemented, but exceptions are not
143 generated in all of the required situations.
145 @item Dynamic modes are not implemented (though string slices should work).
147 @item Reach-bound initializations are not implemented (4.1.2).
152 @chapter GNU-specific enhancements to the Chill language
155 @item Grantfiles. See @xref{Separate compilation}.
156 @item Precisions. Multiple integer and real precisions are supported,
157 as well as signed and unsigned variants of the integer modes.
158 @item DESCR built-in. The new built-in function
159 DESCR ( <descriptor argument> ) returns a pointer to
160 STRUCT( addr PTR, length ULONG ) where <descriptor argument> can be
161 anything the compiler can handle but at least a location of any mode
162 (except synchronizing modes) and any character string or powerset value.
163 (A temporary location within the current stack frame may be allocated
164 if an expression is used.)
166 CHILL does not permit the writing of procedures with parameters of
167 any type. Yet some interfaces---in particular those to system
169 the handling of a wide range of modes, e.g. any string mode, any structure
170 mode, or any powerset mode. This could be handled by specifying two
171 parameters (PTR, INT for the length) but this is error-prone (no guarantee
172 the same location is used after in ADDR and LENGTH), and it will not be
173 possible for expressions.
175 Caveats: This feature permits the programmer to obtain the address of
176 a literal (if the compiler takes this shortcut---see 1st example below).
177 If hardware features protect constant parts of the program, erronous
178 abuse will be detected.
181 OFFER_HANDLER( descr("dbs"), ->dbs);
183 SYNMODE m_els = SET( ela, elb, elc );
184 SYNMODE m_elsel = POWERSET m_els;
185 DCL user_buf STRUCT( a mx, b my, c mz);
186 DCL select POWERSET m_elsel;
188 select := m_elsel[LOWER(m_els) : UPPER(m_els)];
190 GET_RECORD( relation, recno, descr(user_buf), descr(select) );
192 PUT_RECORD( relation, recno, descr(user_buf.b), descr(m_elsel[elb]) );
194 @item LENGTH built-in on left-hand-side. The LENGTH built-in may be
195 used on the left-hand-side of an assignment, where its argument is a VARYING
200 @chapter Value and location conversions
202 Value and location conversions are highly dependent on the target machine.
203 They are also very loosely specified in the 1988 standard.
204 (The 1992 standard seems an improvement.)
206 The GNU Chill compiler interprets @code{@var{mode}(@var{exp})} as follows:
210 If @var{exp} is a referable location,
211 and the size of (the mode of) @var{exp} is the same as the size of @var{mode},
212 a location conversion is used.
213 It is implemented exactly as: @code{(@var{refmode}(-> @var{exp}))->},
214 where @var{refmode} is a synmode for @code{REF @var{mode}}.
216 The programmer is responsible for making sure that alignment
217 restrictions on machine addresses are not violated.
219 If both @var{mode} and the mode of @var{exp} are discrete modes,
220 alignment should not be a problem, and we get the same conversion
221 as a standard value conversion.
224 If @var{exp} is a constant,
225 and the size of (the mode of) @var{exp} is the same as the size of @var{mode},
226 then a value conversion is performed. This conversion is done
227 at compile time, and it has not been implemented for all types.
228 Specifically, converting to or from a floating-point type is not implemented.
231 If both @var{mode} and the mode of @var{exp} are discrete modes,
232 then a value conversion is performed, as described in Z.200.
235 If both @var{mode} and the mode of @var{exp} are reference modes,
236 then a value conversion is allowed.
237 The same is true is one mode is a reference mode, and the other
238 is an integral mode of the same size.
242 @node Separate compilation
243 @chapter Separate compilation
245 The GNU CHILL compiler supports modular programming. It
246 allows the user to control the visibility of variables
247 and modes, outside of a MODULE, by the use of GRANT
248 and SEIZE directives. Any location or mode may be made
249 visible to another MODULE by GRANTing it in the MODULE
250 where it is defined, and SEIZEing it in another MODULE
251 which needs to refer to it.
253 When variables are GRANTed in one or more modules of a
254 CHILL source file, the compiler outputs a grant file,
255 with the original source file name as the base name,
256 and the extension `.grt'. All of the variables and modes
257 defined in the source file are written to the grant file,
258 together with any use_seize_file directives, and the
259 GRANT directives. A grant file is created for every such
260 source file, except if an identical grant file already
261 exists. This prevents unnecessary makefile activity.
263 The referencing source file must:
266 @item specify the grant file in a use_seize_file directive, and
267 @item SEIZE each variable or mode definition that it needs.
270 An attempt to SEIZE a variable or mode which is not
271 GRANTed in some seize file is an error.
273 An attempt to refer to a variable which is defined in
274 some seize file, but not explicitly granted, is an
277 An attempt to GRANT a variable or mode which is not
278 defined in the current MODULE is an error.
280 Note that the GNU CHILL compiler will *not* write out a
284 @item there are no GRANT directives in the source file, or
285 @item the entire grant file already exists, and is
286 identical to the file which the compiler has just built.
287 (This latter ``feature'' may be removed at some point.)
290 Otherwise, a grant file is an automatic, unsuppressable
291 result of a successful CHILL compilation.
293 A future release will also support using remote spec modules
294 in a similar (but more Blue Book-conforming) manner.
297 @chapter Differences to Z.200/1988
299 This chapter lists the differences and extensions between GNUCHILL
300 and the CCITT recommendation Z.200 in its 1988 version (reffered to
305 @item 2.2 Vocabulary@*
306 The definition of @i{<simple name string>} is changed to:
309 @i{<simple name string> ::=}
311 @i{@{<letter> | _ @} @{ <letter> | <digit | _ @}}
315 @item 2.6 Compiler Directives@*
316 Only one directive is allowed between the compiler directive delimiters
317 `<>' and `<>' or the end-of-line, i.e.
319 <> USE_SEIZE_FILE "foo.grt" <>
323 @item 3.3 Modes and Classes@*
324 The syntax of @i{<mode>} is changed to:
329 [@b{READ}] @i{<non-composite-mode>}
330 | [@b{READ}] @i{composite-mode>}
333 @i{<non-composite-mode> ::=}
337 | @i{<powerset modes>}
338 | @i{<reference mode>}
339 | @i{<procedure mode>}
340 | @i{<instance mode>}
341 | @i{<synchronization mode>}
346 @item 3.4 Discrete Modes@*
347 The list of discrete modes is enhanced by the following modes:
350 BYTE 8-bit signed integer
351 UBYTE 8-bit unsigned integer
352 UINT 16-bit unsigned integer
353 LONG 32-bit signed integer
354 ULONG 32-bit unsigned integer
357 @strong{Please note} that INT is implemented as 16-bit signed integer.
359 @item 3.4.6 Range Modes@*
360 The mode BIN(n) is not implemented. Using INT(0 : 2 ** n - 1) instead of
361 BIN(n) makes this mode unneccessary.
363 @item 3.X Real Modes@*
364 Note: This is an extension to Z.200/1988, however, it is defined in
372 @i{<floating point mode>}
379 A real mode specifies a set of numerical values which approximate a
380 contiguous range of real numbers.
383 @item 3.X.1 Floating point modes@*
388 @i{<floating point mode> ::=}
390 @i{<floating point mode name}
394 @b{predefined names:}
396 The names @i{REAL} and @i{LONG_REAL} are predefined as @b{floating
401 A floating point mode defines a set of numeric approximations to a
402 range of real values, together with their minimum relative accuracy,
403 between implementation defined bounds, over which the usual ordering
404 and arithmetic operations are defined. This set contains only the
405 values which can be represented by the implementation.
414 @item 3.6 Reference Modes@*
415 Row modes are not implemeted at all.
417 @item 3.7 Procedure Mode@*
418 The syntax for procedure modes is changed to:
421 @i{<procedure mode> ::=}
423 @b{PROC} @i{([<parameter list>]) [ <result spec> ]}
424 @i{[}@b{EXCEPTIONS}@i{(<exception list>)] [}@b{RECURSIVE}@i{]}
425 | @i{<procedure mode name>}
428 @i{<parameter list> ::=}
430 @i{<parameter spec> @{, <parameter spec> @} *}
433 @i{<parameter spec> ::=}
435 @i{<mode> [ <parameter attribute> ]}
438 @i{<parameter attribute> ::=}
440 @b{IN} | @b{OUT} | @b{INOUT} | @b{LOC}
443 @i{<result spec> ::=}
445 @b{RETURNS} @i{( <mode> [}@b{LOC}@i{])}
448 @i{<exception list> ::=}
450 @i{<exception name> @{, <exception name> @} *}
455 @item 3.10 Input-Output Modes@*
456 Due to the absence of row modes, DYNAMIC has no meaning in an access
457 or text mode definition.
460 @item 3.12.2 String Modes@*
461 As @i{<string modes>} were defined differently in Z.200/1984, the syntax
462 of @i{<string mode>} is changed to:
465 @i{<string mode> ::=}
467 @i{<string type> ( <string length> ) [} @b{VARYING} @i{]}
468 | @i{<parametrized string mode>}
469 | @i{<string mode name>}
472 @i{<parameterized string mode> ::=}
474 @i{<origin string mode name> ( <string length> )}
475 | @i{<parameterized string mode name>}
478 @i{<origin string mode name> ::=}
480 @i{<string mode name>}
491 @i{<string length> ::=}
493 @i{<integer literal expression>}
497 @b{VARYING} is not implemented for @i{<string type>} @b{BIT}
500 @item 3.11.1 Duration Modes@*
501 The predefined mode @i{DURATION} is implemented as a NEWMODE ULONG and
502 holds the duration value in miliseconds. This gives a maximum duration
506 MILLISECS (UPPER (ULONG)),
513 @item 3.11.2 Absolute Time Modes@*
514 The predefined mode @i{TIME} is implemented as a NEWMODE ULONG and
515 holds the absolute time in seconds since Jan. 1st, 1970. This is
516 equivalent to the mode `time_t' defined on different systems.
518 @item 3.12.4 Structure Modes@*
519 Variant fields are allowed, but the CASE-construct may define only one
520 tag field (one dimensional CASE). OF course, several variant fields may
521 be specified in one STRUCT mode. The tag field will (both at compile-
522 and runtime) not be interpreted in any way, however, it must be
523 interpreted by a debugger. As a consequence, there are no parameterized
526 @item 3.12.5 Layout description for array and structure modes@*
527 STEP and POS is not implemeted at all, therefore the syntax of
528 @i{<element layout} and @i{field layout} is changed to:
531 @i{<element layout> ::=}
533 @b{PACK} | @b{NOPACK}
536 @i{<field layout> ::=}
538 @b{PACK} | @b{NOPACK}
542 @item 3.13.4 Dynamic parameterised structure modes@*
543 Dynamic parameterised structure modes are not implemented.
545 @item 4.1.2 Location declaration@*
546 The keyword STATIC is allowed, but has no effect at module level, because
547 all locations declared there are assumed to be `static' by default. Each
548 granted location will become `public'. A `static' declaration inside a
549 block, procedure, etc. places the variable in the data section instead of
552 @item 4.1.4 Based decleration@*
553 The based declaration was taken from Z.200/1984 and has the following
559 @i{<based declaration> ::=}
561 @i{<defining occerrence list> <mode>} @b{BASED}
562 @i{( <free reference location name> )}
568 A based declaration with @i{<free reference location name>} specifies
569 as many access names as are defining occerrences in the @i{defining
570 occurrence list}. Names declared in a base declaration serve as an
571 alternative way accessing a location by dereferencing a reference
572 value. This reference value is contained in the location specified by
573 the @i{free reference location name}. This dereferencing operation is
574 made each time and only when an access is made via a declared @b{based}
577 @b{static properties:}
579 A defining occurrence in a @i{based declaration} with @i{free reference
580 location name} defines a @b{based} name. The mode attached to a
581 @b{based} name is the @i{mode} specified in the @i{based declaration}. A
582 @b{based} name is @b{referable}.
584 @item 4.2.2 Access names@*
585 The syntax of access names is changed to:
588 @i{<access name> ::=}
591 | @i{<loc-identity name>}
593 | @i{<location enumeration name>}
594 | @i{<location do-with name>}
598 The semantics, static properties and dynamic conditions remain
599 unchanged except that they are enhanced by @i{base name}.
601 @item 5.2.4.1 Literals General@*
602 The syntax of @i{<literal>} is change to:
607 @i{<integer literal>}
608 | @i{<boolean literal>}
609 | @i{<charater literal>}
611 | @i{<emptiness literal>}
612 | @i{<character string literal>}
613 | @i{<bit string literal>}
614 | @i{<floating point literal>}
618 Note: The @i{<floating point literal>} is an extension to Z.200/1988 and
619 will be described later on.
621 @item 5.2.4.2 Integer literals@*
622 The @i{<decimal integer literal>} is changed to:
625 @i{<decimal integer literal> ::=}
627 @i{@{ D | d @} ' @{ <digit> | _ @} +}
628 | @i{<digit> @{ <digit> | _ @} *}
632 @item 5.2.4.4 Character literals@*
633 A character literal, e.g. 'M', may serve as a charater string literal of
636 @item 5.2.4.7 Character string literals@*
637 The syntax of a character string literal is:
640 @i{<character string literal> ::=}
642 @i{'@{ <non-reserved character> | <single quote> |}
643 @i{<control sequence> @} * '}
644 | @i{'@{ <non-reserved character> | <double quote> |}
645 @i{<control sequence> @} * '}
648 @i{<single quote> ::=}
653 @i{<double quote> ::=}
659 A character string litaral of length 1, enclosed in apostrophes
660 (e.g. 'M') may also serve as a charater literal.
662 @item 5.2.4.9 Floating point literal@*
663 Note: This is an extension to Z.200/1988 ans was taken from Z.200/1992.
668 @i{<floating point literal> ::=}
670 @i{<unsigned floating point literal>}
671 | @i{<signed floating point literal>}
674 @i{<unsigned floating point literal> ::=}
676 @i{<digit sequence> . [ <digit sequence> ] [ <exponent> ]}
677 | @i{[ <digit sequence> ] . <digit sequence> [ <exponent> ]}
680 @i{<signed floating point literal> ::=}
682 @i{- <unsigned floating point literal>}
685 @i{<digit sequence> ::=}
687 @i{<digit> @{ <digit> | _ @} *}
692 @i{[ E | D | e | d ] <digit sequence>}
693 | @i{[ E | D | e | d ] - <digit sequence>}
697 @item 5.2.14 Start Expression@*
698 The START expression is not implemented.
700 @item 5.3 Values and Expressions@*
701 The undefined value, denoted by `*', is not implemented.
703 @item 5.3.8 Operand-5@*
704 The @i{<string repetition operator>} is defined as:
707 @i{<string repetition operator> ::=}
709 @i{(<integer expression>)}
713 @item 6.4 Case Action@*
714 There may be only one case selector specified. The optional range list
715 must not be specified.
717 @item 6.5 Do Action@*
718 A Do-Action without control part is not implemented. Grouping of
719 statements can be achieved via BEGIN and END. A location enumeration is not
720 allowed for BIT strings, only for (varying) CHAR strings and ARRAYs.
722 The expression list in a DO WITH must consist of locations only.
724 @item 6.13 Start Action@*
725 The syntax of the START action is changed to:
728 @i{<start action> ::=}
730 @b{START} @i{<process name> (<copy number> [, <actual parameter list>])}
731 @i{[} @b{SET} @i{<instance location> ]}
734 @i{<copy number> ::=}
736 @i{<integer expression>}
740 @item 6.16 Delay Action@*
741 The optional PRIORITY specification need not be a constant.
743 @item 6.17 Delay Case Action@*
744 The optional SET branch and the, also optional, PRIORITY branch must be
747 @item 6.18 Send Action@*
748 The send action must define a destination instance (via the TO branch),
749 since undirected signals are not supported. The optional PRIORITY
750 specification need not be a constant. Additional to the data
751 transported by the signal, there will be a user defined argument.
753 The syntax of the @i{<send signal action>} is therefore:
756 @i{<send signal action> ::=}
758 @b{SEND} @i{<signal name> [ ( <value> @{, <value> @} * ) ]}
759 @i{[} @b{WITH} @i{<expression> ]}
760 @b{TO} @i{<instance primitive value> [ <priority> ]}
764 The default priority can be specified by the compiler directive
765 SEND_SIGNAL_DEFAULT_PRIORITY. If this also is omitted, the default
768 @item 6.20.3 CHILL value built-in calls@*
769 The CHILL value buit-in calls are enhanced by some calls, and other calls
770 will have different arguments as described in Z.200/1988. Any call not
771 mentioned here is the same as described in Z.200/1988.
776 @i{CHILL value built-in routine call> ::=}
778 @i{ADDR (<location>)}
779 | @i{PRED (<pred succ argument>)}
780 | @i{SUCC (<pred succ argument>)}
781 | @i{ABS (<numeric expression>)}
782 | @i{LENGTH (<length argument>)}
783 | @i{SIN (<floating point expression>)}
784 | @i{COS (<floating point expression>)}
785 | @i{TAN (<floating point expression>)}
786 | @i{ARCSIN (<floating point expression>)}
787 | @i{ARCCOS (<floating point expression>)}
788 | @i{ARCTAN (<floating point expression>)}
789 | @i{EXP (<floating point expression>)}
790 | @i{LN (<floating point expression>)}
791 | @i{LOG (<floating point expression>)}
792 | @i{SQRT (<floating point expression>)}
793 | @i{QUEUE_LENGTH (<buffer location> | <event location>)}
794 | @i{GEN_INST (<integer expression> | <process name> ,}
795 @i{<integer expression>)}
796 | @i{COPY_NUMBER (<instance expression>)}
797 | @i{GEN_PTYE (<process name>)}
798 | @i{PROC_TYPE (<instance expression>)}
799 | @i{GEN_CODE (<process name> | <signal name>)}
800 | @i{DESCR (<location>)}
803 @i{<pred succ argument> ::=}
805 @i{<discrete expression>}
806 | @i{<bound reference expression>}
809 @i{<numeric expression> ::=}
811 @i{<integer expression>}
812 | @i{floating point expression>}
815 @i{<length argument> ::=}
817 @i{<string location>}
818 | @i{<string expression>}
819 | @i{<string mode name>}
820 | @i{<event location>}
821 | @i{<event mode name>}
822 | @i{<buffer location>}
823 | @i{<buffer mode name>}
824 | @i{<text location>}
825 | @i{<text mode name>}
831 @i{ADDR} is derived syntax for -> @i{<location>}.
833 @i{PRED} and @i{SUCC} delivers respectively, in case of a @i{discrete
834 expression}, the next lower or higher discrete value of their argument,
835 in case of @i{bound reference expression} these built-in calls deliver a
836 pointer to the previous or next element.
838 @i{ABS} is defined on numeric values, i.e. integer values and floating
839 point values, delivering the corresponding absolute value.
841 @i{LENGTH} is defined on
845 @item string and text locations and string expressions, delivering the
848 @item event locations, delivering the @b{event length} of the mode of the
851 @item buffer locations, delivering the @b{buffer length} of the mode of
854 @item string mode names, delivering the @b{string length} of the mode;
856 @item text mode names, delivering the @b{text length} of the mode;
858 @item buffer mode names, delivering the @b{buffer length} of the mode;
860 @item event mode names, delivering the @b{event length} of the mode;
862 @item Additionally, @i{LENGTH} also may be used on the left hand
863 side of an assignment to set a new length of a @i{varying character
864 string location}. However, to avoid undefined elements in the varying
865 string, the new length may only be less or equal to the current length.
866 Otherwise a @b{RANGEFAIL} exception will be generated.
869 @i{SIN} delivers the sine of its argument (interpreted in radians).
871 @i{COS} delivers the cosine of its argument (interpreted in radians).
873 @i{TAN} delivers the tangent of its argument (interpreted in radians).
875 @i{ARCSIN} delivers the sin -1 function of its argument.
877 @i{ARCCOS} delivers the cos -1 function of its argument.
879 @i{ARCTAN} delivers the tan -1 function of its argument.
881 @i{EXP} delivers the exponential function, where x is the argument.
883 @i{LN} delivers the natural logarithm of its argument.
885 @i{LOG} delivers the base 10 logarithm of its argument.
887 @i{SQRT} delivers the sqare root of its argument.
889 @i{QUEUE_LENGTH} delivers either the number of sending delayed processes
890 plus the number of messages in a buffer queue (if the argument is a
891 @i{buffer location}), or the number of delayed processes (if the
892 argument specifies an @i{event location}) as @i{integer expression}.
894 @i{GEN_INST} delivers an @i{instance expression} constructed from the
895 arguments. Both arguments must have the @i{&INT}-derived class.
897 @i{COPY_NUMBER} delivers as @i{&INT}-derived class the copy number of an
898 @i{instance location}.
900 @i{GEN_PTYPE} delivers as @i{&INT}-derived class the associated number
901 of the @i{process name}.
903 @i{PROC_TYPE} delivers as @i{&INT}-derived class the process type of an
904 @i{instance expression}.
906 @i{GEN_CODE} delivers as @i{&INT}-derived class the associated number of
907 the @i{process name} or @i{signal name}.
909 @i{DESCR} delivers a @i{free reference expression} pointing to a
910 structure with the following layout describing the @i{location} argument.
913 SYNMODE __tmp_descr = STRUCT (p PTR, l ULONG);
917 @item 7.4.2 Associating an outside world object@*
918 The syntax of the associate built-in routine call is defined as:
921 @i{<associate built-in routine call> ::=}
923 @i{ASSOCIATE ( <association location>, <string expression>,} [@i{, <string expression>} ] @i{)}
927 The ASSOCIATE call has two parameters besides the association location:
928 a pathname and an optional mode string.
930 The value of the first string expression must be a pathname according to
931 the rules of the underlying operating system. (Note that a relative pathname
932 implies a name relative to the working directory of the process.)
934 The mode string may contain the value "VARIABLE", which requests
935 an external representation of records consisting of an UINT record
936 length followed by as many bytes of data as indicated by the length field.
937 Such a file with variable records is not indexable.
939 A file with variable records can be written using any record mode. If the
940 record mode is CHARS(n) VARYING, the record length is equal to the actual
941 length of the value written. (Different record may have differing lengths.)
942 With all other record modes, all records written using the same access mode
943 will have the same length, but will still be prefixed with the length field.
944 (Note that by re-connecting with different access modes, the external
945 representation may ultimately contain records with differing lengths.)
947 A file with variable records can only be read by using a record mode of
951 @item 7.4.2 Accessing association attributes@*
952 The value of the READABLE and WRITEABLE attributes is determined using
953 the file status call provided by the operating system. The result will
954 depend on the device being accessed, or on the file mode.
956 The INDEXABLE attribute has the value false for files with variable records,
957 and for files associated with devices not supporting random positioning
958 (character devices, FIFO special files, etc.).
960 The variable attribute is true for files associated with the mode sting
961 "VARIABLE", and false otherwise.
964 @item 7.4.5 Modifying association attributes@*
965 The syntax of the MODIFY built-in routine call is defined as:
968 @i{<modify built-in call> ::=}
970 @i{MODIFY ( <association location>, <string expression> )}
974 At present, MODIFY accepts a character string containing a pathname
975 in addition to the association location, which will cause a renaming
976 of the associated file.
979 @item 7.4.9 Data transfer operations@*
980 READRECORD will fail (causing READFAIL) if the number of bytes from the
981 current position in the file to the end of the file is greater than zero
982 but less than the size of the record mode, and no data will be transferred.
983 (If the number of bytes is zero, no error occurs and OUTOFFILE will
986 The number of bytes transferred by READRECORD and WRITERECORD is equal to
987 the size of the record mode of the access location. Note that the
988 internal representation of this mode may vary depending on the
989 record mode being packed or not.
992 @item 7.5 Text Input Output@*
993 Sequential text files will be represented so as to be compatible
994 with the standard representation of texts on the underlying operating
995 system, where control characters are used to delimit text records on files
996 as well as to control the movement of a cursor or printing head on a device.
998 For indexed text files, records of a uniform length (i.e. the size of the
999 text record, including the length field) are written. All i/o codes cause
1000 an i/o transfer without any carriage control characters being added to the
1001 record, which will be expanded with spaces.
1003 An indexed text file is therefore not compatible with the standard
1004 text representation of the underlying operating system.
1008 @item 7.5.3 Text transfer operations@*
1009 The syntax of @i{<text argument>} is changed to:
1012 @i{<text argument> ::=}
1015 | @i{<predefined text location>}
1016 | @i{<varying string location>}
1019 @i{<predefined text location> ::=}
1027 NOTE: The identifiers STDIN, STDOUT, and STDERR are predefined.
1028 Association and connection with files or devices is done according to
1029 operating system rules.
1031 The effect of using READTEXT or WRITETEXT with a character string location
1032 as a text argument (i.e. the first parameter) where the same location also
1033 appears in the i/o list is undefined.
1035 The current implementation of formatting assumes run-to-completion semantics
1036 of CHILL tasks within an image.
1040 @item 7.5.5 Conversion@*
1041 Due to the implementation of @i{<floating point modes>} the syntax
1045 @i{<conversion clause> ::=}
1047 @i{<conversion code> @{ <conversion qualifier @} *}
1048 @i{[ <clause width> ]}
1051 @i{<conversion code> ::=}
1053 @i{B} | @i{O} | @i{H} | @i{C} | @i{F}
1056 @i{<conversion qualifier> ::=}
1058 @i{L} | @i{E} | @i{P<character>}
1061 @i{<clause width> ::=}
1063 @i{@{ <digit> @} +} | @i{V}
1064 | @i{<real clause width>}
1067 @i{<real clause width> ::=}
1069 @i{@{ @{ <digit> + | V @} : @{ @{ <digit> @} + | V @}}
1073 Note: The @i{<real clause width>} is only valid for @i{<conversion
1077 @item 7.5.7 I/O control@*
1078 To achieve compatibility of text files written with CHILL i/o with
1079 the standard representation of text on the underlying operating system
1080 the interpretation of the i/o control clause of the format
1081 deviates from Z.200. The following table shows the i/o codes together
1082 with the control characters written before and after the text record,
1083 to achieve the indicated function:
1086 Write next record (record, line feed)
1089 Write record on next page (form feed, record, line feed)
1092 Write record on current line (record, carriage return)
1095 Write record as a prompt (carriage return, record)
1098 Emit record (record).
1101 Force new page for the next line: The control character written before
1102 the next record will be form feed, irrespective of the i/o control used for
1103 transferring the record.
1106 When reading a text file containing control characters other than line feed,
1107 these characters have to be reckoned with by the format used to read the
1113 @item 11.2.2 Regionality@*
1114 Regionality is not implemented at all, so there is no difference in the
1115 generated code when REGION is substituted by MODULE in a GNUCHILL
1118 @item 11.5 Signal definition statement@*
1119 The @i{<signal definition statement>} may only occur at module level.
1121 @item 12.3 Case Selection@*
1122 The syntax of @i{<case label specification>} is changed to:
1125 @i{<case label specification> ::=}
1127 @i{( <case label> @{, <case label> @} * )}
1130 @i{<case label> ::=}
1132 @i{<discrete literal expression>}
1133 | @i{<literal range>}
1134 | @i{<discrete mode name>}
1142 @chapter Compiler Directives
1146 @item ALL_STATIC_ON, ALL_STATIC_OFF@*
1147 These directives control where procedure local variables are
1148 allocated. ALL_STATIC_ON turns allocation of procedure local variables
1149 in the data space ON, regardless of the keyword STATIC being used or not.
1150 ALL_STATIC_OFF places procedure local variables in the stack space.
1151 The default is ALL_STATIC_OFF.
1153 @item RANGE_ON, RANGE_OFF@*
1154 Turns generation of rangecheck code ON and OFF.
1156 @item USE_SEIZE_FILE <character string literal>@*
1157 Specify the filename (as a character string literal) where
1158 subsequent SEIZE statements are related to. This directive
1159 and the subsequent SEIZEs are written
1160 to a possibly generated grant file for this module.
1163 <> USE_SEIZE_FILE "foo.grt" <>
1167 @item USE_SEIZE_FILE_RESTRICTED "filename"@*
1168 Same as USE_SEIZE_FILE. The difference is that this directive
1169 and subsequent SEIZEs are *not* written to a possibly generated
1172 @item PROCESS_TYPE = <integer expression>@*
1173 Set start value for all PROCESS delclarations. This value automatically
1174 gets incremented after each PROCESS declaration and may be changed with
1175 a new PROCESS_TYPE compiler directive.
1177 @item SIGNAL_CODE = <integer expression>@*
1178 Set start value for all SIGNAL definitions. This value automatically
1179 gets incremented after each SIGNAL definition and may be changed with a
1180 new SIGNAL_CODE compiler directive.
1182 @item SEND_SIGNAL_DEFAULT_PRIORITY = <integer expression>@*
1183 Set default priority for send signal action.
1185 @item SEND_BUFFER_DEFAULT_PRIORITY = <integer expression>@*
1186 Set default priority for send buffer action.
1188 Note: Every <integer expression> in the above mentioned compiler
1189 directives may also be specified by a SYNONYM of an integer type.
1192 SYN first_signal_code = 10;
1193 <> SIGNAL_CODE = first_signal_code <>
1200 @chapter Language Definition References
1203 @item CCITT High Level Language (CHILL) Recommendation Z.200
1204 ISO/IEC 9496, Geneva 1989 ISBN 92-61-03801-8
1206 @item An Analytic Description of CHILL, the CCITT high-level
1207 language, Branquart, Louis & Wodon, Springer-Verlag 1981
1210 @item CHILL User's Manual
1211 CCITT, Geneva 1986 ISBN 92-61-02601-X
1213 @item Introduction to CHILL
1214 CCITT, Geneva 1983 ISBN 92-61-017771-1
1216 @item CHILL CCITT High Level Language
1217 Proceedings of the 5th CHILL Conference
1218 North-Holland, 1991 ISBN 0 444 88904 3
1220 @item Introduction to the CHILL programming Language
1221 TELEBRAS, Campinas, Brazil 1990
1225 Z.200 is mostly a language-lawyer's document, but more readable
1226 than most. The User's Guide is more readable by far, but doesn't
1227 cover the whole language. Our copies of these documents came through
1228 Global Engineering Documents, in Irvine, CA, USA. (714)261-1455.