

                            ASIS/Program View Layer
 
                              Region_Scan Utility



INTRODUCTION
------------

Region_Scan is a generic ASIS element traversal that identifies the
set of "declarative region parts" in a compilation unit.  A
declarative region part is a portion of program text that belongs to
one of the logical declarative regions of the unit.  A declarative
region (LRM 8.1) is an Ada concept used to define the scope of a
declaration.

The ASIS/PVL Reference and Namespace views are views of declarative
region parts.  (See the README file for the Reference view for more
information on region parts.)  The view construction operations for
these views require an object of the type Region which is declared in
the Region_Support package (in the common subsystem).  A Region object
contains the ASIS element that is the root of a particular region
part's element hierarchy.  From this root element, it is possible to
traverse the elements that correspond to the text of the region part.

One way to create Region objects is to use the Region_Scan package.
Region_Scan traverses an ASIS element hierarchy looking for elements
that start a new region part.  When such an element is found, a Region
object containing the element is created; the object is then passed to
a pair of generic formal subprograms. The actual subprograms used to
instantiate Region_Scan typically will construct a view using the
Region object.


FILES
-----

This directory contains the following files:

   README (this file)
   region_scan.1.ada
   region_scan.2.ada
   region_scan.region_scan_internal.2.ada
   region_scan.region_scan_internal.error_handling_support.2.ada
   region_scan.region_scan_internal.scan_any.2.ada
   region_scan.region_scan_internal.scan_any_list.2.ada
   region_scan.region_scan_internal.scan_argument_association.2.ada
   region_scan.region_scan_internal.scan_argument_association_list.2.ada
   region_scan.region_scan_internal.scan_case_statement_alternative.2.ada
   region_scan.region_scan_internal.scan_case_statement_alternative_list.2.ada
   region_scan.region_scan_internal.scan_choice.2.ada
   region_scan.region_scan_internal.scan_choice_list.2.ada
   region_scan.region_scan_internal.scan_compilation_unit.2.ada
   region_scan.region_scan_internal.scan_component_association.2.ada
   region_scan.region_scan_internal.scan_component_association_list.2.ada
   region_scan.region_scan_internal.scan_component_clause.2.ada
   region_scan.region_scan_internal.scan_component_clause_list.2.ada
   region_scan.region_scan_internal.scan_constraint.2.ada
   region_scan.region_scan_internal.scan_context_clause_list.2.ada
   region_scan.region_scan_internal.scan_declaration.2.ada
   region_scan.region_scan_internal.scan_declaration_list.2.ada
   region_scan.region_scan_internal.scan_declarative_item_list.2.ada
   region_scan.region_scan_internal.scan_discrete_range.2.ada
   region_scan.region_scan_internal.scan_discrete_range_list.2.ada
   region_scan.region_scan_internal.scan_discriminant_association.2.ada
   region_scan.region_scan_internal.scan_discriminant_association_list.2.ada
   region_scan.region_scan_internal.scan_entity_name_definition.2.ada
   region_scan.region_scan_internal.scan_entity_name_definition_list.2.ada
   region_scan.region_scan_internal.scan_exception_handler.2.ada
   region_scan.region_scan_internal.scan_exception_handler_list.2.ada
   region_scan.region_scan_internal.scan_expression.2.ada
   region_scan.region_scan_internal.scan_expression_list.2.ada
   region_scan.region_scan_internal.scan_if_statement_arm.2.ada
   region_scan.region_scan_internal.scan_if_statement_arm_list.2.ada
   region_scan.region_scan_internal.scan_null_component.2.ada
   region_scan.region_scan_internal.scan_parameter_association.2.ada
   region_scan.region_scan_internal.scan_parameter_association_list.2.ada
   region_scan.region_scan_internal.scan_pragma.2.ada
   region_scan.region_scan_internal.scan_pragma_list.2.ada
   region_scan.region_scan_internal.scan_record_component_list.2.ada
   region_scan.region_scan_internal.scan_representation_clause.2.ada
   region_scan.region_scan_internal.scan_select_alternative.2.ada
   region_scan.region_scan_internal.scan_select_statement_arm.2.ada
   region_scan.region_scan_internal.scan_select_statement_arm_list.2.ada
   region_scan.region_scan_internal.scan_statement.2.ada
   region_scan.region_scan_internal.scan_statement_list.2.ada
   region_scan.region_scan_internal.scan_subtype_indication.2.ada
   region_scan.region_scan_internal.scan_type_definition.2.ada
   region_scan.region_scan_internal.scan_use_clause.2.ada
   region_scan.region_scan_internal.scan_variant.2.ada
   region_scan.region_scan_internal.scan_variant_list.2.ada
   region_scan.region_scan_internal.scan_variant_part.2.ada
   region_scan.region_scan_internal.scan_with_clause.2.ada
   scan_for_regions.2.ada

SUBSYSTEM COMPONENTS
--------------------

The region_scan subsystem contains a single library unit:

   package Region_Scan

	Declares two traversal operations for locating region parts:
        one for an ASIS compilation unit (which traverses the entire
        element hierarchy of the unit) and one for an arbitrary
        element.  The scan is implemented using a "hand-instantiated"
        copy of the scan subsystem.

In addition, procedure Scan_For_Regions is a test driver for
demonstrating the operation of the subsystem.  Given an ASIS library
and the name of an Ada compilation unit, the test driver invokes
Region_Scan to traverse the complete element hierarchy of the unit.
The program outputs an indented listing of the nested region parts
discovered in the unit.


VIEW SUBSYSTEM DEPENDENCIES
---------------------------

The scan subsystem imports the following subsystems:

   common
   asis

