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,b6d3089fd3d3c9ea,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-28 03:39:17 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!grolier!foorum!not-for-mail From: Xela Newsgroups: comp.lang.ada Subject: Where is my ASIS mistake? Date: 28 Nov 2003 11:12:11 GMT Message-ID: <20031128-121211-658150@foorum.com> NNTP-Posting-Host: 62.161.92.253 NNTP-Posting-Date: 28 Nov 2003 11:12:11 GMT X-Complaints-To: abuse@foorum.fr X-POSTER: foorum.com X-Foorum_user_id: X-Foorum_user_tmp_id: 2003822-104955-705548-62.161.92.253-club-internet X-Originating-User: 62.161.92.253 X-Newsreader: Foorum Xref: archiver1.google.com comp.lang.ada:3021 Date: 2003-11-28T11:12:11+00:00 List-Id: With a basic ASIS program I am attempting to list all units in my current library. In order, I wrote the following code: ------------ with Asis; with Asis.Implementation; with Asis.Ada_Environments; with Asis.Compilation_Units; with Asis.Ada_Environments.Containers; with Ada.Text_Io; with Ada.Wide_Text_Io; procedure List_Units is My_Context : Asis.Context; Sep : constant String := "------------------------------------------"; begin Asis.Implementation.Initialize; Asis.Ada_Environments.Associate(My_Context, "My Context"); Asis.Ada_Environments.Open (My_Context); declare Libraries_List : Asis.Ada_Environments.Containers.Container_List := Asis.Ada_Environments.Containers.Defining_Containers(My_Context); Units_List : Asis.Compilation_Unit_List := Asis.Ada_Environments.Containers.Compilation_Units( Libraries_List(1)); begin for U in Units_List'range loop Ada.Text_Io.Put_Line(Sep); Ada.Wide_Text_Io.Put_Line("Full Name = "&Asis.Compilation_Units. Unit_Full_Name(Units_List(U))); Ada.Wide_Text_Io.Put_Line("Texte Name= "&Asis.Compilation_Units. Text_Name(Units_List(U))); Ada.Text_Io.Put_Line("Unit Kind = "&Asis.Unit_Kinds'Image(Asis. Compilation_Units.Unit_Kind(Units_List(U)))); end loop; end; Ada.Text_Io.Put_Line(Sep); Asis.Ada_Environments.Close( My_Context ); Asis.Ada_Environments.Dissociate( My_Context ); Asis.Implementation.Finalize; end List_Units; -------- If now I compile with gnat3.15p the following code (gnatmake hello), and also my List_units one : with Ada.Text_Io; procedure Hello is begin Ada.Text_Io.Put_Line("hello!"); end Hello; Executing list_units.exe give me: -------------------------------------- Full Name = Standard Texte Name= Unit Kind = A_PACKAGE -------------------------------------- :-( Now with the same code, If I recompile my list_units program and I execute it under an ObjectAda library registered with the hello unit the result is the expecting one: ------------------------------------------ Full Name = Hello Texte Name= d:\Cholay\Tmp\Exercices\hello.adb Unit Kind = A_PROCEDURE_BODY ------------------------------------------ :-) I am convincing with the fact that I am making a huge error but which one? Thanks for the help! -- Ce message a ete poste via la plateforme Web club-Internet.fr This message has been posted by the Web platform club-Internet.fr http://forums.club-internet.fr/