comp.lang.ada
 help / color / mirror / Atom feed
From: James Alan Farrell <no_spam@no_spam.com>
Subject: Re: ASIS Question: Looking up procedure names.
Date: Mon, 09 May 2005 15:18:54 GMT
Date: 2005-05-09T15:18:54+00:00	[thread overview]
Message-ID: <6ivu7111ovojq41kpt9u4rv8rknpv58mhu@4ax.com> (raw)
In-Reply-To: Xns964FA496D943pchapinsovernet@207.106.92.237

On Sat, 07 May 2005 20:10:46 GMT, "Peter C. Chapin"
<pchapin@sover.net> wrote:

Peter,
I'm working on a project that uses ASIS.  Unfortunately I am on
vacation and my notes on this are at work.  I believe that what you
are trying to do can be done.  If you can wait until next week, I can
look at my notes then.

As for the list of procedure names, this comes about because
asis.declarations is used for all declarations, not just procedure
declarations.  Thus

   A, B : integer;

has to be support.  Get the name here, and you will get a list of two
elements.  For subprograms, yes there will always be only one name.
(Renames clauses are handled differently)

James Alan Farrell

>
>Hi! I'm writing an ASIS program and I've encountered a problem that I'm 
>having trouble figuring out.
>
>I have an element that I know is a procedure call statement. What I'm 
>looking for is the full name of the procedure, including package 
>membership. So for example
>
>with Ada.Text_IO; use Ada.Text_IO;
>
>procedure Hello is
>begin
>  Put_Line("Hello, World");
>end Hello;
>
>When looking at the Put_Line procedure call statement, I want to get the 
>name "Ada.Text_IO.Put_Line." Is this possible?
>
>Starting with the procedure call statement, I can use 
>Corresponding_Called_Entity to get the procedure declaration. I can then 
>use Names to get a list of defining names for that declaration (wouldn't 
>there always be only one such name for procedure declarations?). I can 
>then convert the first name on this list to program text using 
>Defining_Name_Image. However, the name returned in this case is just 
>'Put_Line' and not 'Ada.Text_IO.Put_Line' as desired.
>
>I see in Asis.Declarations the function Defining_Prefix that takes 
>A_Defining_Expanded_Name and returns the prefix. So that tells me what I 
>need is a way to get A_Defining_Expanded_Name from my procedure call 
>statement. This is where I'm stuck.
>
>TIA
>
>Peter




  parent reply	other threads:[~2005-05-09 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-07 20:10 ASIS Question: Looking up procedure names Peter C. Chapin
2005-05-09  8:49 ` Jean-Pierre Rosen
2005-05-09 11:25   ` Peter C. Chapin
2005-05-09 15:18 ` James Alan Farrell [this message]
2005-05-18 15:14   ` James Alan Farrell
2005-05-18 16:41     ` Jean-Pierre Rosen
2005-05-18 18:08       ` James Alan Farrell
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox