home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / lrm / chap08.doc < prev    next >
Encoding:
Text File  |  1988-05-03  |  40.8 KB  |  1,586 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. The following document is a draft  of  the  corresponding  chapter  of  the
  7. version  of  the  Ada  Reference  Manual  produced  in response to the Ansi
  8. Canvass.  It is given a limited circulation  to  Ada  implementers  and  to
  9. other groups contributing comments (according to the conventions defined in
  10. RRM.comments).  This draft should not be referred to in any publication.
  11.  
  12.  
  13.  
  14.                       ANSI-RM-08-v23 - Draft Chapter
  15.  
  16.                             8  Visibility Rules
  17.                                 version 23
  18.  
  19.                                  83-02-11
  20.  
  21. This version has addressed comments up to #5795
  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.                             8. Visibility Rules
  78.  
  79.  
  80.  
  81. The  rules  defining the scope of declarations and the rules defining which
  82. identifiers are visible at various points in the text of  the  program  are
  83. described  in this chapter.  The formulation of these rules uses the notion
  84. of a declarative region.
  85.  
  86. References:  declaration 3.1, declarative region 8.1, identifier 2.3, scope
  87. 8.2, visibility 8.3
  88.  
  89.  
  90.  
  91. 8.1  Declarative Region
  92.  
  93.  
  94. A  declarative  region  is  a  portion  of  the  program  text.   A  single
  95. declarative region is formed by the text of each of the following:
  96.  
  97.   -  A subprogram declaration, a package declaration, a  task  declaration,
  98.      or  a  generic  declaration,  together with the corresponding body, if
  99.      any.  If the body is a body stub, the declarative region also includes
  100.      the corresponding subunit.  If the program unit has subunits, they are
  101.      also included.
  102.  
  103.   -  An  entry  declaration  together   with   the   corresponding   accept
  104.      statements.
  105.  
  106.   -  A record type declaration, together with a  corresponding  private  or
  107.      incomplete  type declaration if any, and together with a corresponding
  108.      record representation clause if any.
  109.  
  110.   -  A renaming declaration that includes  a  formal  part,  or  a  generic
  111.      parameter  declaration  that  includes  either  a  formal  part  or  a
  112.      discriminant part.
  113.  
  114.   -  A block statement or a loop statement.
  115.  
  116. In each of the above cases, the declarative region is said to be associated
  117. with the corresponding declaration or statement.  A declaration is said  to
  118. occur  immediately  within  a  declarative  region  if  this  region is the
  119. innermost  region  that  encloses  the  declaration,   not   counting   the
  120. declarative region (if any) associated with the declaration itself.
  121.  
  122. A  declaration  that occurs immediately within a declarative region is said
  123. to be local to the region.  Declarations in outer (enclosing)  regions  are
  124. said  to  be  global  to  an  inner (enclosed) declarative region.  A local
  125. entity is one declared by a local declaration;   a  global  entity  is  one
  126. declared by a global declaration.
  127.  
  128.  
  129.                                    8 - 1
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. Some  of  the  above  forms  of declarative region include several disjoint
  139. parts (for example, other declarative items can be between the  declaration
  140. of  a  package  and  its  body).   Each  declarative region is nevertheless
  141. considered as a (logically) continuous portion of the program text.   Hence
  142. if  any  rule defines  a portion of text as the text that extends from some
  143. specific point of a declarative region to the end of this region, then this
  144. portion is the corresponding subset of the declarative region (for  example
  145. it does not include intermediate declarative items between the two parts of
  146. a package).
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                    8 - 2
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. Notes:
  206.  
  207. As   defined   in   section   3.1,  the  term  declaration  includes  basic
  208. declarations, implicit declarations, and those declarations that  are  part
  209. of   basic   declarations,   for   example,   discriminant   and  parameter
  210. specifications.  It follows from the definition  of  a  declarative  region
  211. that  a  discriminant  specification  occurs  immediately within the region
  212. associated with  the  enclosing  record  type  declaration.   Similarly,  a
  213. parameter  specification  occurs  immediately  within the region associated
  214. with the enclosing subprogram body or accept statement.
  215.  
  216. The package STANDARD forms a declarative region which encloses all  library
  217. units:   the  implicit declaration of each library unit is assumed to occur
  218. immediately within this package (see sections 8.6 and 10.1.1).
  219.  
  220. Declarative regions can be nested within other  declarative  regions.   For
  221. example,  subprograms,  packages,  task  units,  generic  units,  and block
  222. statements can be nested within each other, and  can  contain  record  type
  223. declarations, loop statements, and accept statements.
  224.  
  225. References:   accept  statement 9.5, basic declaration 3.1, block statement
  226. 5.6, body stub 10.2, declaration 3.1, discriminant part 3.7.1, discriminant
  227. specification 3.7.1, entry declaration 9.5, formal part 6.1,  generic  body
  228. 12.2,   generic  declaration  12.1,  generic  parameter  declaration  12.1,
  229. implicit declaration 3.1, incomplete type declaration 3.8.1,  library  unit
  230. 10.1,  loop statement 5.5, package 7, package body 7.1, package declaration
  231. 7.1, parameter specification 6.1,  private  type  declaration  7.4,  record
  232. representation  clause  13.4,  record  type  3.7, renaming declaration 8.5,
  233. standard package 8.6, subprogram  body  6.3,  subprogram  declaration  6.1,
  234. subunit 10.2, task body 9.1, task declaration 9.1, task unit 9
  235.  
  236.  
  237.  
  238.  
  239. 8.2  Scope of Declarations
  240.  
  241.  
  242. For  each  form of declaration, the language rules define a certain portion
  243. of the program text called the scope of the declaration.  The  scope  of  a
  244. declaration  is  also  called  the  scope  of  any  entity  declared by the
  245. declaration.  Furthermore, if the declaration associates some notation with
  246. a declared entity, this portion of the text is also  called  the  scope  of
  247. this  notation  (either  an  identifier,  a  character literal, an operator
  248. symbol, or the notation for a basic operation).  Within  the  scope  of  an
  249. entity,  and  only  there,  there  are  places where it is legal to use the
  250. associated notation in order to refer to the declared entity.  These places
  251. are defined by the rules of visibility and overloading.
  252.  
  253. The scope of a declaration that occurs  immediately  within  a  declarative
  254. region  extends  from  the  beginning  of the declaration to the end of the
  255. declarative region;  this part of the scope of a declaration is called  the
  256. immediate  scope.   Furthermore,  for any of the declarations listed below,
  257. the scope of the declaration extends beyond the immediate scope:
  258.  
  259.  
  260.  
  261.                                    8 - 3
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270. (a)  A declaration that occurs immediately within the  visible  part  of  a
  271.      package declaration.
  272.  
  273. (b)  An entry declaration.
  274.  
  275. (c)  A component declaration.
  276.  
  277. (d)  A discriminant specification.
  278.  
  279. (e)  A parameter specification.
  280.  
  281. (f)  A generic parameter declaration.
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                    8 - 4
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. In  each  of  these  cases, the given declaration occurs immediately within
  337. some enclosing declaration, and the scope of the given declaration  extends
  338. to the end of the scope of the enclosing declaration.
  339.  
  340. In  the  absence  of a subprogram declaration, the subprogram specification
  341. given in the subprogram body or in the body stub acts  as  the  declaration
  342. and rule (e) applies also in such a case.
  343.  
  344. Note:
  345.  
  346. The  above scope rules apply to all forms of declaration defined by section
  347. 3.1;  in particular, they apply also to implicit  declarations.   Rule  (a)
  348. applies  to a package declaration and thus not to the package specification
  349. of a generic declaration.  For nested declarations, the rules  (a)  through
  350. (f)  apply  at  each level.  For example, if a task unit is declared in the
  351. visible part of a package, the scope of an entry of the task  unit  extends
  352. to  the end of the scope of the task unit, that is, to the end of the scope
  353. of the enclosing package.  The scope of a use clause is defined in  section
  354. 8.4.
  355.  
  356.  
  357. References:   basic operation 3.3.3, body stub 10.2, character literal 2.5,
  358. component  declaration  3.7,  declaration  3.1,  declarative  region   8.1,
  359. discriminant  specification  3.7.1,  entry  declaration  9.5,  extends 8.1,
  360. generic declaration 12.1, generic parameter  declaration  12.1,  identifier
  361. 2.3,  implicit  declaration  3.1,  occur  immediately  within 8.1, operator
  362. symbol  6.1,  overloading  6.6  8.7,  package  declaration   7.1,   package
  363. specification  7.1,  parameter specification 6.1, record type 3.7, renaming
  364. declaration 8.5, subprogram body  6.3,  subprogram  declaration  6.1,  task
  365. declaration  9.1,  task  unit  9,  type  declaration 3.3.1, use clause 8.4,
  366. visibility 8.3, visible part 7.2
  367.  
  368.  
  369.  
  370.  
  371. 8.3  Visibility
  372.  
  373.  
  374. The meaning of the occurrence of an identifier at a given place in the text
  375. is defined by the visibility rules and also,  in  the  case  of  overloaded
  376. declarations, by the overloading rules.  The identifiers considered in this
  377. chapter  include  any  identifier  other than a reserved word, an attribute
  378. designator, a pragma identifier, the identifier of a pragma argument, or an
  379. identifier given as a pragma  argument.   The  places  considered  in  this
  380. chapter  are  those where a lexical element (such as an identifier) occurs.
  381. The overloaded declarations  considered  in  this  chapter  are  those  for
  382. subprograms, enumeration literals, and single entries.
  383.  
  384. For  each  identifier  and  at each place in the text, the visibility rules
  385. determine a set of declarations (with this identifier) that define possible
  386. meanings of an occurrence of the identifier.  A declaration is said  to  be
  387. visible  at  a  given  place  in the text when, according to the visibility
  388. rules, the declaration defines a possible meaning of this occurrence.   Two
  389. cases arise.
  390.  
  391.  
  392.  
  393.                                    8 - 5
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.   -  The visibility rules determine at most one possible meaning.  In  such
  403.      a   case   the  visibility  rules  are  sufficient  to  determine  the
  404.      declaration defining the meaning of the occurrence of the  identifier,
  405.      or  in  the  absence  of  such  a  declaration,  to determine that the
  406.      occurrence is not legal at the given point.
  407.  
  408.   -  The visibility rules determine more than  one  possible  meaning.   In
  409.      such a case the occurrence of the identifier is legal at this point if
  410.      and  only  if  exactly  one  visible declaration is acceptable for the
  411.      overloading rules in the given context (see section 6.6 for the  rules
  412.      of  overloading  and  section  8.7  for  the context used for overload
  413.      resolution).
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                    8 - 6
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468. A declaration is only visible within a certain part  of  its  scope;   this
  469. part   starts   at   the  end  of  the  declaration  except  in  a  package
  470. specification, in which case it starts at the reserved word is given  after
  471. the  identifier  of  the  package  specification.   (This  rule applies, in
  472. particular, for implicit declarations.)
  473.  
  474. Visibility is either by selection or direct.  A declaration is  visible  by
  475. selection at places that are defined as follows.
  476.  
  477. (a)  For a declaration given in the visible part of a package  declaration:
  478.      at  the  place of the selector after the dot of an expanded name whose
  479.      prefix denotes the package.
  480.  
  481. (b)  For an entry declaration of a given task type:  at the  place  of  the
  482.      selector  after  the  dot  of  a  selected  component  whose prefix is
  483.      appropriate for the task type.
  484.  
  485. (c)  For a component declaration of a given record  type  declaration:   at
  486.      the  place of the selector after the dot of a selected component whose
  487.      prefix is appropriate for the type;  also at the place of a  component
  488.      simple  name  (before  the compound delimiter =>) in a named component
  489.      association of an aggregate of the type.
  490.  
  491. (d)  For a discriminant specification of a given type declaration:  at  the
  492.      same  places  as  for a component declaration;  also at the place of a
  493.      discriminant simple name (before the compound delimiter =>) in a named
  494.      discriminant association of a discriminant constraint for the type.
  495.  
  496. (e)  For a parameter specification of a given subprogram  specification  or
  497.      entry  declaration:   at the place of the formal parameter (before the
  498.      compound  delimiter  =>)  in  a  named  parameter  association  of   a
  499.      corresponding subprogram or entry call.
  500.  
  501. (f)  For a generic parameter declaration of a given generic unit:   at  the
  502.      place  of  the generic formal parameter (before the compound delimiter
  503.      =>)  in  a  named  generic  association  of  a  corresponding  generic
  504.      instantiation.
  505.  
  506. Finally,  within  the  declarative region associated with a construct other
  507. than a record type declaration, any  declaration  that  occurs  immediately
  508. within  the  region  is  visible  by selection at the place of the selector
  509. after the dot of an expanded name whose prefix denotes the construct.
  510.  
  511. Where it is not visible by selection, a visible declaration is said  to  be
  512. directly  visible.  A declaration is directly visible within a certain part
  513. of its immediate scope;  this part extends to  the  end  of  the  immediate
  514. scope  of  the  declaration,  but  excludes places where the declaration is
  515. hidden  as  explained  below.   In  addition,   a   declaration   occurring
  516. immediately  within  the  visible  part  of  a package can be made directly
  517. visible by means of a use  clause  according  to  the  rules  described  in
  518. section  8.4.   (See also section 8.6 for the visibility of library units.)
  519.  
  520. A declaration is said to be hidden within (part of)  an  inner  declarative
  521. region  if  the inner region contains a homograph of this declaration;  the
  522. outer declaration is then hidden within the immediate scope  of  the  inner
  523.  
  524.  
  525.                                    8 - 7
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534. homograph.  Each of two declarations is said to be a homograph of the other
  535. if  both  declarations  have the same identifier and overloading is allowed
  536. for  at  most  one  of  the  two.   If  overloading  is  allowed  for  both
  537. declarations, then each of the two is a homograph of the other if they have
  538. the  same identifier, operator symbol, or character literal, as well as the
  539. same parameter and result type profile (see 6.6).
  540.  
  541. Within the specification of a subprogram, every declaration with  the  same
  542. designator  as  the  subprogram is hidden;  the same holds within a generic
  543. instantiation that declares a subprogram, and within an  entry  declaration
  544. or  the formal part of an accept statement;  where hidden in this manner, a
  545. declaration is visible neither by selection  nor directly.
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                    8 - 8
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600. Two declarations that occur immediately within the same declarative  region
  601. must not be homographs, unless either or both of the following requirements
  602. are  met:   (a)  exactly  one  of  them  is  the  implicit declaration of a
  603. predefined operation;  (b) exactly one of them is the implicit  declaration
  604. of  a  derived subprogram.  In such cases, a predefined operation is always
  605. hidden by the other homograph;  a derived  subprogram  hides  a  predefined
  606. operation,  but  is  hidden  by  any other homograph.  Where hidden in this
  607. manner, an implicit declaration is hidden within the entire  scope  of  the
  608. other  declaration  (regardless  of  which  declaration occurs first);  the
  609. implicit declaration is visible neither by selection nor directly.
  610.  
  611. Whenever a declaration with a certain identifier is visible  from  a  given
  612. point,  the identifier and the declared entity (if any) are also said to be
  613. visible from that point.  Direct visibility and visibility by selection are
  614. likewise defined for character literals and operator symbols.  An  operator
  615. is  directly  visible if and only if the corresponding operator declaration
  616. is directly  visible.   Finally,  the  notation  associated  with  a  basic
  617. operation is directly visible within the entire scope of this operation.
  618.  
  619. Example:
  620.  
  621.     procedure P is
  622.        A, B : BOOLEAN;
  623.  
  624.        procedure Q is
  625.           C : BOOLEAN;
  626.           B : BOOLEAN;  --  an inner homograph of B
  627.        begin
  628.           ...
  629.           B := A;    --  means Q.B := P.A;
  630.           C := P.B;  --  means Q.C := P.B;
  631.        end;
  632.     begin
  633.        ...
  634.        A := B;  --  means P.A := P.B;
  635.     end;
  636.  
  637. Note on the visibility of library units:
  638.  
  639. The  visibility of library units is determined by with clauses (see 10.1.1)
  640. and by the fact that library units are implicitly declared in  the  package
  641. STANDARD (see 8.6).
  642.  
  643. Note on homographs:
  644.  
  645. The  same  identifier  may  occur in different declarations and may thus be
  646. associated  with  different  entities,  even  if  the   scopes   of   these
  647. declarations  overlap.  Overlap of the scopes of declarations with the same
  648. identifier can result from overloading of subprograms  and  of  enumeration
  649. literals.   Such  overlaps  can also occur for entities declared in package
  650. visible parts and for entries, record  components,  and  parameters,  where
  651. there  is overlap of the scopes of the enclosing package declarations, task
  652. declarations, record type declarations, subprogram  declarations,  renaming
  653. declarations,  or  generic  declarations.   Finally  overlapping scopes can
  654. result from nesting.
  655.  
  656.  
  657.                                    8 - 9
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666. Note on immediate scope, hiding, and visibility:
  667.  
  668. The rules defining immediate scope, hiding, and  visibility  imply  that  a
  669. reference  to  an  identifier within its own declaration is illegal (except
  670. for packages and generic packages).  The identifier hides outer  homographs
  671. within  its  immediate  scope, that is,  from the start of the declaration;
  672. on the other hand, the identifier is visible only  after  the  end  of  the
  673. declaration.    For  this  reason,  all  but  the  last  of  the  following
  674. declarations are illegal:
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                   8 - 10
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.     K : INTEGER := K * K;              --  illegal
  733.     T : T;                             --  illegal
  734.     procedure P(X : P);                --  illegal
  735.     procedure Q(X : REAL := Q);        --  illegal, even if there is a function named Q
  736.     procedure R(R : REAL);   --  an inner declaration is legal (although confusing)
  737.  
  738. References:  accept statement 9.5, aggregate 4.3, appropriate  for  a  type
  739. 4.1,  argument 2.8, basic operation 3.3.3, character literal 2.5, component
  740. association  4.3,  component  declaration  3.7,  compound  delimiter   2.2,
  741. declaration  3.1,  declarative  region  8.1,  designate  3.8,  discriminant
  742. constraint 3.7.2, discriminant specification 3.7.1, entry call  9.5,  entry
  743. declaration 9.5, entry family 9.5, enumeration literal specification 3.5.1,
  744. expanded name 4.1.3, extends 8.1, formal parameter 6.1, generic association
  745. 12.3,  generic  formal  parameter 12.1, generic instantiation 12.3, generic
  746. package  12.1,  generic  parameter  declaration  12.1,  generic  unit   12,
  747. identifier  2.3,  immediate  scope  8.2,  implicit declaration 3.1, lexical
  748. element 2.2, library unit 10.1, object 3.2, occur immediately  within  8.1,
  749. operator  4.5,  operator  symbol  6.1,  overloading  6.6  8.7,  package  7,
  750. parameter 6.2, parameter  association  6.4,  parameter  specification  6.1,
  751. pragma  2.8, program unit 6, record type 3.7, reserved word 2.9, scope 8.2,
  752. selected component 4.1.3, selector 4.1.3, simple name  4.1,  subprogram  6,
  753. subprogram  call  6.4, subprogram declaration 6.1, subprogram specification
  754. 6.1, task type 9.1, task unit 9, type  3.3,  type  declaration  3.3.1,  use
  755. clause 8.4, visible part 7.2
  756.  
  757.  
  758.  
  759.  
  760. 8.4  Use Clauses
  761.  
  762.  
  763. A  use clause achieves direct visibility of declarations that appear in the
  764. visible parts of named packages.
  765.  
  766.     use_clause ::= use package_name {, package_name};
  767.  
  768. For each use clause, there is a certain region of text called the scope  of
  769. the use clause.  This region starts immediately after the use clause.  If a
  770. use  clause  is a declarative item of some declarative region, the scope of
  771. the clause extends to the end of the declarative region.  If a  use  clause
  772. occurs  within a context clause of a compilation unit, the scope of the use
  773. clause extends to the end of the declarative  region  associated  with  the
  774. compilation unit.
  775.  
  776. In  order to define which declarations are made directly visible at a given
  777. place by use clauses, consider the set of packages named by all use clauses
  778. whose scopes enclose this place, omitting from this set any  packages  that
  779. enclose  this  place.  A declaration that can be made directly visible by a
  780. use clause (a potentially visible  declaration)  is  any  declaration  that
  781. occurs  immediately  within  the  visible  part of a package of the set.  A
  782. potentially visible declaration is actually made directly visible except in
  783. the following two cases:
  784.  
  785.   -  A potentially visible declaration is not made directly visible if  the
  786.      place  considered  is within the immediate scope of a homograph of the
  787.  
  788.  
  789.                                   8 - 11
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.      declaration.
  799.  
  800.   -  Potentially visible declarations that have the same identifier are not
  801.      made directly visible unless each of them  is  either  an  enumeration
  802.      literal  specification  or  the  declaration  of  a  subprogram  (by a
  803.      subprogram   declaration,   a   renaming   declaration,   a    generic
  804.      instantiation, or an implicit declaration).
  805.  
  806. The elaboration of a use clause has no other effect.
  807.  
  808. Note:
  809.  
  810. The  above rules guarantee that a declaration that is made directly visible
  811. by a use clause cannot hide an otherwise directly visible declaration.  The
  812. above rules are formulated in terms of the set of  packages  named  by  use
  813. clauses.
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                   8 - 12
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864. Consequently,  the  following  lines  of  text  all  have  the  same effect
  865. (assuming only one package P).
  866.  
  867.     use P;
  868.     use P; use P, P;
  869.  
  870. Example of conflicting names in two packages:
  871.  
  872.     procedure R is
  873.        package TRAFFIC is
  874.           type COLOR is (RED, AMBER, GREEN);
  875.           ...
  876.        end TRAFFIC;
  877.  
  878.        package WATER_COLORS is
  879.           type COLOR is (WHITE, RED, YELLOW, GREEN, BLUE, BROWN, BLACK);
  880.           ...
  881.        end WATER_COLORS;
  882.  
  883.        use TRAFFIC;       --  COLOR, RED, AMBER, and GREEN are directly visible
  884.        use WATER_COLORS;  --  two homographs of GREEN are directly visible
  885.                           --  but COLOR is no longer directly visible
  886.  
  887.        subtype LIGHT is TRAFFIC.COLOR;      -- Subtypes are used to resolve
  888.        subtype SHADE is WATER_COLORS.COLOR; -- the conflicting type name COLOR
  889.  
  890.        SIGNAL : LIGHT;
  891.        PAINT  : SHADE;
  892.     begin
  893.        SIGNAL := GREEN;  --  that of TRAFFIC
  894.        PAINT  := GREEN;  --  that of WATER_COLORS
  895.     end R;
  896.  
  897. Example of name identification with a use clause:
  898.  
  899.        package D is
  900.           T, U, V : BOOLEAN;
  901.        end D;
  902.  
  903.        procedure P is
  904.           package E is
  905.              B, W, V : INTEGER;
  906.           end E;
  907.  
  908.           procedure Q is
  909.              T, X : REAL;
  910.              use D, E;
  911.           begin
  912.              --  the name T means Q.T, not D.T
  913.              --  the name U means D.U
  914.              --  the name B means E.B
  915.              --  the name W means E.W
  916.              --  the name X means Q.X
  917.              --  the name V is illegal : either D.V or E.V must be used
  918.              ...
  919.  
  920.  
  921.                                   8 - 13
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.           end Q;
  931.        begin
  932.           ...
  933.        end P;
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                   8 - 14
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996. References:  compilation unit 10.1, context clause 10.1,  declaration  3.1,
  997. declarative  item  3.9,  declarative  region  8.1,  direct  visibility 8.3,
  998. elaboration 3.1 3.9, elaboration  has  no  other  effect  3.1,  enumeration
  999. literal  specification  3.5.1,  extends  8.1,  hiding  8.3,  homograph 8.3,
  1000. identifier 2.3, immediate scope 8.2, name  4.1,  occur  immediately  within
  1001. 8.1, package 7, scope 8.2, subprogram declaration 6.1, visible part 7.2
  1002.  
  1003.  
  1004.  
  1005.  
  1006. 8.5  Renaming Declarations
  1007.  
  1008.  
  1009. A renaming declaration declares another name for an entity.
  1010.  
  1011.     renaming_declaration ::=
  1012.          identifier : type_mark   renames object_name;
  1013.        | identifier : exception   renames exception_name;
  1014.        | package identifier       renames package_name;
  1015.        | subprogram_specification renames subprogram_or_entry_name;
  1016.  
  1017. The  elaboration  of a renaming declaration evaluates the name that follows
  1018. the reserved word renames and thereby determines the entity denoted by this
  1019. name (the renamed entity).  At any point where a  renaming  declaration  is
  1020. visible, the identifier, or operator symbol of this declaration denotes the
  1021. renamed entity.
  1022.  
  1023. The first form of renaming declaration is used for the renaming of objects.
  1024. The  renamed  entity  must  be an object of the base type of the type mark.
  1025. The properties of the renamed object  are  not  affected  by  the  renaming
  1026. declaration.   In particular, its value and whether or not it is a constant
  1027. are unaffected;  similarly, the constraints that apply to an object are not
  1028. affected by renaming (any constraint  implied  by  the  type  mark  of  the
  1029. renaming  declaration  is ignored).  The renaming declaration is legal only
  1030. if exactly one object has this type and can be denoted by the object  name.
  1031.  
  1032. The  following  restrictions  apply  to the renaming of a subcomponent that
  1033. depends on discriminants of a variable.  The renaming is not allowed if the
  1034. subtype of the variable, as defined in a corresponding object  declaration,
  1035. component declaration, or component subtype indication, is an unconstrained
  1036. type;   or  if  the  variable  is a generic formal object (of mode in out).
  1037. Similarly if the variable is  a  formal  parameter,  the  renaming  is  not
  1038. allowed  if  the  type mark given in the parameter specification denotes an
  1039. unconstrained type whose discriminants have default expressions.
  1040.  
  1041. The second form of  renaming  declaration  is  used  for  the  renaming  of
  1042. exceptions;  the third form, for the renaming of packages.
  1043.  
  1044. The  last  form  of  renaming  declaration  is  used  for  the  renaming of
  1045. subprograms  and  entries.   The  renamed  subprogram  or  entry  and   the
  1046. subprogram  specification  given  in the renaming declaration must have the
  1047. same parameter and result type profile (see 6.6).  The renaming declaration
  1048. is legal only if exactly one visible  subprogram  or  entry  satisfies  the
  1049. above  requirements  and  can  be  denoted by the given subprogram or entry
  1050. name.  In addition, parameter modes must be identical for formal parameters
  1051.  
  1052.  
  1053.                                   8 - 15
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062. that are at the same parameter position.
  1063.  
  1064. The subtypes of the parameters and result (if any) of a renamed  subprogram
  1065. or  entry  are not affected by renaming.  These subtypes are those given in
  1066. the  original  subprogram  declaration,  generic  instantiation,  or  entry
  1067. declaration  (not  those of the renaming declaration);  even for calls that
  1068. use the new name.  On the other hand, a renaming declaration can  introduce
  1069. parameter  names  and  default  expressions  that  differ from those of the
  1070. renamed subprogram;  named associations of calls with  the  new  subprogram
  1071. name  must  use the new parameter name;  calls with the old subprogram name
  1072. must use the old parameter names.
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                   8 - 16
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128. A procedure can only be renamed as a procedure.  Either of  a  function  or
  1129. operator  can be renamed as either of a function or operator;  for renaming
  1130. as  an  operator,  the  subprogram  specification  given  in  the  renaming
  1131. declaration  is  subject  to  the  rules  given in section 6.7 for operator
  1132. declarations.   Enumeration  literals  can   be   renamed   as   functions;
  1133. similarly,  attributes  defined as functions (such as SUCC and PRED) can be
  1134. renamed as functions.  An entry can only be renamed as  a  procedure;   the
  1135. new name is only allowed to appear in contexts that allow a procedure name.
  1136. An  entry of a family can be renamed, but an entry family cannot be renamed
  1137. as a whole.
  1138.  
  1139. Examples:
  1140.  
  1141.     declare
  1142.        L : PERSON renames LEFTMOST_PERSON; -- see 3.8.1
  1143.     begin
  1144.        L.AGE := L.AGE + 1;
  1145.     end;
  1146.  
  1147.     FULL : exception renames TABLE_MANAGER.TABLE_FULL; -- see 7.5
  1148.  
  1149.     package TM renames TABLE_MANAGER;
  1150.  
  1151.     function REAL_PLUS(LEFT, RIGHT : REAL   ) return REAL    renames "+";
  1152.     function INT_PLUS (LEFT, RIGHT : INTEGER) return INTEGER renames "+";
  1153.  
  1154.     function ROUGE return COLOR renames RED;  --  see 3.5.1
  1155.     function ROT   return COLOR renames RED;
  1156.     function ROSSO return COLOR renames ROUGE;
  1157.  
  1158.     function NEXT(X : COLOR) return COLOR renames COLOR'SUCC; -- see 3.5.5
  1159.  
  1160. Example of a renaming declaration with new parameter names:
  1161.  
  1162.     function "*" (X,Y : VECTOR) return REAL renames DOT_PRODUCT; -- see 6.1
  1163.  
  1164. Example of a renaming declaration with a new default expression:
  1165.  
  1166.     function MINIMUM(L : LINK := HEAD) return CELL renames MIN_CELL; -- see 6.1
  1167.  
  1168. Notes:
  1169.  
  1170. Renaming may be used to resolve name conflicts and to act as  a  shorthand.
  1171. Renaming  with  a different identifier or operator symbol does not hide the
  1172. old name;  the new name and the old name need not be visible  at  the  same
  1173. points.    The   attributes  POS  and  VAL  cannot  be  renamed  since  the
  1174. corresponding specifications cannot be written;  the  same  holds  for  the
  1175. predefined multiplying operators with a universal_fixed result.
  1176.  
  1177. Calls  with  the  new name of a renamed entry are procedure call statements
  1178. and are not allowed at places where  the  syntax  requires  an  entry  call
  1179. statement  in  conditional  and  timed  entry  calls;  similarly, the COUNT
  1180. attribute is not available for the new name.
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                                   8 - 17
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194. A task object that is declared by an object declaration can be  renamed  as
  1195. an   object.    However,   a  single  task  cannot  be  renamed  since  the
  1196. corresponding task type is anonymous.  For similar reasons, an object of an
  1197. anonymous array type cannot be  renamed.   No  syntactic  form  exists  for
  1198. renaming a generic unit.
  1199.  
  1200. A subtype can be used to achieve the effect of renaming a type (including a
  1201. task type) as in
  1202.  
  1203.     subtype MODE is TEXT_IO.FILE_MODE;
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                   8 - 18
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260. References:   allow  1.6, attribute 4.1.4, base type 3.3, conditional entry
  1261. call 9.7.2,  constant  3.2.1,  constrained  subtype  3.3,  constraint  3.3,
  1262. declaration  3.1,  default  expression 6.1, depend on a discriminant 3.7.1,
  1263. discriminant 3.7.1, elaboration 3.1 3.9, entry 9.5, entry call  9.5,  entry
  1264. call  statement  9.5,  entry declaration 9.5, entry family 9.5, enumeration
  1265. literal 3.5.1, evaluation of a name 4.1,  exception  11,  formal  parameter
  1266. 6.1,  function  6.5,  identifier 2.3, legal 1.6, mode 6.1, name 4.1, object
  1267. 3.2, object  declaration  3.2,  operator  6.7,  operator  declaration  6.7,
  1268. operator symbol 6.1, package 7, parameter 6.2, parameter specification 6.1,
  1269. procedure   6.1,   procedure   call   statement  6.4,  reserved  word  2.9,
  1270. subcomponent 3.3, subprogram 6, subprogram call 6.4, subprogram declaration
  1271. 6.1, subprogram specification 6.1, subtype 3.3.2, task  object  9.2,  timed
  1272. entry call 9.7.3, type 3.3, type mark 3.3.2, variable 3.2.1, visibility 8.3
  1273.  
  1274.  
  1275.  
  1276.  
  1277. 8.6  The Package Standard
  1278.  
  1279.  
  1280. The predefined types (for example the types BOOLEAN, CHARACTER and INTEGER)
  1281. are  the  types  that are declared in a predefined package called STANDARD;
  1282. this package also includes the declarations of their predefined operations.
  1283. The package STANDARD is described in Annex C.  Apart  from  the  predefined
  1284. numeric  types,  the specification of the package STANDARD must be the same
  1285. for all implementations of the language.
  1286.  
  1287. The package STANDARD  forms  a  declarative  region  which  encloses  every
  1288. library  unit  and consequently the main program;  the declaration of every
  1289. library unit is assumed to occur  immediately  within  this  package.   The
  1290. implicit  declarations of library units are assumed to be ordered in such a
  1291. way that the scope of a given library unit includes  any  compilation  unit
  1292. that  mentions  the given library unit in a with clause.  However, the only
  1293. library units that are visible within  a  given  compilation  unit  are  as
  1294. follows:   they  include  the  library units named by all with clauses that
  1295. apply to the given unit, and moreover, if the given  unit  is  a  secondary
  1296. unit of some library unit, they include this library unit.
  1297.  
  1298. Notes:
  1299.  
  1300. If  all  block  statements  of  a  program are named, then the name of each
  1301. program unit can always be  written  as  an  expanded  name  starting  with
  1302. STANDARD (unless this package is itself hidden).
  1303.  
  1304. If  a type is declared in the visible part of a library package, then it is
  1305. a consequence of the visibility rules  that  a  basic  operation  (such  as
  1306. assignment)  for  this  type  is  directly visible at places where the type
  1307. itself is not visible (whether by selection  or  directly).   However  this
  1308. operation  can  only  be  applied  to  operands  that  are  visible and the
  1309. declaration of these operands requires the visibility of either the type or
  1310. one of its subtypes.
  1311.  
  1312.  
  1313. References:  applicable with clause 10.1.1, block name 5.6, block statement
  1314. 5.6, declaration 3.1, declarative region 8.1, expanded name  4.1.3,  hiding
  1315.  
  1316.  
  1317.                                   8 - 19
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326. 8.3,  identifier  2.3,  implicit  declaration  3.1, library unit 10.1, loop
  1327. statement 5.5, main program 10.1, must 1.6,  name  4.1,  occur  immediately
  1328. within  8.1,  operator 6.7, package 7, program unit 6, secondary unit 10.1,
  1329. subtype 3.3, type 3.3, visibility 8.3, with clause 10.1.1
  1330.  
  1331.  
  1332.  
  1333.  
  1334. 8.7  The Context of Overload Resolution
  1335.  
  1336.  
  1337. Overloading is defined for subprograms,  enumeration  literals,  operators,
  1338. and  single  entries,  and  also  for  the  operations that are inherent in
  1339. several basic operations such as assignment, membership tests,  allocators,
  1340. the literal null, aggregates, and string literals.
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.                                   8 - 20
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392. For  overloaded entities, overload resolution determines the actual meaning
  1393. that an occurrence of an identifier has, whenever the visibility rules have
  1394. determined that more than one meaning is acceptable at the  place  of  this
  1395. occurrence;   overload resolution likewise determines the actual meaning of
  1396. an occurrence of an operator or some basic operation.
  1397.  
  1398. At such a place all visible declarations are considered.  The occurrence is
  1399. only legal if there is exactly one interpretation of  each  constituent  of
  1400. the  innermost  complete  context;   a  complete  context  is  one  of  the
  1401. following:
  1402.  
  1403.   -  A declaration.
  1404.  
  1405.   -  A statement.
  1406.  
  1407.   -  A representation clause.
  1408.  
  1409. When considering possible interpretations of a complete context,  the  only
  1410. rules  considered are the syntax rules, the scope and visibility rules, and
  1411. the rules of the form described below.
  1412.  
  1413. (a)  Any rule that requires a name or expression to have a certain type, or
  1414.      to have the same type as another name or expression.
  1415.  
  1416. (b)  Any rule that requires the type of a name or expression to be  a  type
  1417.      of  a certain class;  similarly, any rule that requires a certain type
  1418.      to be a discrete, integer, real,  universal,  character,  boolean,  or
  1419.      nonlimited type.
  1420.  
  1421. (c)  Any rule that requires a prefix to be appropriate for a certain  type.
  1422.  
  1423. (d)  Any rule that specifies a certain type as the result type of  a  basic
  1424.      operation,  and any rule that specifies that this type is of a certain
  1425.      class.
  1426.  
  1427. (e)  The rules that require the type of an aggregate or string  literal  to
  1428.      be  determinable  solely  from the enclosing complete context (see 4.3
  1429.      and 4.2).  Similarly, the rules that require the type of the prefix of
  1430.      an attribute, the type of the expression of a case statement,  or  the
  1431.      type  of  the  operand  of  a  type  conversion,  to  be  determinable
  1432.      independently of the context (see 4.1.4, 5.4, 4.6, and 6.4.1).
  1433.  
  1434. (f)  The rules given in section  6.6,  for  the  resolution  of  overloaded
  1435.      subprogram  calls;   in  section  4.6, for the implicit conversions of
  1436.      universal expressions;  in section 3.6.1, for  the  interpretation  of
  1437.      discrete  ranges  with bounds having a universal type;  and in section
  1438.      4.1.3, for the interpretation of an expanded name whose prefix denotes
  1439.      a subprogram or an accept statement.
  1440.  
  1441. Subprogram names used as pragma arguments follow  a  different  rule:   the
  1442. pragma can apply to several overloaded subprograms, as explained in section
  1443. 6.3.2  for  the pragma INLINE, in section 11.7 for the pragma SUPPRESS, and
  1444. in section 13.9 for the pragma INTERFACE.
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                   8 - 21
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Similarly, the simple names given in context clauses (see  10.1.1)  and  in
  1459. address clauses (see 13.5) follow different rules.
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.                                   8 - 22
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524. Notes:
  1525.  
  1526. If  there  is  only one possible interpretation, the identifier denotes the
  1527. corresponding entity.  However, this does not mean that the  occurrence  is
  1528. necessarily  legal  since other requirements exist which are not considered
  1529. for overload resolution;  for example,  the  fact  that  an  expression  is
  1530. static,  the  parameter  modes,  whether an object is constant, conformance
  1531. rules,  forcing  occurrences  for  a  representation   clause,   order   of
  1532. elaboration, and so on.
  1533.  
  1534. Similarly,  subtypes  are  not  considered  for  overload  resolution  (the
  1535. violation of a constraint does not make a program  illegal  but  raises  an
  1536. exception during program execution).
  1537.  
  1538. Rules that require certain constructs to have the same parameter and result
  1539. type  profile  fall  under the category (a);  the same holds for rules that
  1540. require conformance of  two  constructs  since  conformance  requires  that
  1541. corresponding  names  be  given  the  same  meaning  by  the visibility and
  1542. overloading rules.
  1543.  
  1544. A loop parameter specification is  a  declaration,  and  hence  a  complete
  1545. context.
  1546.  
  1547. References:   aggregate 4.3, allocator 4.8, assignment 5.2, basic operation
  1548. 3.3.3, case statement 5.4, class of type 3.3, declaration 3.1,  entry  9.5,
  1549. enumeration  literal  3.5.1, exception 11, expression 4.4, formal part 6.1,
  1550. identifier 2.3, legal 1.6, literal 4.2, loop parameter  specification  5.5,
  1551. membership  test  4.5.2,  name  4.1,  null  literal  3.8,  operation 3.3.3,
  1552. operator 4.5, overloading 6.6,  pragma  2.8,  representation  clause  13.1,
  1553. statement  5,  static  expression  4.9,  static  subtype 4.9, subprogram 6,
  1554. subtype 3.3, type conversion 4.6, visibility 8.3
  1555.  
  1556. Rules of the form (a):  address clause 13.5, assignment 5.2,  choice  3.7.3
  1557. 4.3.2  5.4,  component  association  4.3.1  4.3.2,  conformance  rules 9.5,
  1558. default expression 3.7 3.7.1 6.1  12.1.1,  delay  statement  9.6,  discrete
  1559. range   3.6.1   5.5   9.5,   discriminant   constraint  3.7.2,  enumeration
  1560. representation clause 13.3, generic  parameter  association  12.3.1,  index
  1561. constraint  3.6.1,  index  expression 4.1.1 4.1.2 9.5, initial value 3.2.1,
  1562. membership test 4.5.2, parameter association 6.4.1,  parameter  and  result
  1563. type  profile  8.5  12.3.6, qualified expression 4.7, range constraint 3.5,
  1564. renaming of an object 8.5, result expression 5.8
  1565.  
  1566. Rules of  the  form  (b):   abort  statement  9.10,  assignment  5.2,  case
  1567. expression  5.4, condition 5.3 5.5 5.7 9.7.1, discrete range 3.6.1 5.5 9.5,
  1568. fixed point type declaration 3.5.9, floating point type declaration  3.5.7,
  1569. integer  type  declaration  3.5.4, length clause 13.2, membership test 4.4,
  1570. number declaration  3.2.2,  record  representation  clause  13.4,  selected
  1571. component 4.1.3, short-circuit control form 4.4, val attribute 3.5.5
  1572.  
  1573. Rules  of the form (c):  indexed component 4.1.1, selected component 4.1.3,
  1574. slice 4.1.2
  1575.  
  1576. Rules of the form (d):  aggregate 4.3, allocator 4.8, membership test  4.4,
  1577. null  literal  4.2,  numeric  literal  2.4, short-circuit control form 4.4,
  1578. string literal 4.2
  1579.  
  1580.  
  1581.                                   8 - 23
  1582.  
  1583.  
  1584.  
  1585.  
  1586.