$a include=template_file $a tab=11 $n$lm IMP Core Environment Standard $b2$lm Collected References $a indent=0 $a indent=1 $b$v5$t0 [BS6154] $t "Method of Defining Syntactic Metalanguage" $b0 British Standards Institution $b0 British Standard BS6154:1981 $b0 ISBN 0-580-12530-0 $b$v5$t0 [BS6192] $t "Specification for Programming Language Pascal" $b0 British Standards Institution $b0 British Standard BS6192:1982 $b0 ISBN 0-580-12531-9 $b$v5$t0 [CODY80] $t "Software Manual for the Elementary Functions" $b0 W$. J$. Cody, Jr$. and W$. Waite $b0 Prentice-Hall, 1981 $b0 ISBN 0-13-822064-6 $b$v5$t0 [ISO7185] $t International Equivalent of [BS6192] $b0 International Organisation for Standardisation (ISO) $b$v6$t0 [SCO83] $t "An Introduction and Handbook for the $b0 Standard Syntactic Metalanguage" $b0 R$. S$. Scowen $b0 National Physical Laboratory $b0 NPL Report DITC 19/83 $b0 February 1983 $n$lm IMP Core Environment Standard $b2$lm Collected ERRnnnn Items $a tab=9 $a indent=0 $a indent=1 $b$v5$t0 ERR0001 $t CHARNO argument out of range $b0 It is an error if the position argument provided to the CHARNO procedure does not refer to one of the characters currently present in the string. The recommended action for this condition is to fire the appropriate signal (SIG0001; CHARNO argument out of range). $b$v5$t0 ERR0002 $t division by zero $b0 It is an error if an attempt is made to divide any number, integer or real, including zero itself, by zero. The recommended action for this condition is to fire the appropriate signal (SIG0002; Division by zero). $b$v5$t0 ERR0003 $t string inside-out $b0 It is an error if, on invoking the SUB$ STRING function, the value of TO-FROM+1 is negative, that is if the implied length of the resultant string is less than zero characters. The recommended action for this condition is to fire the appropriate signal (SIG0005; SUB$ STRING bounds or string inside-out). $b$v5$t0 ERR0004 $t %for loop cannot terminate $b0 It is an error to construct a %for loop which would not, if the statements enclosed by the loop were removed, terminate in a finite number of iterations. This is equivalent to saying that the difference between the initial and final values of the control variable is not a non-negative integer multiple of the increment value. A %for loop construct is therefore valid if $b $c-3 1) $t INC=0, FINAL=INIT or $b $c-3 2) $t INC#0, (FINAL-(INIT-INC))//INC>=0 and $b0 $t $c+7 REM(FINAL-INIT,INC)=0 $b %for loop constructs are in error under all other circumstances. The recommended action for this condition is to fire the appropriate signal (SIG0004; %for loop cannot terminate). $b$v15$t0 ERR0005 $t SUB STRING bounds $b0 It is an error if, on invoking the SUB$ STRING function, the implied length of the resultant string is greater than or equal to zero characters at the same time either the FROM or TO parameters exceed the bounds of the string argument S. More formally, it is an error if: $b $c-3 1) $t TO-FROM+1>=0 and $b0 $c-3 2) $t (TO<0 or FROM<0 or TO>LENGTH(S) or FROM>LENGTH(S)) $b The recommended action for this condition is to fire the appropriate signal (SIG0005; SUB$ STRING bounds or string inside-out). $b$v5$t0 ERR0006 $t illegal stream number $b0 It is an error to pass to any of the core environment procedures which accept a stream number parameter, as that stream parameter, any integer value outwith the valid range of streams for the implementation. The minimum valid stream number is zero; the maximum valid stream number is implementation defined (DEF0001; MAXSTREAM: maximum stream number). The recommended action for this condition is to fire the appropriate signal (SIG0006; illegal stream number). $b$v5$t0 ERR0007 $t %integer range exceeded $b0 It is an error to attempt to compute an integer value which exceeds the implementation defined range for the %integer data type (DEF0005; range of %integer variables). The recommended action for this condition is to fire the appropriate signal (SIG0007; %integer overflow). $n$lm IMP Core Environment Standard $b2$lm Collected DEPnnnn Items $a indent=0 $p This section collects together all the items which represent cases in which implementation dependent effects may be obtained from a conforming implementation. An implementation may choose to define the particular definition used for any of these items, but it is an error for a program to make use of a particular implementation's definition of one of these items. $a indent=1 $b$v5$t0 DEP0001 $t order of evaluation of expressions $b$v5$t0 DEP0002 $t order of evaluation of parameters $n$lm IMP Core Environment Standard $b2$lm Collected DEFnnnn Items $a indent=0 $p This section collects together all the items which must be defined and documented for an implementation to claim conformance with this standard. In addition, this section gives mandatory specifications of which definitions the implementation is permitted to choose for each item. For example, an implementation which chose a maximum stream number for DEF0001 of 3 would not be able to claim conformance with this standard, as the specification of DEF0001 states that the minimum value for this which may be chosen by a conforming implementation is 15. $p Where necessary, individual items in this section also attempt to make clear the opposite to the above: that is, it attempts to give the potential implementor an idea of which definitions it is specifically permissable to choose. In some cases, items below also attempt to give guidance to the implementor of what is expected rather than required of an implementation. This enables the implementor to choose the definition which will be least surprising to the target user population for a proposed implementation, when that choice has been left open by the underlying operating system environment. $a indent=1 $b$v5$t0 DEF0001 $t MAXSTREAM: maximum stream number $b0 The maximum stream number is the largest integer which may be presented to a SELECT or OPEN procedure to indicate the number of the stream to be selected or opened. This number must be at least 15. $b$v5$t0 DEF0002 $t definition of EVENT FM $b0 The precise definition of the record format EVENT$ FM must be defined by the implementation. This definition must contain, as a minimum, the following fields: $b$v4$l0 %integer Event %integer Sub %integer Extra _s_t_r_i_n_g(255) Message $b0 $b This standard does not specify any particular ordering of the fields within this record format. Other fields may be defined at an implementation's discretion as long as it is possible for a programmer to request that uses of such additional fields be rejected as non-standard. The implementation's definition of this record format should take the form of an IMP program fragment such as the following: $b$v3$l0 %record %format Event Fm ( - _s_t_r_i_n_g(255) Message, %integer Event, %integer Sub, %integer Extra, %integer PC, %short Module ) $b0 $b This requirement ensures that both any extra fields and the order of the fields within the record are made apparent. $b$v5$t0 DEF0003 $t range of %byte variables $b0 An implementation must define the range of integer values which can be assigned to a %byte variable without error with the following wording: $b$v5$a left<=+10; line <=-20 The range of values which may be assigned to a %byte variable without error is from to , where both values are inclusive. $a left>; line> $b Here, represents the most negative value which may be assigned to a %byte variable without error and represents the most positive, both of which should be replaced in the statement above with the appropriate values for the implementation, stated in decimal. Note that the range described for DEF0003 must include the range from 0 to 255 inclusive as a (not necessarily proper) subset and must in turn be a (not necessarily proper) subset of the range defined in DEF0004 below for the range of %short variables. $b$v5$t0 DEF0004 $t range of %short variables $b0 An implementation must define the range of integer values which can be assigned to a %short variable without error with the following wording: $b$v5$a left<=+10; line <=-20 The range of values which may be assigned to a %short variable without error is from to , where both values are inclusive. $a left>; line> $b Here, represents the most negative value which may be assigned to a %short variable without error and represents the most positive, both of which should be replaced in the statement above with the appropriate values for the implementation, stated in decimal. Note that the range described for DEF0004 must include the range from -32767 to 32767 inclusive as a (not necessarily proper) subset and must in turn be a (not necessarily proper) subset of the range defined in DEF0005 below for the range of %integer variables. $b$v5$t0 DEF0005 $t range of %integer variables $b0 An implementation must define the range of integer values which can be assigned to an %integer variable without error with the following wording: $b$v5$a left<=+10; line <=-20 The range of values which may be assigned to an %integer variable without error is from to , where both values are inclusive. $a left>; line> $b Here, represents the most negative value which may be assigned to an %integer variable without error and represents the largest, both of which should be replaced in the statement above with the appropriate values for the implementation, stated in decimal. Note that the range described for DEF0005 must include the range from -2147483647 to 2147483647 inclusive as a (not necessarily proper) subset. $b$v5$t0 DEF0006 $t BINARY stream facility $b0 An implementation must define the relationship between external objects created using the BINARY stream facility (composed of OPEN$ BINARY$ INPUT and OPEN$ BINARY$ OUTPUT) and the underlying operating system file structure. $b$v5$t0 DEF0007 $t initial prompt string $b0 An implementation must define the initial prompt string, i.e$. the prompt string which is in effect before any call to the procedure PROMPT by the user program. This is commonly defined to be the null string ("") or a string suggesting that data should be typed ("Data:" or similar). $b$v5$t0 DEF0008 $t mapping of %include facility $b0 An implementation must define the mapping between symbolic %include facility (module-id, item-id) pairs and external objects. $b$v5$t0 DEF0009 $t TEXT stream facility $b0 An implementation must define the relationship between external objects created using the TEXT stream facility (composed of OPEN$ INPUT and OPEN$ OUTPUT) and the underlying operating system file structure. $b$v5$t0 DEF0010 $t default stream mapping $b0 An implementation must define the mapping between input and output streams 0$ and$ 1 and the underlying operating system environment. $b$v5$t0 DEF0011 $t DOING facility $b0 An implementation must define whether or not the DOING facility is available. If the DOING facility is available, the implementation must define the method by which the interactive user invokes the facility and the form of response to be expected. It is permissable for the implementation to specify that the DOING facility is limited in certain ways. For example, it is permissable to define that the asynchronous status-requesting communication will be ignored during the execution of "critical" parts of the run-time system or at other specified times. In cases where the underlying operating system places a limit on the length of response message, it may also be defined that the parameter string will be truncated if its length exceeds some defined limit. $b$v10$t0 DEF0012 $t INTERRUPTED facility $b0 An implementation must define whether or not the INTERRUPTED facility is available. If the INTERRUPTED facility is available, the implementation must define the method by which the interactive user invokes the facility. It is permissable for the implementation to specify that the asynchronous attention-requesting communication will be ignored during the execution of "critical" parts of the run-time system or at other specified times. $b$v10$t0 DEF0013 $t effective length of PROMPT $b0 An implementation must define the maximum length of parameter to PROMPT which will be communicated without truncation to the interactive terminal user. On most systems, this will be the maximum length of the parameter to the PROMPT procedure, that is 255$ characters. If the host operating system provides a prompting facility but limits the length of the prompt string then the implementation may specify that this characteristic is visible to the user program by defining the effective length of PROMPT to be less than 255$ characters. Note that it is not acceptable for an implementation to define the effective length of PROMPT as less than 15 characters: operating systems whose built-in prompt facility is restricted to strings shorter than 15$ characters must be regarded as having no built-in prompt facility and implementations based on them should communicate the prompt string in some other fashion. $b$v10$t0 DEF0014 $t operation of PROMPT facility $b0 As implementation must define the method by which the prompt string is communicated to an interactive terminal user. In addition, if the implementation does not guarantee to communicate the current prompt string on each and every request for input data, the implementation must define those circumstances in which the prompt string will not be communicated. $n$lm IMP Core Environment Standard $b2$lm Collected SIGnnnn Items $a indent=0 $a indent=1 $b$v5$t0 SIG0001 $t CHARNO argument out of range $b0 %signal 6,5,POS where POS is the value of the argument which is out of range. $b$v5$t0 SIG0002 $t division by zero $b0 %signal 1,4,0 $b$v5$t0 SIG0003 $t input ended $b0 %signal 9,1,0 $b$v5$t0 SIG0004 $t %for loop cannot terminate $b0 %signal 5,1,0 $b$v5$t0 SIG0005 $t SUB STRING bounds or string inside-out $b0 %signal 5,4,0 $b$v5$t0 SIG0006 $t illegal stream number $b0 %signal 9,2,ARG where ARG is the value of the argument which is out of range. $b$v5$t0 SIG0007 $t %integer overflow $b0 %signal 1,1,0