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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81e1a32ac1a2cfbd,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-08 05:50:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.digex.net!dca6-feed2.news.digex.net!intermedia!netnews.jhuapl.edu!not-for-mail From: Lance Newsgroups: comp.lang.ada Subject: ASIS-FOR-GNAT, anyone? Date: Wed, 08 Aug 2001 08:44:50 -0400 Organization: Johns Hopkins University Applied Physics Lab, Laurel, MD, USA Message-ID: <3B713442.80F2DCE3@yahoo.com> NNTP-Posting-Host: a2dlee.jhuapl.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: houston.jhuapl.edu 997274623 27676 128.244.69.174 (8 Aug 2001 12:43:43 GMT) X-Complaints-To: usenet@houston.jhuapl.edu NNTP-Posting-Date: 8 Aug 2001 12:43:43 GMT X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:11607 Date: 2001-08-08T12:43:43+00:00 List-Id: I've just been assigned a new project at work dealing with ASIS. Not knowing Ada to begin with has made this quite a challenge. I was wondering if someone could help with what seems like an easy thing to do. Say I wanted to count all of the assignment statements in a compilation unit. Assume also that I wanted to print out the name of each subprogram or block in which the assignment statement resides. I cannot seem to find an ASIS function that would allow me to get to this information. I devised my own crude way of doing it but there must be a simple solution that I am overlooking. Thanks for your help in advance. This is an example of what I am talking about: procedure Red is A : Integer; procedure Blue is B: Integer; begin B := 2; end Blue; begin A := 1; end Red; ----------- Now, let stmt1 be "B := 2" and stmt2 be "A := 1". My function would return: Subprogram_Name ( stmt1 ) = "Blue" Subprogram_Name ( stmt2 ) = "Red"