source: trunk/ada-2012/src/semantic/gela-plain_environments-debug.adb@ 552

Last change on this file since 552 was 426, checked in by Maxim Reznik, 7 years ago

Minor refactoring

Rename Count_Type to List in Gela.Peristent_Lists. Hide Index_Type

  • Property svn:keywords set to Author Date Revision
File size: 1.9 KB
Line 
1with Gela.Symbol_Sets;
2procedure Gela.Plain_Environments.Debug
3 (Self : access Environment_Set;
4 Index : Gela.Semantic_Types.Env_Index)
5is
6 procedure Puts (X : String);
7 pragma Import (C, Puts, "puts");
8
9 procedure Print_Region
10 (Index : Region_Enum; List : Region_Item_List);
11
12 procedure Print (Item : Region_Item);
13
14 procedure Print (Item : Region_Item) is
15 use type Gela.Elements.Defining_Names.Defining_Name_Access;
16
17 procedure Print_Item
18 (Symbol : Gela.Lexical_Types.Symbol;
19 Name : Gela.Elements.Defining_Names.Defining_Name_Access);
20
21 Set : Gela.Symbol_Sets.Symbol_Set_Access;
22 Symbol : Gela.Lexical_Types.Symbol;
23
24 procedure Print_Item
25 (Symbol : Gela.Lexical_Types.Symbol;
26 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
27 is
28 pragma Unreferenced (Name);
29 begin
30 Puts (" " & Set.Image (Symbol).To_UTF_8_String & ASCII.NUL);
31 end Print_Item;
32 begin
33 Set := Self.Context.Symbols;
34 if Item.Name = null then
35 Symbol := 0;
36 else
37 Symbol := Item.Name.Full_Name;
38 end if;
39
40 Puts (" begin region " &
41 Set.Image (Symbol).To_UTF_8_String & ASCII.NUL);
42 Self.Names.For_Each (Item.Local, Print_Item'Access);
43 Puts (" end region" & ASCII.NUL);
44 end Print;
45
46 ------------------
47 -- Print_Region --
48 ------------------
49
50 procedure Print_Region (Index : Region_Enum; List : Region_Item_List) is
51 begin
52 Puts (Region_Enum'Image (Index) & ASCII.NUL);
53 Self.Region.For_Each (List, Print'Access);
54 end Print_Region;
55
56 Env : Env_Item;
57begin
58 Puts ("begin Debug" & ASCII.NUL);
59
60 if Index in Env_Item_Index then
61 Env := Self.Env.Element (Index);
62
63 for J in Env.Region_List'Range loop
64 Print_Region (J, Env.Region_List (J));
65 end loop;
66 end if;
67
68 Puts ("end Debug" & ASCII.NUL);
69end Gela.Plain_Environments.Debug;
Note: See TracBrowser for help on using the repository browser.