-- $Header: /ct/interp/stdpkg.ada,v 1.36 84/09/12 20:12:16 penny Exp $ -- -- This package corresponds to the functionality of the standard package -- as described in Appendix C of the Ada Language Reference Manual -- ANSI/MIL-STD 1815A. There are differences in the text due to the -- Interpreter bootstrapping process. package STANDARD is -- type FILE_MODE is (IN_FILE, OUT_FILE); -- for Text_io and Sequential_io -- type BOOLEAN is (FALSE, TRUE); --The predefined relational operators for this type are as follows: function "=" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; -- function "/="(LEFT, RIGHT: BOOLEAN) return BOOLEAN; function "<" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; function "<="(LEFT, RIGHT: BOOLEAN) return BOOLEAN; function ">" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; function ">="(LEFT, RIGHT: BOOLEAN) return BOOLEAN; --The logical operators and the logical negaton operator are --explicitly declared: function "and" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; function "or" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; function "xor" (LEFT, RIGHT: BOOLEAN) return BOOLEAN; function "not" (RIGHT: BOOLEAN) return BOOLEAN; --The universal type universal integer is predefined. -- type INTEGER is implementation defined; -- This is predefined, however look at the declaration for the -- subtype INTEGER. --The predefined operators for this type are as follows: -- function "=" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function "/=" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function "<" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function "<=" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function ">" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function ">=" (LEFT, RIGHT : INTEGER) return BOOLEAN; -- function "+" (RIGHT : INTEGER) return INTEGER; -- function "-" (RIGHT : INTEGER) return INTEGER; -- function "abs"(RIGHT : INTEGER) return INTEGER; -- function "+" (LEFT, RIGHT: INTEGER) return INTEGER; -- function "-" (LEFT, RIGHT: INTEGER) return INTEGER; -- function "*" (LEFT, RIGHT: INTEGER) return INTEGER; -- function "/" (LEFT, RIGHT: INTEGER) return INTEGER; -- function "rem"(LEFT, RIGHT: INTEGER) return INTEGER; -- function "mod"(LEFT, RIGHT: INTEGER) return INTEGER; -- function "**" (LEFT: INTEGER; RIGHT: INTEGER) return INTEGER; subtype INTEGER is INTEGER range -4294967296 ..4294967295;--(-2**32 .. 2**32-1); -- This is to provide the appropiate ranges for the INTEGER type --An implementation may provide additional predefined integer types. --It is recommended that the names of such additional types end with --INTEGER as in SHORT_INTEGER or LONG_INTEGER. The specification of --each operator for the type universal integer, or for any additional --predefined integer type, is obtained by replacing INTEGER by the name --of the type in the right operand of the exponentiating operator. --The universal type universal real is predefined. -- type FLOAT is implementation defined; -- This is predefined, however look at the declaration for the -- subtype FLOAT. --The predefined operators for this type are as follows: -- function "=" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function "/=" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function "<" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function "<=" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function ">" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function ">=" (LEFT, RIGHT: FLOAT) return BOOLEAN; -- function "+" (RIGHT: FLOAT) return FLOAT; -- function "-" (RIGHT: FLOAT) return FLOAT; -- function "abs" (RIGHT: FLOAT) return FLOAT; -- function "+" (LEFT, RIGHT: FLOAT) return FLOAT; -- function "-" (LEFT, RIGHT: FLOAT) return FLOAT; -- function "*" (LEFT, RIGHT: FLOAT) return FLOAT; -- function "/" (LEFT, RIGHT: FLOAT) return FLOAT; -- function "**" (LEFT: FLOAT; RIGHT: INTEGER) return FLOAT; subtype FLOAT is FLOAT range -3.40281*10.0**38 .. 3.40281*10.0**38-1.0; --An implementation may provide additional predefined floating point --types. It is recommended that the names of such additional types --end with FLOAT as in SHORT_FLOAT or LONG_FLOAT. The specification --of each operator for the type universal real, or for any additional --predefined floating point type, is obtained by replacing FLOAT by the --name of the type in the specification of the corresponding operator --of the type FLOAT. --In addition the following operators are predefined for universal types: --function "*" (LEFT: universal integer; RIGHT: universal real) --return universal real; --function "*" (LEFT: universal real; RIGHT: universal integer) --return universal real; --function "/" (LEFT: universal real; RIGHT: universal integer) --return universal real; --The type universal fixed is predefined. The only operators declared for --this type are: --function "*" (LEFT: any fixed point type; RIGHT: any fixed point --type) return universal fixed; --function "/" (LEFT: any fixed point type; RIGHT: any fixed point --type) return universal fixed; --The following characters form the standard ASCII character set. --Character literals corresponding to control characters are not --identifiers; they are indicated in italics in this definition. type CHARACTER is (nul, soh, stx, etx, eot, enq, ack, bel, bs, ht, lf, vt, ff, cr, so, si, dle, dc1, dc2, dc3, dc4, nak, syn, etb, can, em, sub, esc, fs, gs, rs, us, ' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', del); for CHARACTER use -- 128 ASCII character set without holes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127); --The predefined operators for the type CHARACTER are the same as for --any enumeration type. package ASCII is -- Control characters: NUL :constant CHARACTER:=nul; SOH :constant CHARACTER:=soh; STX :constant CHARACTER:=stx; ETX :constant CHARACTER:=etx; EOT :constant CHARACTER:=eot; ENQ :constant CHARACTER:=enq; ACK :constant CHARACTER:=ack; BEL :constant CHARACTER:=bel; BS :constant CHARACTER:=bs; HT :constant CHARACTER:=ht; LF :constant CHARACTER:=lf; VT :constant CHARACTER:=vt; FF :constant CHARACTER:=ff; CR :constant CHARACTER:=cr; SO :constant CHARACTER:=so; SI :constant CHARACTER:=si; DLE :constant CHARACTER:=dle; DC1 :constant CHARACTER:=dc1; DC2 :constant CHARACTER:=dc2; DC3 :constant CHARACTER:=dc3; DC4 :constant CHARACTER:=dc4; NAK :constant CHARACTER:=nak; SYN :constant CHARACTER:=syn; ETB :constant CHARACTER:=etb; CAN :constant CHARACTER:=can; EM :constant CHARACTER:=em; SUB :constant CHARACTER:=sub; ESC :constant CHARACTER:=esc; FS :constant CHARACTER:=fs; GS :constant CHARACTER:=gs; RS :constant CHARACTER:=rs; US :constant CHARACTER:=us; DEL :constant CHARACTER:=del; -- -- --Other characters: -- EXCLAM :constant CHARACTER:= '!'; QUOTATION :constant CHARACTER:='"'; SHARP :constant CHARACTER:= '#'; DOLLAR :constant CHARACTER:='$'; PERCENT :constant CHARACTER:= '%'; AMPERSAND :constant CHARACTER:='&'; COLON :constant CHARACTER:= ':'; SEMICOLON :constant CHARACTER:=';'; QUERY :constant CHARACTER:= '?'; AT_SIGN :constant CHARACTER:='@'; L_BRACKET :constant CHARACTER:= '['; BACK_SLASH:constant CHARACTER:='/'; R_BRACKET :constant CHARACTER:= ']'; CIRCUMFLEX:constant CHARACTER:='^'; UNDERLINE :constant CHARACTER:= '_'; GRAVE :constant CHARACTER:='`'; L_BRACE :constant CHARACTER:= '{'; BAR :constant CHARACTER:='\'; R_BRACE :constant CHARACTER:= '}'; TILDE :constant CHARACTER:='~'; -- --Lower case Letters: -- LC_A : constant CHARACTER:='a'; LC_B : constant CHARACTER:='b'; LC_C : constant CHARACTER:='c'; LC_D : constant CHARACTER:='d'; LC_E : constant CHARACTER:='e'; LC_F : constant CHARACTER:='f'; LC_G : constant CHARACTER:='g'; LC_H : constant CHARACTER:='h'; LC_I : constant CHARACTER:='i'; LC_J : constant CHARACTER:='j'; LC_K : constant CHARACTER:='k'; LC_L : constant CHARACTER:='l'; LC_M : constant CHARACTER:='m'; LC_N : constant CHARACTER:='n'; LC_O : constant CHARACTER:='o'; LC_P : constant CHARACTER:='p'; LC_Q : constant CHARACTER:='q'; LC_R : constant CHARACTER:='r'; LC_S : constant CHARACTER:='s'; LC_T : constant CHARACTER:='t'; LC_U : constant CHARACTER:='u'; LC_V : constant CHARACTER:='v'; LC_W : constant CHARACTER:='w'; LC_X : constant CHARACTER:='x'; LC_Y : constant CHARACTER:='y'; LC_Z : constant CHARACTER:='z'; end ASCII; -- --Predefined subtypes: subtype NATURAL is INTEGER range 0 .. INTEGER'LAST; subtype POSITIVE is INTEGER range 1 .. INTEGER'LAST; -- --Predefined string type: type STRING is array (POSITIVE RANGE <>) of CHARACTER; -- type STRING is array (INTEGER RANGE <>) of CHARACTER; --this is wrong pragma PACK (STRING); -- The predefined operators for this type are as follows: function "=" (LEFT, RIGHT : STRING) return BOOLEAN; -- function "/=" (LEFT, RIGHT : STRING) return BOOLEAN; function "<" (LEFT, RIGHT : STRING) return BOOLEAN; function "<=" (LEFT, RIGHT : STRING) return BOOLEAN; function ">" (LEFT, RIGHT : STRING) return BOOLEAN; function ">=" (LEFT, RIGHT : STRING) return BOOLEAN; function "&" (LEFT: STRING; RIGHT: STRING) return STRING; function "&" (LEFT: CHARACTER; RIGHT: STRING) return STRING; function "&" (LEFT: STRING; RIGHT: CHARACTER) return STRING; function "&" (LEFT: CHARACTER; RIGHT: CHARACTER) return STRING; -- type DURATION is delta implementation defined range implementation defined; --The predefined operators for the type duration are the same as for any --fixed point type. --The predefined exceptions: CONSTRAINT_ERROR : exception; NUMERIC_ERROR : exception; PROGRAM_ERROR : exception; STORAGE_ERROR : exception; TASKING_ERROR : exception; end STANDARD;