ack.7

来自「minix操作系统最新版本(3.1.1)的源代码」· 7 代码 · 共 2,091 行 · 第 1/5 页

7
2,091
字号
characters, some possibly without graphic representations..ISThe 7-bit ASCII character set is used, where LF (10) denotes theend-of-line marker on text-files..IT 6.4.2.2The ordinal numbers of the character values shall be values of integer-type,that are implementation-defined, and that are determined by mappingthe character values on to consecutive non-negative integer valuesstarting at zero..ISThe normal ASCII ordering is used: ord('0')=48, ord('A')=65, ord('a')=97, etc..IT 6.6.5.2The post-assertions imply corresponding activities on the external entities,if any, to which the file-variables are bound.These activities, and thepoint at which they are actually performed, shall beimplementation-defined..ISThe reading and writing writing of objects on files is buffered.This means that when a program terminates abnormally, I/O may beunfinished.Terminal I/O is unbuffered.Files are closed whenever they are rewritten or reset, or onprogram termination..IT 6.7.2.2The predefined constant \fImaxint\fR shall be of integer-type and shall denotean implementation-defined value, that satisfies the following conditions:.IP (a)All integral values in the closed interval from \fI\(mimaxint\fR to \fI+maxint\fRshall be values of the integer-type..IP (b)Any monadic operation performed on an integer value in this intervalshall be correctly performed according to the mathematical rules forinteger arithmetic..IP (c)Any dyadic integer operation on two integer values in this same intervalshall be correctly performed according to the mathematical rules forinteger arithmetic, provided that the result is also in this interval..IP (d)Any relational operation on two integer values in this same intervalshall be correctly performed according to the mathematical rules forinteger arithmetic..SPThe representation of integers under 16-bit \*(Mp or under 68000 \*(Mxis a 16-bit word using two's complement arithmetic.  The integers rangefrom \(mi32768 to +32767.  Under 32-bit \*(Mp a 32-bit integer is usedranging from \(mi2147483648 to +2147483647..IT 6.7.2.2The result of the real arithmetic operators and functions shall beapproximations to the corresponding mathematical results.The accuracy ofthis approximation shall be implementation-defined.ISThe default size of reals is 8 bytes, the accuracy is 11 bits for the exponent,and 53 bits for the mantissa.This gives an accuracy of about 16 digits.and exponents ranging from \(mi307 to +307..IT 6.9.3.1The default TotalWidth values for integer, Boolean and real typesshall be implementation-defined..ISThe defaults are:.XS.ta +\w'Boolean   'u +\w'14  'uinteger	6	(16-bit)integer	11	(32-bit)Boolean	5real	14.DT.XE.IT 6.9.3.4.1ExpDigits, the number of digits written in an exponent part of a real,shall be implementation-defined..ISExpDigits is defined as 3..IT 6.9.3.4.1The character written as part of the representation ofa real to indicate the beginning of the exponent part shall beimplementation-defined, either 'E' or 'e'..ISThe exponent part starts with 'e'..IT 6.9.3.5The case of the characters written as representation of theBoolean values shall be implementation-defined..ISThe representations of true and false are 'true' and 'false'..IT 6.9.5The effect caused by the standard procedure pageon a text file shall be implementation-defined..ISThe ASCII character form feed FF (12) is written..IT 6.10The binding of the variables denoted by the program-parametersto entities external to the program shall be implementation-defined ifthe variable is of a file-type..ISThe program parameters must be files and all, except input and output,must be declared as such in the program block..PPThe program parameters input and output, if specified, will correspondwith the UNIX streams 'standard input' and 'standard output'..PPThe other program parameters will be mapped to the argument stringsprovided by the caller of this program.The argument strings are supposed to be path names of the files to beopened or created.The order of the program parameters determines the mapping:the first parameter is mapped onto the first argument string, etc.Note that input and output are ignored in this mapping..PPThe mapping is recalculated each time a program parameteris opened for reading or writing by a call to the standard proceduresreset or rewrite.This gives the programmer the opportunity to manipulate the listof string arguments using the external procedures argc, argv and argshiftavailable in the Pascal library..IT 6.10The effect of an explicit use of reset or rewriteon the standard text files input or output shall be implementation-defined..ISThe procedures reset and rewrite are no-opsif applied to input or output..in 0.SS "Implementation-dependent features".PPFor each implementation-dependent feature mentioned in the BSI standard,we give the section number, the quotation from that section and the waythis feature is treated by the .MXPascal system.First we quote the definition of 'implementation-dependent':.PP.RSPossibly differing between processors and not necessarily defined for anyparticular processor..RE.IT 6.7.2.1The order of evaluation of the operands of a dyadic operatorshall be implementation-dependent..ISOperands are always evaluated, so the program part.XSif (p<>nil) and (p^.value<>0) then.XEis probably incorrect..PPThe left-hand operand of a dyadic operator is almost always evaluatedbefore the right-hand side.Some peculiar evaluations exist for the following cases:.IP 1.The modulo operation is performed by a library routine tocheck for negative values of the right operand..IP 2.The expression.XSset1 <= set2.XEwhere set1 and set2 are compatible set types is evaluated in thefollowing steps:.XS.ta +\w'\-  'u\-	evaluate set2;\-	evaluate set1;\-	compute set2+set1;\-	test set2 and set2+set1 for equality..DT.XE.IP 3.The expression.XSset1 >= set2.XEwhere set1 and set2 are compatible set types is evaluated in the following steps:.XS.ta +\w'\-  'u\-	evaluate set1;\-	evaluate set2;\-	compute set1+set2;\-	test set1 and set1+set2 for equality..DT.XE.IT 6.7.3The order of evaluation, accessing and bindingof the actual-parameters for functionsshall be implementation-dependent..ISThe order of evaluation is from right to left..IT 6.8.2.2The decision as to the order of accessing the variable and evaluatingthe expression in an assignment-statement, shall beimplementation-dependent..ISThe expression is evaluated first..IT 6.8.2.3The order of evaluation and binding of the actual-parameters for proceduresshall be implementation-dependent..ISThe same as for functions..IT 6.9.5The effect of inspecting a text file to which the pageprocedure was applied during generation isimplementation-dependent..ISThe formfeed character written by page istreated like a normal character, with ordinal value 12..IT 6.10The binding of the variables denoted by the program-parametersto entities external to the program shall be implementation-dependent unlessthe variable is of a file-type..ISOnly variables of a file-type are allowed as program parameters..in 0.SS "Error handling".PPThere are three classes of errors to be distinguished.In the first class are the error messages generated by the compiler.The second class consists of the occasional errors generated by the otherprograms involved in the compilation process.Errors of the third class are the errors as defined in the standard by:.PP.RSAn error is a violation by a program of the requirements of this standardthat a processor is permitted to leave undetected..RE.LP.ft ICompiler errors.PPError are written on the standard error output.Each line has the form:.XS<file>, line <number>: <description>.XEEvery time the compiler detects an error that does not have influenceon the code produced by the compiler or on the syntax decisions, a warningmessages is given.If only warnings are generated, compilation proceeds and probably resultsin a correctly compiled program..PPSometimes the compiler produces several errors for the same line.They are only shown up to a maximum of 5 errors per line.Warning are also shown up to a maximum of 5 per line..PPExtensive treatment of these errors is outside the scope of this manual..LP.ft IRuntime errors.PPErrors detected at run time cause an error message to be generated on thediagnostic output stream (UNIX file descriptor 2).The message consists of the name of the program followed by a messagedescribing the error, possibly followed by the source line number.Unless the \fI\(enn\fR option is turned on, the compiler generates code to keep trackof which source line causes which instructions to be generated..PPFor each error mentioned in the standard we give the section number,the quotation from that section and the way it is processed by thePascal-compiler or runtime system..PPFor detected errors the corresponding messageand trap number are given.Trap numbers are useful for exception-handling routines.Normally, each error causes the program to terminate.By using exception-handling routines one canignore errors or perform alternate actions.Only some of the errors can be ignoredby restarting the failing instruction.These errors are marked as non-fatal,all others as fatal.A list of errors with trap number between 0 and 63(EM errors) can be found in [2].Errors with trap number between 64 and 127 (Pascal errors) are listed below..IT 6.4.6It shall be an error if a value of type T2 must beassignment-compatible with type T1, whileT1 and T2 are compatible ordinal-types and the value oftype T2 is not in the closed interval specified by T1..ISThe compiler distinguishes between array-index expressions and the otherplaces where assignment-compatibility is required..PPArray subscripting errors are only detected when the 'A' option is used.In the other cases, a range bound error occurs when the value of type T2is not in the closed interval specified by T1, unless range checks aredisabled..IT 6.4.6It shall be an error if a value of type T2 must beassignment-compatible with type T1, while T1 and T2 are compatibleset-types and any member of the value of type T2is not in the closed interval specified by the base-typeof the type T1..ISThis error is not detected..IT 6.5.3.3It shall be an error if a component of a variant-part of a variant,where the selector of the variant-part is not a field,is accessed unless the variant is active for the entirety of eachreference and access to each component of the variant..ISThis error is not detected..IT 6.5.4It shall be an error ifthe pointer-variable of an identified-variable either denotes anil-value or is undefined..ISThis error is not detected..IT 6.5.4It shall be an error to remove the identifying-value of an identifiedvariable from its pointer-type when a reference to the variable exists..ISWhen the identified variable is an element of the record-variable-list ofa with-statement, a warning is given at compile-time.Otherwise, this error is not detected..IT 6.5.5It shall be an error to alter the value of a file-variable f when areference to the buffer-variable f^ exists..ISWhen f is altered when it is an element of the record-variable-list of awith-statement, a warning is given.When a buffer-variable is used as avariable-parameter, an error is given.This is done at compile-time..IT 6.6.5.2It shall be an error ifthe stated pre-assertion does not hold immediatelyprior to any use of the file handling proceduresrewrite, put, reset and get..ISFor each of these four operations the pre-assertionscan be reformulated as:.XS.ta +\w'rewrite(f):  'urewrite(f):	no pre-assertion.put(f):	f is opened for writing and f^ is not undefined.reset(f):	f exists.get(f):	f is opened for reading and eof(f) is false..DT.XEThe following errors are detected for these operations:.SPrewrite(f):.in +6.ti -3more args expected, trap 64, fatal:.brf is a program-parameter and the correspondingfile name is not supplied by the caller of the program..ti -3rewrite error, trap 101, fatal:.brthe caller of the program lacks the necessaryaccess rights to create the file in the file systemor operating system problems like table overflowprevent creation of the file..in -6.SPput(f):.in +6.ti -3file not yet open, trap 72, fatal:.brreset or rewrite are never applied to the file.The checks performed by the run time system are not foolproof..ti -3not writable, trap 96, fatal:.brf is opened for reading..ti -3write error, trap 104, fatal:.brprobably caused by file system problems.For instance, the file storage is exhausted.Because I/O is buffered to improve performance,it might happen that this error occurs if thefile is closed.Files are closed whenever they are rewritten or reset, or onprogram termination..in -6.SPreset(f):.in +6.ti -3more args expected, trap 64, fatal:.brsame as for rewrite(f)..ti -3reset error, trap 100, fatal:.brf does not exist, or the caller has insufficient access rights, oroperating system tables are exhausted..in -6.SPget(f):.in +6.ti -3file not yet open, trap 72, fatal:.bras for put(f)..ti -3not readable, trap 97, fatal:.brf is opened for writing..ti -3end of file, trap 98, fatal:.breof(f) is true just before the call to get(f)..ti -3read error, trap 103, fatal:.brunlikely to happen.Probably caused by hardware problemsor by errors elsewhere in your program that destroyedthe file information maintained by the run time system..ti -3truncated, trap 99, fatal:.brthe file is not properly formed by an integernumber of file elements.For instance, the size of a file of integer is odd.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?