TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Stephen Leake <[log in to unmask]>
Date: Fri, 8 Dec 2000 14:45:49 -0500
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Reply-To: Stephen Leake <[log in to unmask]>
Parts/Attachments: text/plain (30 lines)
I'm writing an ASIS application that will generate a Text_IO child
package for a package containing types (record types, array types,

I'm trying to figure out what query to call in the following
situation. The type declarations are:

   type Parameter_Type is record
      h_1       : Math.Float_Type;
      Sc_r_Tank : Math.DOF_3.Cart_Vector_Type;
   end record;

   type Index_Type is range 1 .. 10;
   type Integer_Array_Parameter_Type is array (Index_Type) of Parameter_Type;

I'm traversing the ASIS tree, and I'm in the type definition for
Integer_Array_Parameter_Type, looking at Parameter_Type. What query
can I use to get the declaration of Parameter_Type, so I can ask
whether it is an integer, float, array, or record? I need to find out,
so I can instantiate an appropriate Generic Text_IO package.

Corresponding_Expression_Type would seem appropriate, but I'm not in
an expression, so it fails. Parameter_Type is A_Component_Declaration
(or An_Identifier).

More detail and sample code on request :).

-- Stephe