!ASIS Issue #001
!topic Proposed ASIS95 Element_Kind Type Hierarchy
!reference ASIS95-ASIS
!from S. Blake 95-03-08
!keywords Element_Kind
!discussion

From sblake@alsys.com Mon May  1 16:49:46 1995
Return-Path: <sblake@alsys.com>
Date: Mon, 1 May 1995 13:49:30 -0700
From: sblake@alsys.com (Steve Blake @pulsar)
To: roby@csed-115.csed.ida.org.
Subject: Document for Issue 001
Content-Length: 48363
X-Lines: 1215
Status: RO


Proposed ASIS 9X element kind type hierarchy Draft 6, Mar, 1995

Steve Blake, Thomson Software Products (formerly Alsys, Inc.)
619-457-2700 x272
sblake@thomsoft.com


Purpose

  This proposal addresses the Element Kinds Hierarchy changes required to 
  evolve ASIS 1.1.1 into ASIS 2.0.  It is intended to serve as topic for the 
  ASISWG.  The next ASISWG meeting is scheduled from 6-8 March 1995 in Fort 
  Lauderdale, Florida. It will be hosted by Harris Computer Systems 
  Corporation.

  Comments are welcome from anyone, hopefully prior to the meeting.

  Please submit comments via email to: 
     asiswg-technical@sw-eng.falls-church.va.us


Scope

  This proposal covers the changes dealing with kinds for both elements and 
  units (compilation units). 

  Draft 5 along with Draft 4 addresses ASISWG issues 1-5.  See below.
  Changes since Draft 4 along with specific non-changes are listed with some 
  rationale.

  Draft 5 satisfies Issues 6 and 7.  The Draft contains proposed
  specifications of two new packages Asis_Unit_Kinds and Asis_Element_Kinds.

  Draft 5 also addresses comments received from ASISWG members.


Organization

  This proposal is organized into four Sections.

  Section 1. ASISWG Review Issues
  Section 2. Changes in Draft 5
  Section 3. Specification of package Asis_Element_Kinds.
  Section 4. Specification of package Asis_Unit_Kinds.


Related Documents

  1. Proposed ASIS 9X element kind type hierarchy, Draft 4, Nov 30, 1994

  2. Proposed ASIS 9X Version 2.0.A -- Jan 1995
     This proposal addresses some of the changes required to evolve ASIS 1.1.1 
     into ASIS 2.0.


Section 1. ASISWG Review Issues on Draft 3, Nov 3-4, MITRE, McLean VA.

1. Improve the names of the various kinds by using consistent, meaningful,
   and concise names.  Some names are very long.

2. Combine the Arms and Alternatives into An_Alternative.  It was discussed 
   that An_Exception_Handler could be grouped with the combined An_Alternative 
   kind, but later agreed that it should remain an Element_Kind.

3. Collapse or expand the various renaming declaration kinds.  The issue of
   renaming enumeration literals as functions should be addressed.  

4. Remove A_Special_Operation as an Expression_Kind, flattening the
   Special_Operation_Kinds and name them using membership and short circuit
   terms.

5. The Element_Kind A_Type_Declaration collides with A_Task_Type_Declaration
   and A_Protected_Type_Declaration which are also type declarations. 

6. Place all the kind enumeration type declarations in a package (ie.
   ASIS_Kinds) so the comments following the derived types in the other
   packages can be removed, since this is not a recommended style.  The new
   package provides a handy reference to the kinds without having to look in 
   vendor specific packages that may or may not be provided with the ASIS
   implementation.

7. Compilation_Unit_Kinds will need to be expanded for ASIS9X.  The parent
   type of the derived Compilation_Unit_Kinds should have the same name for
   consistency.  Currently the parent type is Unit_Kinds.



Section 2.  Changes in Draft 5 (from Draft 4)

o Deleted A_Choice and subordinate Choice_Kinds from Element_Kind.  
  Added An_Others_Choice to Definition_Kinds.  Gary Barnes request.


o In draft 4 these were folded back into A_Full_Type_Declaration 
  in Declaration_Kinds:
    A_Type_Declaration,
    A_Task_Type_Declaration, 
    A_Protected_Type_Declaration,                     --| new in 9X

  They must be expanded otherwise a task type of the form "task type T;" 
  would not be identifiable.  It would be A_Full_Type_Declaration but would
  not yield a definition.

  Added An_Ordinary_Type_Declaration to distinguish types that define a type
  definition from the LRM definition of a type declaration that includes
  incomplete types, full_types, etc.  This satisfies ASISWG Issue 5.


o Changed Definition_Trait_Kinds to Trait_Kinds, a shorter name that can
  apply to A_Declaration elements as well as A_Definition elements.
  Added the literals:

    An_Ordinary_Trait
    An_Aliased_Trait,
    An_Access_Definition_Trait,
    A_Reverse_Trait,
    A_Limited_Private_Trait,
    An_Abstract_Limited_Private_Trait

  Applying Trait_Kind to certain A_Declaration elements allows deletion of the 
  following from the overcrowded Declaration_Kinds:

    An_Aliased_Variable_Declaration,	   
    An_Aliased_Constant_Declaration,	  
    An_Aliased_Deferred_Constant_Declaration,
    An_Access_Discriminant_Specification,      
    An_Access_Parameter_Specification,        
    A_Reverse_Loop_Parameter_Specification,    
    An_Abstract_Procedure_Declaration,        
    An_Abstract_Function_Declaration,        

  and the following can be deleted from Definition_Kinds.
    An_Aliased_Component_Definition,           

  These were essentially just duplicates of other literals like
  A_Variable_Declaration or A_Procedure_Declaration.  Trait_Kinds can be
  used to determine the presence of reserved words within the declaration or
  the definition part of the declaration.

  This change removes some flattening from Declaration_Kinds, preserving the
  hierarchical model expressly desired.

o Deleted Definition_Kinds:
        A_Subtype_Mark,
        An_Access_Definition,	

  These Definition_Kinds are an unnecessary extra step.  Removing
  A_Subtype_Mark allows queries to return An_Expression that
  represents the subtype_mark rather than an element that represents
  A_Subtype_Mark which must then be queried for the expression.  The query
  to decompose generic_actual_parameters can consistently return only
  An_Expression rather than An_Expression or A_Definition (A_Subtype_Mark)
  elements.

  Instead of returning An_Access_Definition in parameter_specifications or
  discriminant_specifications, the appearance of the reserved word access 
  can be determined from the new Trait_Kinds.  

  This means that existing queries that return expressions in the place of 
  subtype_marks do not need to be changed, and the handling of subtype_marks
  as expressions is consistent throughout ASIS.


o Not_A_XXXX kind literals have been moved to the first literal position in
  each kind type declaration.  Gary Barnes request.

o Literals in all the kinds are ordered by their LRM reference.

o Atribute_Designator_Kinds name was shortened to Attribute_Kinds.

o Parameter_Mode_Kinds name was shortened to Mode_Kinds.

o Subprogram_Default_Kinds name was shortened to Default_Kinds.

o Declaration_Origin_Kinds'An_Implicit_Derived_Declaration name
  was changed to Declaration_Origin_Kinds'An_Implicit_Inherited_Declaration 
  to be consistent with LRM terminology.

o subtypes offering convenient groupings of Declaration_Kinds and 
  Access_Type_Kinds have been added.  For example:

  subtype A_Type_Declaration is Declaration_Kinds range
              An_Ordinary_Type_Declaration .. A_Private_Extension_Declaration;
  
  The subtypes can be used in case statement alternatives rather than
  listing each of the many Declaration_Kinds literals.  They also provide a
  logical equivalent of Boolean functions like Is_Type_Declaration when used
  in membership test operations:  kind in A_Type_Declaration.


Section 3.  Specification of package Asis_Element_Kinds.

Note: Some cleanup of commentary is still TBD.

package ASIS_Element_Kinds is
------------------------------------------------------------------------------
-- ASIS.Element_Kinds -- ASIS 9X Version 2.0.A -- Jan 1995
--
-- These enumeration types describe the various kinds of elements manipulated 
-- by the ASIS interface.
------------------------------------------------------------------------------
--
--|9X-------------------------------------------------------------------------
--|9X package ASIS_Element_Kinds is new.
--|9X-------------------------------------------------------------------------
--|9X The element kinds hierarchy is new.
--|9X-------------------------------------------------------------------------
--|9X All type declarations of element kinds and subordinate kinds are
--|9X in this package.
------------------------------------------------------------------------------
-- Element_Kinds Hierarchy
------------------------------------------------------------------------------
--
------------------------------------------------------------------------------
--        Element_Kinds Liters     Subordinate Kinds
------------------------------------------------------------------------------
--
--   Key: Read "->" as "can be further categorized by its"
--
--        A_Pragma              -> Pragma_Kinds
--
--        A_Defining_Name       -> Defining_Name_Kinds
--                                         -> Operator_Kinds
--
--        A_Declaration         -> Declaration_Kinds
--                                         -> Trait_Kinds
--                                         -> Declaration_Origin
--				           -> Mode_Kinds
--                                         -> Default_Kinds
--
--        A_Definition          -> Definition_Kinds
--                                         -> Trait_Kinds
--                                         -> Type_Kinds
--                                                    -> Trait_Kinds
--                                         -> Formal_Type_Kinds
--                                                    -> Trait_Kinds
--                                         -> Access_Type_Kinds
--                                         -> Root_Type_Kinds
--                                         -> Constraint_Kinds
--                                         -> Discrete_Range_Kinds
--
--        An_Expression         -> Expression_Kinds
--                                         -> Operator_Kinds
--                                         -> Attribute_Kinds
--
--        An_Association        -> Association_Kinds
--
--        A_Statement           -> Statement_Kinds
--
--        An_Alternative        -> Alternative_Kinds
--
--        A_Clause              -> Clause_Kinds
--                                         -> Representation_Clause_Kinds
--
--        An_Exception_Handler
--
------------------------------------------------------------------------------
-- Enumerations for Asis.Elements
------------------------------------------------------------------------------
--
--|9X-------------------------------------------------------------------------
--|9X Element_Kinds: many literals are new, reordered, improved names.
------------------------------------------------------------------------------
-- Element_Kinds - general element classifications
--  Literals                   -- ASIS package containing queries
------------------------------------------------------------------------------

  type Element_Kinds is (  

    Not_An_Element,            -- Nil_Element

    A_Pragma,                  -- Asis.Elements

    A_Defining_Name,           -- Asis.Declarations

    A_Declaration,             -- Asis.Declarations

    A_Definition,              -- Asis.Definitions

    An_Expression,             -- Asis.Expressions

    An_Association,            -- Asis.Expressions

    A_Statement,               -- Asis.Statements

    An_Alternative,            -- Asis.Statements

    A_Clause,                  -- Asis.Clauses

    An_Exception_Handler);     -- Asis.Statements

------------------------------------------------------------------------------
-- Traverse_Control - controls for the traversal generic
------------------------------------------------------------------------------

  type Traverse_Control is (  

    Continue,  
    Abandon_Children,  
    Abandon_Siblings,  
    Terminate_Immediately);

------------------------------------------------------------------------------
-- Pragma_Kinds - classifications for known pragmas
--  Literals                          -- LRM
------------------------------------------------------------------------------

  type Pragma_Kinds is (  

    Not_A_Pragma,
    An_All_Calls_Remote_Pragma,       -- I.2.3(6)
    An_Asynchronous_Pragma,           -- I.4.1(3)
    An_Atomic_Pragma,                 -- G.5(3)
    An_Atomic_Components_Pragma,      -- G.5(3)
    An_Attach_Handler_Pragma,         -- G.3.1(3)
    A_Controlled_Pragma,              -- 13.11.3(3), B(12)
    A_Convention_Pragma,              -- B(16), M.1(5)
    An_Elaborate_All_Pragma,          -- 10.2.1(19), B(8)
    An_Elaborate_Body_Pragma,         -- 10.2.1(21), B(9)
    An_Export_Pragma,                 -- B(15), M.1(5)
    An_Import_Pragma,                 -- B(14), M.1(5)
    An_Inline_Pragma,                 -- 6.3.2(4), B(5)
    An_Inspection_Point_Pragma,       -- L.2.2(2)
    An_Interrupt_Handler_Pragma,      -- G.3.1(2)
    An_Interrupt_Priority_Pragma,     -- H.1(4)
    A_List_Pragma,                    -- 2.8(18), B(2)
    A_Locking_Policy_Pragma,          -- H.3(3)
    A_Normalize_Scalars_Pragma,       -- L.1.1(2)
    An_Optimize_Pragma,               -- 2.8(18), B(4)
    A_Pack_Pragma,                    -- 13.2(2), B(11)
    A_Page_Pragma,                    -- 2.8(18), B(3)
    A_Preelaborate_Pragma,            -- 10.2.1(3), B(6)
    A_Priority_Pragma,                -- H.1(3)
    A_Pure_Pragma,                    -- 10.2.1(13), B(7)
    A_Queuing_Policy,                 -- H.4(3)
    A_Remote_Call_Interface_Pragma,   -- I.2.3(4)
    A_Remote_Types_Pragma,            -- I.2.2(4)
    A_Restrictions_Pragma,            -- 13.12(2), B(13)
    A_Reviewable_Pragma,              -- L.2.1(2)
    A_Shared_Passive_Pragma,          -- I.2.1(4)
    A_Suppress_Pragma,                -- 11.5(4), B(10)
    A_Task_Dispatching_Policy_Pragma, -- H.2.2(2)
    A_Volatile_Pragma,                -- G.5(3)
    A_Volatile_Components_Pragma,     -- G.5(3)

    An_Implementation_Defined_Pragma, -- Vendor Appendix F

    An_Unknown_Pragma);               -- Unknown to the compiler.

------------------------------------------------------------------------------
-- Enumerations for Asis.Declarations
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- Defining_Name_Kinds - names defined by declarations and specifications.
--  Literals                                   -- LRM
------------------------------------------------------------------------------

  type Defining_Name_Kinds is (

    Not_A_Defining_Name,

    A_Defining_Identifier,                     -- 3.1
    A_Defining_Character_Literal,              -- 3.5.1
    A_Defining_Enumeration_Literal,            -- 3.5.1
    A_Defining_Operator_Symbol,                -- 6.1
    A_Defining_Expanded_Name);   --  6.1 program_unit_name.defining_identifier

------------------------------------------------------------------------------
-- Declaration_Kinds - all declarations and specifications that have
-- defining names.
--  Literals                                   -- LRM   -> Subordinate Kinds
------------------------------------------------------------------------------

  type Declaration_Kinds is (

    Not_A_Declaration,

    An_Ordinary_Type_Declaration,              -- 3.2.1
      -- a full_type_declaration of the form:
      -- type defining_identifier [known_discriminant_part] is type_definition;

    A_Task_Type_Declaration,                   -- 3.2.1
    A_Protected_Type_Declaration,              -- 3.2.1
    An_Incomplete_Type_Declaration,            -- 3.2.1
    A_Private_Type_Declaration,                -- 3.2.1
    A_Private_Extension_Declaration,           -- 3.2.1

    A_Subtype_Declaration,                     -- 3.2.2

    A_Variable_Declaration,                    -- 3.3.1 -> Trait_Kinds
    A_Constant_Declaration,                    -- 3.3.1 -> Trait_Kinds
    A_Deferred_Constant_Declaration,	       -- 3.3.1 -> Trait_Kinds
    A_Single_Task_Declaration, 		       -- 3.3.1
    A_Single_Protected_Declaration,            -- 3.3.1

    An_Integer_Number_Declaration,             -- 3.3.2
    A_Real_Number_Declaration,                 -- 3.3.2

    An_Enumeration_Literal_Specification,      -- 3.5.1

    A_Discriminant_Specification,              -- 3.7   -> Trait_Kinds

    A_Component_Declaration,                   -- 3.8

    A_Loop_Parameter_Specification,            -- 5.5   -> Trait_Kinds

    A_Procedure_Declaration,                   -- 6.1   -> Trait_Kinds
    A_Function_Declaration,                    -- 6.1   -> Trait_Kinds

    A_Parameter_Specification,                 -- 6.1   -> Trait_Kinds
					       --       -> Mode_Kinds
    A_Procedure_Body_Declaration,              -- 6.3
    A_Function_Body_Declaration,               -- 6.3

    A_Package_Declaration,                     -- 7.1
    A_Package_Body_Declaration,                -- 7.2

    An_Object_Renaming_Declaration,            -- 8.5.1
    An_Exception_Renaming_Declaration,         -- 8.5.2
    A_Package_Renaming_Declaration,            -- 8.5.3
    A_Procedure_Renaming_Declaration,          -- 8.5.4
    A_Function_Renaming_Declaration,           -- 8.5.4
    A_Generic_Package_Renaming_Declaration,    -- 8.5.5
    A_Generic_Procedure_Renaming_Declaration,  -- 8.5.5
    A_Generic_Function_Renaming_Declaration,   -- 8.5.5

    A_Task_Body_Declaration,                   -- 9.1
    A_Protected_Body_Declaration,  	       -- 9.4

    An_Entry_Declaration,                      -- 9.5.2
    An_Entry_Body_Declaration,  	       -- 9.5.2
    An_Entry_Index_Specification, 	       -- 9.5.2

    A_Procedure_Body_Stub,                     -- 10.1.3
    A_Function_Body_Stub,                      -- 10.1.3
    A_Package_Body_Stub,                       -- 10.1.3
    A_Task_Body_Stub,                          -- 10.1.3
    A_Protected_Body_Stub, 		       -- 10.1.3

    An_Exception_Declaration,                  -- 11.1
    A_Choice_Parameter_Specification,          -- 11.2

    A_Generic_Procedure_Declaration,           -- 12.1
    A_Generic_Function_Declaration,            -- 12.1
    A_Generic_Package_Declaration,             -- 12.1

    A_Package_Instantiation,                   -- 12.3
    A_Procedure_Instantiation,                 -- 12.3
    A_Function_Instantiation,                  -- 12.3

    A_Formal_Object_Declaration,               -- 12.4  -> Mode_Kinds
    A_Formal_Type_Declaration,                 -- 12.5
    A_Formal_Procedure_Declaration,            -- 12.6  -> Default_Kinds
    A_Formal_Function_Declaration,             -- 12.6  -> Default_Kinds
    A_Formal_Package_Declaration,              -- 12.7
    A_Formal_Package_Declaration_With_Box);    -- 12.7


  subtype A_Type_Declaration is Declaration_Kinds range
              An_Ordinary_Type_Declaration .. A_Private_Extension_Declaration;

  subtype A_Full_Type_Declaration is Declaration_Kinds range
              An_Ordinary_Type_Declaration .. A_Protected_Type_Declaration;

  subtype An_Object_Declaration is Declaration_Kinds range
              A_Variable_Declaration .. A_Single_Protected_Declaration;

  subtype A_Number_Declaration is Declaration_Kinds range
              An_Integer_Number_Declaration .. A_Real_Number_Declaration;

  subtype A_Renaming_Declaration is Declaration_Kinds range
              An_Object_Renaming_Declaration .. 
	      A_Generic_Function_Renaming_Declaration;

  subtype A_Body_Stub is Declaration_Kinds range
              A_Procedure_Body_Stub .. A_Protected_Body_Stub;

  subtype A_Generic_Declaration is Declaration_Kinds range
              A_Generic_Procedure_Declaration .. A_Generic_Package_Declaration;

  subtype A_Generic_Instantiation is Declaration_Kinds range
              A_Package_Instantiation .. A_Function_Instantiation;

  subtype A_Formal_Declaration is Declaration_Kinds range
              A_Formal_Object_Declaration .. 
	      A_Formal_Package_Declaration_With_Box;

------------------------------------------------------------------------------
-- Trait_Kinds
------------------------------------------------------------------------------

  type Trait_Kinds is (

    -- Trait_Kinds are determined only by the presence (or absence) of certain
    -- reserved words.  The semantics of an element are not considered.
    -- For example, A_Variable_Declaration element that is semantically a 
    -- limited type because its components are of a limited type is
    -- An_Ordinary_Trait, not A_Limited_Trait, since the reserved word limited 
    -- does not appear in its declaration or definition.

    Not_A_Trait,

    An_Ordinary_Trait,                   -- The declaration or definition does 
					 -- not contain the reserved words 
					 -- ALIASED, ACCESS, REVERSE, PRIVATE, 
					 -- LIMITED, or ABSTRACT
    An_Aliased_Trait,                    -- ALIASED is present
    An_Access_Definition_Trait,          -- ACCESS in an access_definition is 
					 -- present
    A_Reverse_Trait,                     -- REVERSE is present
    A_Private_Trait,                     -- PRIVATE is present
    A_Limited_Trait,                     -- LIMITED is present
    A_Limited_Private_Trait,             -- LIMITED and PRIVATE are present
    An_Abstract_Trait,                   -- ABSTRACT is present
    An_Abstract_Private_Trait,           -- ABSTRACT and PRIVATE are present
    An_Abstract_Limited_Trait,           -- ABSTRACT and LIMITED are present
    An_Abstract_Limited_Private_Trait);  -- ABSTRACT, LIMITED, and PRIVATE are 
					 -- present

------------------------------------------------------------------------------
-- Declaration_Origins
--  Literals                             -- LRM
------------------------------------------------------------------------------

  type Declaration_Origins is (  

    Not_A_Declaration_Origin,

    An_Explicit_Declaration,             -- programmer declared
    An_Implicit_Predefined_Declaration,  -- 3.2.1(7)
    An_Implicit_Inherited_Declaration);  -- 3.4(16)

------------------------------------------------------------------------------
-- Mode_Kinds
--  Literals                 -- LRM
------------------------------------------------------------------------------

  type Mode_Kinds is (       -- 6.1

    Not_A_Mode,

    A_Default_In_Mode,       -- procedure A(B :        C);
    An_In_Mode,              -- procedure A(B : IN     C);
    An_Out_Mode,             -- procedure A(B :    OUT C);
    An_In_Out_Mode);         -- procedure A(B : IN OUT C);

------------------------------------------------------------------------------
-- Default_Kinds
--  Literals                 -- LRM
------------------------------------------------------------------------------

  type Default_Kinds is (    -- 12.6

    Not_A_Default,

    A_Default_Name,          -- with subprogram_specification;
    A_Box,                   -- with subprogram_specification is <>;
    A_Nil_Default);          -- with subprogram_specification is default_name;

------------------------------------------------------------------------------
-- Enumerations for Asis.Definitions
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- Definition_Kinds
--  Literals                          -- LRM     -> Subordinate Kinds
------------------------------------------------------------------------------

  type Definition_Kinds is (  

    Not_A_Definition,

    A_Type_Definition,                -- 3.2.1   -> Type_Kinds

    A_Subtype_Indication,             -- 3.2.2
    A_Constraint,                     -- 3.2.2   -> Constraint_Kinds

    A_Component_Definition,           -- 3.6 	

    A_Discrete_Subtype_Definition,    -- 3.6     -> Discrete_Range_Kinds 
    A_Discrete_Range,                 -- 3.6.1   -> Discrete_Range_Kinds

    An_Unknown_Discriminant_Part,     -- 3.7
    A_Known_Discriminant_Part,        -- 3.7

    A_Record_Definition,              -- 3.8	
    A_Null_Record_Definition,         -- 3.8	

    A_Null_Component,                 -- 3.8
    A_Variant_Part,                   -- 3.8
    A_Variant,                        -- 3.8

    An_Others_Choice,                 -- 3.8.1, 4.3.1, 4.3.3, 11.2

    A_Private_Type_Definition,        -- 7.3     -> Trait_Kinds
    A_Tagged_Private_Type_Definition, -- 7.3     -> Trait_Kinds
    A_Private_Extension_Definition,   -- 7.3     -> Trait_Kinds

    A_Task_Definition, 		      -- 9.1	
    A_Protected_Definition,           -- 9.4	

    A_Formal_Type_Definition);        -- 12.5    -> Formal_Type_Kinds

------------------------------------------------------------------------------
-- Type_Kinds
--  Literals                               -- LRM    -> Subordinate Kinds
------------------------------------------------------------------------------

  type Type_Kinds is (

    Not_A_Type_Definition,

    A_Derived_Type_Definition,             -- 3.4    -> Trait_Kinds
    A_Derived_Record_Extension_Definition, -- 3.4    -> Trait_Kinds

    An_Enumeration_Type_Definition,        -- 3.5.1

    A_Signed_Integer_Type_Definition,      -- 3.5.4
    A_Modular_Type_Definition,             -- 3.5.4

    A_Root_Type_Definition, 		   -- 3.5.4(10), 3.5.6(4)
					   --        -> Root_Type_Kinds
    A_Floating_Point_Definition,           -- 3.5.7

    An_Ordinary_Fixed_Point_Definition,    -- 3.5.9
    A_Decimal_Fixed_Point_Definition,      -- 3.5.9

    An_Unconstrained_Array_Definition,     -- 3.6
    A_Constrained_Array_Definition,        -- 3.6

    A_Record_Type_Definition,              -- 3.8    -> Trait_Kinds
    A_Tagged_Record_Type_Definition,       -- 3.8    -> Trait_Kinds

    An_Access_Type_Definition);            -- 3.10   -> Access_Type_Kinds


------------------------------------------------------------------------------
-- Formal_Type_Kinds
--  Literals                                  -- LRM     -> Subordinate Kinds
------------------------------------------------------------------------------

  type Formal_Type_Kinds is (

    Not_A_Formal_Type_Definition,

    A_Formal_Private_Type_Definition,         -- 12.5.1  -> Trait_Kinds
    A_Formal_Tagged_Private_Type_Definition,  -- 12.5.1  -> Trait_Kinds

    A_Formal_Derived_Type_Definition,         -- 12.5.1  -> Trait_Kinds

    A_Formal_Discrete_Type_Definition,        -- 12.5.2

    A_Formal_Signed_Integer_Type_Definition,  -- 12.5.2
    A_Formal_Modular_Type_Definition,         -- 12.5.2

    A_Formal_Floating_Point_Definition,       -- 12.5.2

    A_Formal_Ordinary_Fixed_Point_Definition, -- 12.5.2
    A_Formal_Decimal_Fixed_Point_Definition,  -- 12.5.2

    A_Formal_Unconstrained_Array_Definition,  -- 12.5.3
    A_Formal_Constrained_Array_Definition,    -- 12.5.3

    A_Formal_Access_Type_Definition);         -- 12.5.4  -> Access_Type_Kinds

------------------------------------------------------------------------------
-- Access_Type_Kinds
--  Literals                             -- LRM
------------------------------------------------------------------------------

  type Access_Type_Kinds is ( -- 3.10

    Not_An_Access_Type_Definition,

    A_Pool_Specific_Access_To_Variable,  -- access subtype_indication
    An_Access_To_Variable,               -- access all subtype_indication
    An_Access_To_Constant,               -- access constant subtype_indication

    An_Access_To_Procedure,              -- access procedure
    An_Access_To_Protected_Procedure,    -- access protected procedure
    An_Access_To_Function,               -- access function
    An_Access_To_Protected_Function);    -- access protected function


  subtype Access_To_Object_Definition is Access_Type_Kinds range
	          A_Pool_Specific_Access_To_Variable .. An_Access_To_Constant;

  subtype Access_To_Subprogram_Definition is Access_Type_Kinds range
		  An_Access_To_Procedure ..  An_Access_To_Protected_Function;

------------------------------------------------------------------------------
-- Root_Type_Kinds
--  Literals                               -- LRM
------------------------------------------------------------------------------

  type Root_Type_Kinds is (

    Not_A_Root_Type_Definition,

    A_Root_Integer_Definition,	           -- 3.5.4(9)
    A_Root_Real_Definition,		   -- 3.5.6(2)
    A_Root_Fixed_Definition,		   -- 3.5.6(2)

    A_Universal_Integer_Definition,        -- 3.5.4(10)
    A_Universal_Real_Definition,           -- 3.5.6(4)
    A_Universal_Fixed_Definition);         -- 3.5.6(4)


------------------------------------------------------------------------------
-- Constraint_Kinds
--  Literals                               -- LRM
------------------------------------------------------------------------------

  type Constraint_Kinds is (  

    Not_A_Constraint,

    A_Range_Attribute_Reference,           -- 3.2.2, 3.5
    Simple_Expression_Range,               -- 3.2.2, 3.5
    A_Digits_Constraint,                   -- 3.2.2, 3.5.9
    A_Delta_Constraint,                    -- 3.2.2, N.3
    An_Index_Constraint,                   -- 3.2.2, 3.6.1
    A_Discriminant_Constraint);            -- 3.2.2

------------------------------------------------------------------------------
-- Discrete_Range_Kinds
--  Literals                               -- LRM
------------------------------------------------------------------------------

  type Discrete_Range_Kinds is (  

    Not_A_Discrete_Range,

    A_Discrete_Subtype_Indication,         -- 3.6.1, 3.2.2
    A_Discrete_Range_Attribute_Reference,  -- 3.6.1, 3.5
    A_Discrete_Simple_Expression_Range);   -- 3.6.1, 3.5

------------------------------------------------------------------------------
-- Enumerations for Asis.Expressions
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- Association_Kinds
--  Literals                               -- LRM
------------------------------------------------------------------------------

  type Association_Kinds is (

    Not_An_Association,

    A_Pragma_Argument_Association,         -- 2.8
    A_Discriminant_Association,            -- 3.7.1
    A_Record_Component_Association,        -- 4.3.1
    An_Array_Component_Association,        -- 4.3.3
    A_Parameter_Association);              -- 6.4


------------------------------------------------------------------------------
-- Expression_Kinds - general expression classifications
--  Literals                                   -- LRM    -> Subordinate Kinds
------------------------------------------------------------------------------

  type Expression_Kinds is (  

    Not_An_Expression,

    An_Integer_Literal,                        -- 2.4
    A_Real_Literal,                            -- 2.4.1
    A_String_Literal,                          -- 2.6

    An_Identifier, 		               -- 4.1
    An_Operator_Symbol,                        -- 4.1
    A_Character_Literal,                       -- 4.1
    An_Enumeration_Literal,                    -- 4.1
    An_Explicit_Dereference,                   -- 4.1
    A_Function_Call,                           -- 4.1

    An_Indexed_Component,                      -- 4.1.1
    A_Slice,                                   -- 4.1.2
    A_Selected_Component,                      -- 4.1.3
    An_Attribute_Reference,                    -- 4.1.4  -> Attribute_Kinds

    A_Record_Aggregate,                        -- 4.3
    An_Extension_Aggregate,                    -- 4.3
    An_Positional_Array_Aggregate,             -- 4.3
    An_Named_Array_Aggregate,      	       -- 4.3

    An_And_Then_Short_Circuit,                 -- 4.4
    An_Or_Else_Short_Circuit,                  -- 4.4

    An_In_Range_Membership_Test,               -- 4.4
    A_Not_In_Range_Membership_Test,            -- 4.4
    An_In_Type_Membership_Test,                -- 4.4
    A_Not_In_Type_Membership_Test,             -- 4.4

    A_Null_Literal,                            -- 4.4
    A_Parenthesized_Expression,                -- 4.4

    A_Type_Conversion,                         -- 4.6
    A_Qualified_Expression,                    -- 4.7

    An_Allocation_From_Subtype,                -- 4.8
    An_Allocation_From_Qualified_Expression);  -- 4.8

------------------------------------------------------------------------------
-- Operator_Kinds - classification of the various Ada predefined operators
--  Literals                           -- LRM
------------------------------------------------------------------------------

  type Operator_Kinds is (             -- 4.5

    Not_An_Operator,

    An_And_Operator,                   -- and
    An_Or_Operator,                    -- or
    An_Xor_Operator,                   -- xor
    An_Equal_Operator,                 -- =
    A_Not_Equal_Operator,              -- /=
    A_Less_Than_Operator,              -- <
    A_Less_Than_Or_Equal_Operator,     -- <=
    A_Greater_Than_Operator,           -- >
    A_Greater_Than_Or_Equal_Operator,  -- >=
    A_Plus_Operator,                   -- +
    A_Minus_Operator,                  -- -
    A_Concatenate_Operator,            -- &
    A_Unary_Plus_Operator,             -- +
    A_Unary_Minus_Operator,            -- -
    A_Multiply_Operator,               -- *
    A_Divide_Operator,                 -- /
    A_Mod_Operator,                    -- mod
    A_Rem_Operator,                    -- rem
    An_Exponentiate_Operator,          -- **
    An_Abs_Operator,                   -- abs
    A_Not_Operator);                   -- not

------------------------------------------------------------------------------
-- Attribute_Kinds - classifications for all known Ada attributes
--  Literals                           -- LRM
------------------------------------------------------------------------------

  type Attribute_Kinds is (  

--|Kind literals are still TBD for ASIS 9X

            Not_An_Attribute);

------------------------------------------------------------------------------
-- Enumerations for Asis.Statements
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- Statement_Kinds - classifications of Ada statements
--  Literals                             -- LRM
------------------------------------------------------------------------------

  type Statement_Kinds is (

    Not_An_Statement,

    A_Null_Statement,                    -- 5.1
    An_Assignment_Statement,             -- 5.2
    An_If_Statement,                     -- 5.3
    A_Case_Statement,                    -- 5.4

    A_Loop_Statement,		         -- 5.5
    A_While_Loop_Statement,	         -- 5.5
    A_For_Loop_Statement,	         -- 5.5

    A_Block_Statement,                   -- 5.6
    An_Exit_Statement,                   -- 5.7
    A_Goto_Statement,                    -- 5.8

    A_Procedure_Call_Statement,          -- 6.4
    A_Return_Statement,                  -- 6.5
    
    An_Accept_Statement,                 -- 9.5.2
    An_Entry_Call_Statement,             -- 9.5.3

    A_Requeue_Statement, 		 -- 9.5.4
    A_Requeue_Statement_With_Abort,      -- 9.5.4

    A_Delay_Until_Statement,             -- 9.6
    A_Delay_Relative_Statement,          -- 9.6

    A_Selective_Accept_Statement,        -- 9.7.2
    A_Timed_Entry_Call_Statement,        -- 9.7.3
    A_Conditional_Entry_Call_Statement,  -- 9.7.3
    An_Asynchronous_Select_Statement,    -- 9.7.4

    An_Abort_Statement,                  -- 9.8
    A_Raise_Statement,                   -- 11.3
    A_Code_Statement);                   -- 13.8

------------------------------------------------------------------------------
-- Alternative_Kinds
--  Literals                        -- LRM
------------------------------------------------------------------------------

  type Alternative_Kinds is (

    Not_An_Alternative,

    An_If_Statement_Alternative,    -- 5.3:
				    -- if condition then 
				    --   sequence_of_statements

    An_Elsif_Alternative,           -- 5.3:
				    -- elsif condition then
				    --   sequence_of_statements

    An_Else_Alternative,            -- 5.3, 9.7.1:
				    -- else sequence_of_statements

    A_Case_Statement_Alternative,   -- 5.4:
				    -- when discrete_choice_list =>
				    --   sequence_of_statements

    A_Select_Statement_Alternative, -- 9.7.1:
				    -- select [guard] select_alternative
				    -- 9.7.2, 9.7.3: 
				    -- select entry_call_alternative
				    -- 9.7.4:
				    -- select triggering_alternative

    An_Or_Alternative,              -- 9.7.1:
			            -- or [guard] select_alternative
				    -- 9.7.2:
			            -- or delay_alternative

    An_Accept_Alternative,          -- 9.7.1:
                                    -- accept_statement [sequence_of_statements]

    A_Delay_Alternative,            -- 9.7.1
                                    -- delay_statement [sequence_of_statements]

    A_Terminate_Alternative,        -- 9.7.1
				    -- terminate;

    A_Then_Abort_Alternative);      -- 9.7.4
                                    -- then abort sequence_of_statements

------------------------------------------------------------------------------
-- Enumerations for Asis.Clauses
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- Clause_Kinds
--  Literals                        -- LRM      -> Subordinate Kinds
------------------------------------------------------------------------------

  type Clause_Kinds is (

    Not_A_Clause,

    A_Use_Package_Clause,  	    -- 8.4
    A_Use_Type_Clause,     	    -- 8.4

    A_With_Clause,                  -- 10.1.2

    A_Representation_Clause,        -- 13.1     -> Representation_Clause_Kinds
    A_Component_Clause);            -- 13.5.3

------------------------------------------------------------------------------
-- Representation_Clause_Kinds - varieties of representation clauses
--  Literals                                  -- LRM
------------------------------------------------------------------------------

  type Representation_Clause_Kinds is (  

    Not_A_Representation_Clause,

    An_Attribute_Definition_Clause,           -- 13.3.1
    An_Enumeration_Representation_Clause,     -- 13.4
    A_Record_Representation_Clause,           -- 13.5.3
    An_At_Clause);                            -- N.7

end ASIS_Element_Kinds;




Section 4.  Specification of package Asis_Unit_Kinds


package ASIS_Unit_Kinds is
------------------------------------------------------------------------------
-- ASIS.Unit_Kinds -- ASIS 9X Version 2.0.A -- Jan 1995
--
-- These enumeration types describe the various kinds of compilation units 
-- manipulated by the ASIS interface.
--|9X-------------------------------------------------------------------------
--|9X package ASIS_Unit_Kinds is new
------------------------------------------------------------------------------
--
------------------------------------------------------------------------------
-- Enumerations for Asis.Compilation_Units
------------------------------------------------------------------------------
--
------------------------------------------------------------------------------
-- Unit_Kinds - the varieties of compilation units existing in a Library
------------------------------------------------------------------------------

  type Unit_Kinds is (  

    Not_A_Unit,                  -- A nil unit kind value.

    A_Subprogram_Declaration,    
    A_Package_Declaration,       
    A_Generic_Declaration,       
    A_Generic_Instantiation,     

    A_Subprogram_Renaming_Declaration,
    A_Package_Renaming_Declaration,
    A_Generic_Renaming_Declaration,

--|9X-------------------------------------------------------------------------
--|9X Unit_Kinds: Added private Unit_Kinds literals to distinguish private 
--|9X and public units.
    A_Private_Subprogram_Declaration,    
    A_Private_Package_Declaration,       
    A_Private_Generic_Declaration,       
    A_Private_Generic_Instantiation,     

    A_Private_Subprogram_Renaming_Declaration,
    A_Private_Package_Renaming_Declaration,
    A_Private_Generic_Renaming_Declaration,

    A_Subprogram_Body,           
    A_Package_Body,              
    A_Subunit,                   

    A_Nonexistent_Declaration,   -- A unit that does not exist but is:
                                 -- 1) mentioned in a with clause of
                                 --    another unit or,
    	                         -- 2) known to be a corresponding 
    	                         --    library unit declaration.

    A_Nonexistent_Body,          -- A unit that does not exist but is:
                                 -- 1) known to be a corresponding
    			         --    subunit or,
    	                         -- 2) known to be a corresponding 
    	                         --    library unit body.

    Unknown);                    -- The unit kind is not known.


------------------------------------------------------------------------------
-- Unit_Origins - classification of possible unit origins/sources
------------------------------------------------------------------------------

  type Unit_Origins is (  

    Not_A_Unit_Origin,              -- A nil, unknown, or nonexistent unit

    A_Predefined_Unit,              -- Ada LRM predefined units as noted in
                                    -- LRM C (22).  These include package
                                    -- Standard, Calendar, Text_Io, etc.

    A_Compiler_Predefined_Unit,     -- Vendor specific library units, eg.
                                    -- runtime support packages, string
                                    -- libraries, etc. It is not required
                                    -- that any vendor supplied units have
                                    -- this origin.  This is a suggestion.
                                    -- Vendors might provide, for example,
                                    -- precompiled versions of public
                                    -- domain software would have
                                    -- A_User_Defined_Unit origin.

    A_User_Defined_Unit);           -- Neither A_Predefined_Unit or
                                    -- A_Compiler_Predefined_Unit

------------------------------------------------------------------------------
-- Relation_Kinds - classifications for inter-unit relationships
------------------------------------------------------------------------------

  type Relation_Kinds is (  
--|9X-------------------------------------------------------------------------
--|9X Added Ancestors and Descendants literals to Relation_Kinds.

    Ancestors,

    Descendants,

----------------------------------------------------------------------
-- Definition:  ANCESTORS of a unit; DESCENDANTS of a unit
--
-- Ancestors of a library unit are itself, its parent, its parent's 
-- parent, and so on.  (Standard is an ancestor of every library unit).
--
-- The Descendants relation is the inverse of the ancestor relation.
----------------------------------------------------------------------

    Direct_Supporters,  

    Supporters,  

----------------------------------------------------------------------
-- Definition:  SUPPORTERS of a unit
--
-- Supporters of a compilation unit are units that must be compiled
-- before the compilation unit can be compiled.  A compilation unit
-- cannot be successfully compiled if one or more Supporters are
-- missing or obsolete.
--
-- Parent units are supporters of their child units.
--|9X-------------------------------------------------------------------------
--|9X Relation_Kinds: The Definition of Supporters now includes parent units.
--
-- Library units mentioned in the with clauses of a compilation unit
-- are both Supporters and Direct_Supporters of that compilation unit.
-- The supporters relation is transitive--units that support library 
-- units with'ed by a compilation unit are (indirect) supporters of that 
-- compilation unit.  Direct_Supporters is a non-transitive relation.
-- All Direct_Supporters of a unit are also Supporters of that unit.
--
-- The package Standard is a Supporter of every unit, but is not
-- considered to be a Direct_Supporter unless it is mentioned in a with
-- clause.
--
-- For example:
--      If A withs B and B withs C.
--      Then C directly supports B, B directly supports A,
--           C indirectly supports A, and
--           both B and C are supporters of A.
--
-- A library unit is a Direct_Supporter of its corresponding secondary
-- unit.  The parent body of a subunit is a Direct_Supporter of the
-- subunit.
----------------------------------------------------------------------

    Direct_Dependents,

    Dependents,

----------------------------------------------------------------------
-- Definition:  DEPENDENTS of a unit
--
-- Dependents are all the units that must be recompiled if the unit
-- were to be recompiled.
--
-- Child units are Direct_Dependents of their parent unit.
--|9X-------------------------------------------------------------------------
--|9X Relation_Kinds: The definition of Dependents now includes child units.
--
-- A compilation unit that mentions other library units in its with
-- clauses is one of the Direct_Dependents of those library units.
-- A unit body is a Direct_Dependent of its corresponding library unit 
-- declaration.  A subunit is a Direct_Dependent of its parent body.
--
-- The Dependents relation is transitive; Dependents of a unit include the 
-- unit's Direct_Dependents, those unit's Direct_Dependents, and so on.
-- A unit that depends on a given unit also (indirectly) depends on the 
-- given unit's Supporters.  Direct_Dependents is a non-transitive relation.
-- All Direct_Dependents of a unit are also Dependents of that unit.
--
-- For example:
--      If A withs B and B withs C
--      then A directly depends on B, B directly depends on C,
--           A indirectly depends on C, and
--           both A and B are dependents of C.
--
-- Dependencies between compilation units may also be introduced by
-- inline inclusions, for certain compiler optimizations, and for
-- certain implementations of generic units.  See LRM 10.3(6-9)
-- The results of these interfaces are intended to reflect all of
-- these considerations.
----------------------------------------------------------------------

    Family,

--|9X-------------------------------------------------------------------------
--|9X Relation_Kinds: The definition of Family now includes descendants.
----------------------------------------------------------------------
-- Definition:  FAMILY of a unit
--
-- The family of a given unit is defined as the set of compilation
-- units that comprise the given unit's declaration, descendants, body,
-- and subunits (and subunits of subunits, etc.).
----------------------------------------------------------------------

    Extended_Family);

--|9X-------------------------------------------------------------------------
--|9X Relation_Kinds: The definition of Extended_Family now includes 
--|9X descendants and ancestors.
----------------------------------------------------------------------
-- Definition:  EXTENDED FAMILY of a unit; CLOSURE of a unit
--
-- The extended family of a given unit is defined as the set of
-- compilation units that comprise the given unit's declaration,
-- descendants, body, subunits, ancestors, transitive supporters, and 
-- the extended families of the ancestors and transitive supporters. 
-- The extended family of a unit, that is a main program, includes all 
-- the Ada units ultimately required to form the program.
--
-- The term closure is commonly used to with similar meaning.
--
-- For example:
--  Assume the body of A has a subunit A.S and the declaration of A has
--  a child unit A.Z.
--      If A withs B and B withs C and C does not with a library unit.
--      Then the extended family of A is:
--        library unit C
--        library unit body C    (if required)
--        library unit B
--        library unit body B    (if required)
--        library unit A
--        child library unit A.Z
--        library unit body A
--        subunit A.S  
--
----------------------------------------------------------------------
end ASIS_Unit_Kinds;

!resolution Accept
!date 95-03-08
!Notes

These were part of the baselined version 2.0.D.

