From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d4a99b2a2a2899b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!prodigy.net!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr31.news.prodigy.com.POSTED!5a33a34b!not-for-mail From: James Alan Farrell Newsgroups: comp.lang.ada Subject: Re: ASIS Question: Looking up procedure names. Message-ID: <6ivu7111ovojq41kpt9u4rv8rknpv58mhu@4ax.com> References: X-Newsreader: Forte Free Agent 2.0/32.652 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 4.157.11.200 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr31.news.prodigy.com 1115651934 ST000 4.157.11.200 (Mon, 09 May 2005 11:18:54 EDT) NNTP-Posting-Date: Mon, 09 May 2005 11:18:54 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: T[OGRACEYJVOBFH[\ZHL_RH@LZOZ@GXOXR]ZMVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Date: Mon, 09 May 2005 15:18:54 GMT Xref: g2news1.google.com comp.lang.ada:10979 Date: 2005-05-09T15:18:54+00:00 List-Id: On Sat, 07 May 2005 20:10:46 GMT, "Peter C. Chapin" 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