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 Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!freenix!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: ASIS Question: Looking up procedure names. Date: Wed, 18 May 2005 18:41:52 +0200 Organization: Adalog Message-ID: References: <6ivu7111ovojq41kpt9u4rv8rknpv58mhu@4ax.com> <428b5c41$1_2@newsfeed.slurp.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1116436624 32514 195.25.228.57 (18 May 2005 17:17:04 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 18 May 2005 17:17:04 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en In-Reply-To: <428b5c41$1_2@newsfeed.slurp.net> Xref: g2news1.google.com comp.lang.ada:11081 Date: 2005-05-18T18:41:52+02:00 List-Id: James Alan Farrell a �crit : > Here is how to get the full name: > > First, from call get the entity called > > procedure get_called_entity(ProcCall : asis.element) > CalledEntity : asis.element; > begin > CalledEntity := > asis.statements.corresponding_called_entity(ProcCall); > end; But use Corresponding_Called_Function if it is a function > > CalledEntity is a declaration. To get it's name, use > asis.declarations.names, which returns a list. To turn that into a wide > string, use asis.declarations.defining_name_image(name_list[0]). You meant name_list(1), which language are you using :-) > Now to get the package name, you can use asis.elements.enclosing_element > to get the declaration of the package in which the entity is declared. > This also returns a decl (the package decl) and you can use the same > method to get it's name. That's much too simplistic. The SP can be declared in a block statement, or another procedure. If it comes from an instantiation, you'll get extra levels (the SP declaration is in a (pseudo) package, which is itself inside the instantiation, etc. Believe me: use Full_Name_Image (or rewrite it at your convenience), it is GMGPL. It took me a *lot* of time to get it working in all contexts. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr