source: trunk/ada-2012/src/semantic/gela-plain_int_sets.ads@ 552

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

Drop Cursor and Visiter for up interpretation set.

Replace it with Any_Cursor and iterator.

  • Property svn:keywords set to Author Date Revision
File size: 3.7 KB
Line 
1with Ada.Containers.Doubly_Linked_Lists;
2with Ada.Containers.Hashed_Maps;
3
4with Gela.Int;
5with Gela.Int_Sets;
6with Gela.Interpretations;
7
8package Gela.Plain_Int_Sets is
9 pragma Preelaborate;
10
11 type Interpretation_Set (Ids : access Gela.Int_Sets.Index_Provider'Class) is
12 new Gela.Int_Sets.Interpretation_Set with private;
13
14 type Interpretation_Set_Access is access all Interpretation_Set'Class;
15
16 not overriding procedure Add
17 (Self : access Interpretation_Set;
18 Index : in out Gela.Interpretations.Interpretation_Set_Index;
19 Item : Gela.Int.Interpretation_Access);
20
21 not overriding procedure Add
22 (Self : access Interpretation_Set;
23 Index : out Gela.Interpretations.Interpretation_Index;
24 Item : Gela.Int.Interpretation_Access);
25
26private
27
28 package Int_Lists is new Ada.Containers.Doubly_Linked_Lists
29 (Element_Type => Gela.Int.Interpretation_Access,
30 "=" => Gela.Int."=");
31
32 function Hash
33 (Value : Gela.Interpretations.Interpretation_Set_Index)
34 return Ada.Containers.Hash_Type;
35
36 package Int_List_Maps is new Ada.Containers.Hashed_Maps
37 (Key_Type => Gela.Interpretations.Interpretation_Set_Index,
38 Element_Type => Int_Lists.List,
39 Hash => Hash,
40 Equivalent_Keys => Gela.Interpretations."=",
41 "=" => Int_Lists."=");
42
43 function Hash
44 (Value : Gela.Interpretations.Interpretation_Index)
45 return Ada.Containers.Hash_Type;
46
47 package Int_Maps is new Ada.Containers.Hashed_Maps
48 (Key_Type => Gela.Interpretations.Interpretation_Index,
49 Element_Type => Gela.Int.Interpretation_Access,
50 Hash => Hash,
51 Equivalent_Keys => Gela.Interpretations."=",
52 "=" => Gela.Int."=");
53
54 type Interpretation_Set (Ids : access Gela.Int_Sets.Index_Provider'Class) is
55 new Gela.Int_Sets.Interpretation_Set with
56 record
57 Set_From, Set_To : Gela.Interpretations.Interpretation_Set_Index := 0;
58 Item_From, Item_To : Gela.Interpretations.Interpretation_Index := 0;
59 Map : Int_List_Maps.Map;
60 Int_Map : Int_Maps.Map;
61 end record;
62
63 overriding function Element
64 (Self : Interpretation_Set;
65 Index : Gela.Interpretations.Interpretation_Index)
66 return Gela.Int.Interpretation_Access;
67
68 overriding function Symbols
69 (Self : access Interpretation_Set;
70 Index : Gela.Interpretations.Interpretation_Set_Index)
71 return Gela.Interpretations.Symbol_Iterators
72 .Forward_Iterator'Class;
73
74 overriding function Categories
75 (Self : access Interpretation_Set;
76 Index : Gela.Interpretations.Interpretation_Set_Index)
77 return Gela.Interpretations.Category_Iterators
78 .Forward_Iterator'Class;
79
80 overriding function Defining_Names
81 (Self : access Interpretation_Set;
82 Index : Gela.Interpretations.Interpretation_Set_Index)
83 return Gela.Interpretations.Defining_Name_Iterators
84 .Forward_Iterator'Class;
85
86 overriding function Expressions
87 (Self : access Interpretation_Set;
88 Index : Gela.Interpretations.Interpretation_Set_Index)
89 return Gela.Interpretations.Expression_Iterators
90 .Forward_Iterator'Class;
91
92 overriding function Profiles
93 (Self : access Interpretation_Set;
94 Index : Gela.Interpretations.Interpretation_Set_Index)
95 return Gela.Interpretations.Profile_Iterators
96 .Forward_Iterator'Class;
97
98 overriding function Each
99 (Self : access Interpretation_Set;
100 Index : Gela.Interpretations.Interpretation_Set_Index)
101 return Gela.Interpretations.Any_Iterators
102 .Forward_Iterator'Class;
103
104end Gela.Plain_Int_Sets;
Note: See TracBrowser for help on using the repository browser.