DocAda(tm) is a productivity tool of KSCE

____ | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

A.1 The Package Standard

This clause outlines the specification of the package Standard containing all predefined identifiers in the language. The corresponding package body is not specified by the language.

The operators that are predefined for the types declared in the package Standard are given in comments since they are implicitly declared. Italics are used for pseudo-names of anonymous types (such as root_real) and for undefined information (such as implementation-defined).

Static Semantics

The library package Standard has the following declaration:

   
       package Standard is
          pragma Pure(Standard);

          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 predefined logical operators and the predefined logical
          -- negation operator are as follows:

          -- 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 integer type root_integer is predefined.
          -- The corresponding universal type is universal_integer.

          type Integer is range implementation-defined;

          subtype Natural  is Integer range 0 .. Integer'Last;
          subtype Positive is Integer range 1 .. Integer'Last;

          -- The predefined operators for type Integer are as follows:

          -- function "="  (Left, Right : Integer'Base) return Boolean;
          -- function "/=" (Left, Right : Integer'Base) return Boolean;
          -- function "<"  (Left, Right : Integer'Base) return Boolean;
          -- function "<=" (Left, Right : Integer'Base) return Boolean;
          -- function ">"  (Left, Right : Integer'Base) return Boolean;
          -- function ">=" (Left, Right : Integer'Base) return Boolean;

          -- function "+"   (Right : Integer'Base) return Integer'Base;
          -- function "-"   (Right : Integer'Base) return Integer'Base;
          -- function "abs" (Right : Integer'Base) return Integer'Base;

          -- function "+"   (Left, Right : Integer'Base) return Integer'Base;
          -- function "-"   (Left, Right : Integer'Base) return Integer'Base;
          -- function "*"   (Left, Right : Integer'Base) return Integer'Base;
          -- function "/"   (Left, Right : Integer'Base) return Integer'Base;
          -- function "rem" (Left, Right : Integer'Base) return Integer'Base;
          -- function "mod" (Left, Right : Integer'Base) return Integer'Base;

          -- function "**"  (Left : Integer'Base; Right : Natural) return Integer'Base;

          -- The specification of each operator for the type
          -- root_integer, or for any additional predefined integer
          -- type, is obtained by replacing Integer by the name of the type
          -- in the specification of the corresponding operator of the type
          -- Integer.  The right operand of the exponentiation operator
          -- remains as subtype Natural.

          -- The floating point type root_real is predefined.
          -- The corresponding universal type is universal_real.

          type Float is digits implementation-defined;

          -- 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'Base) return Float;

          -- The specification of each operator for the type  root_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 the root
          -- numeric types:

          function "*" (Left : root_integer; Right : root_real)
            return root_real;

          function "*" (Left : root_real;    Right : root_integer)
            return root_real;

          function "/" (Left : root_real;    Right : root_integer)
            return root_real;

          -- The type universal_fixed is predefined.
          -- The only multiplying operators defined between
          -- fixed point types are

          function "*" (Left : universal_fixed; Right : universal_fixed)
            return universal_fixed;

          function "/" (Left : universal_fixed; Right : universal_fixed)
            return universal_fixed;


             -- The declaration of type Character is based on the standard ISO 8859-1 character set.

             -- There are no character literals corresponding to the positions for control characters.
             -- They are indicated in italics in this definition.  See 3.5.2.

          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,


             reserved_128,     reserved_129,  bph,  nbh,
             reserved_132,     nel,     ssa,  esa,

             hts,  htj,  vts,  pld,     plu,  ri,   ss2,  ss3,

             dcs,  pu1,  pu2,  sts,     cch,  mw,   spa,  epa,

             sos, reserved_153, sci, csi,
             st,   osc,  pm,   apc,


       ... );

          -- The predefined operators for the type Character are the  same  as  for
          -- any enumeration type.


          -- The declaration of type Wide_Character is based on the standard ISO 10646 BMP character set.
          -- The first 256 positions have the same contents as type Character.  See 3.5.2.

          type Wide_Character is (nul, soh ... FFFE, FFFF);


          package ASCII is ... end ASCII;  --Obsolescent; see J.5



          -- Predefined string types:

          type String is array(Positive range <>) of Character;
          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 Wide_String is array(Positive range <>) of Wide_Character;
          pragma Pack(Wide_String);

          -- The predefined operators for this type correspond to those for 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;
          Program_Error   : exception;
          Storage_Error   : exception;
          Tasking_Error   : exception;

       end Standard;

Standard has no private part.

In each of the types Character and Wide_Character, the character literals for the space character (position 32) and the non-breaking space character (position 160) correspond to different values. Unless indicated otherwise, each occurrence of the character literal ' ' in this International Standard refers to the space character. Similarly, the character literals for hyphen (position 45) and soft hyphen (position 173) correspond to different values. Unless indicated otherwise, each occurrence of the character literal '-' in this International Standard refers to the hyphen character.

Dynamic Semantics

Elaboration of the body of Standard has no effect.

Implementation Permissions

An implementation may provide additional predefined integer types and additional predefined floating point types. Not all of these types need have names.

Implementation Advice

If an implementation provides additional named predefined integer types, then the names should end with ``Integer'' as in ``Long_Integer''. If an implementation provides additional named predefined floating point types, then the names should end with ``Float'' as in ``Long_Float''.

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
____ | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com