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

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

Add Is_The_Same_Type function

  • Property svn:keywords set to Author Date Revision
File size: 4.1 KB
Line 
1with Gela.Elements.Defining_Names;
2with Gela.Elements.Full_Type_Declarations;
3with Gela.Elements.Formal_Type_Declarations;
4with Gela.Elements.Subtype_Marks;
5with Gela.Elements.Discriminant_Parts;
6with Gela.Lexical_Types;
7with Gela.Types.Simple;
8with Gela.Types.Untagged_Records;
9with Gela.Types.Visitors;
10with Gela.Type_Categories;
11
12package Gela.Plain_Type_Views is
13 pragma Preelaborate;
14
15 type Type_View is new Gela.Type_Categories.Type_View
16 and Gela.Types.Simple.Character_Type
17 and Gela.Types.Simple.Enumeration_Type
18 and Gela.Types.Simple.Signed_Integer_Type
19 and Gela.Types.Simple.Floating_Point_Type
20 and Gela.Types.Simple.Object_Access_Type
21 and Gela.Types.Simple.Subprogram_Access_Type
22 and Gela.Types.Untagged_Records.Untagged_Record_Type with private;
23
24 type Type_View_Access is access all Type_View'Class;
25
26 function Create_Full_Type
27 (Category : Gela.Type_Categories.Category_Kinds;
28 Decl : Gela.Elements.Full_Type_Declarations
29 .Full_Type_Declaration_Access)
30 return Gela.Type_Categories.Type_View_Access;
31
32 function Create_Root_Type
33 (Category : Gela.Type_Categories.Category_Kinds;
34 Decl : Gela.Elements.Full_Type_Declarations
35 .Full_Type_Declaration_Access)
36 return Gela.Type_Categories.Type_View_Access;
37
38 function Create_Formal_Type
39 (Category : Gela.Type_Categories.Category_Kinds;
40 Decl : Gela.Elements.Formal_Type_Declarations
41 .Formal_Type_Declaration_Access)
42 return Gela.Type_Categories.Type_View_Access;
43
44private
45
46 type Type_View is new Gela.Type_Categories.Type_View
47 and Gela.Types.Simple.Character_Type
48 and Gela.Types.Simple.Enumeration_Type
49 and Gela.Types.Simple.Signed_Integer_Type
50 and Gela.Types.Simple.Floating_Point_Type
51 and Gela.Types.Simple.Object_Access_Type
52 and Gela.Types.Simple.Subprogram_Access_Type
53 and Gela.Types.Untagged_Records.Untagged_Record_Type with
54 record
55 Category : Gela.Type_Categories.Category_Kinds;
56 Def : access Gela.Elements.Element'Class;
57 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
58 Discr : Gela.Elements.Discriminant_Parts.Discriminant_Part_Access;
59 end record;
60
61 overriding function Category
62 (Self : Type_View) return Gela.Type_Categories.Category_Kinds;
63
64 overriding function Get_Discriminant
65 (Self : Type_View;
66 Symbol : Gela.Lexical_Types.Symbol)
67 return Gela.Elements.Defining_Names.Defining_Name_Access;
68
69 overriding function Get_Component
70 (Self : Type_View;
71 Symbol : Gela.Lexical_Types.Symbol)
72 return Gela.Elements.Defining_Names.Defining_Name_Access;
73
74 overriding function Get_Designated
75 (Self : Type_View)
76 return Gela.Elements.Subtype_Marks.Subtype_Mark_Access;
77
78 overriding function Is_The_Same_Type
79 (Left : Type_View;
80 Right : Gela.Types.Type_View'Class) return Boolean;
81
82 overriding function Is_Expected_Type
83 (Self : Type_View;
84 Expected : not null Gela.Types.Type_View_Access) return Boolean;
85
86 overriding procedure Visit
87 (Self : not null access Type_View;
88 Visiter : in out Gela.Types.Visitors.Type_Visitor'Class);
89
90 overriding function Is_Array (Self : Type_View) return Boolean;
91
92 overriding function Is_Character (Self : Type_View) return Boolean;
93
94 overriding function Is_Enumeration (Self : Type_View) return Boolean;
95
96 overriding function Is_Floating_Point (Self : Type_View) return Boolean;
97
98 overriding function Is_Modular_Integer (Self : Type_View) return Boolean;
99
100 overriding function Is_Object_Access (Self : Type_View) return Boolean;
101
102 overriding function Is_Record (Self : Type_View) return Boolean;
103
104 overriding function Is_Signed_Integer (Self : Type_View) return Boolean;
105
106 overriding function Is_Universal (Self : Type_View) return Boolean;
107
108 overriding function Is_Root (Self : Type_View) return Boolean;
109
110 overriding function Defining_Name (Self : Type_View)
111 return Gela.Elements.Defining_Names.Defining_Name_Access;
112
113 type Root_Type_View is new Type_View with null record;
114
115 overriding function Is_Root (Self : Root_Type_View) return Boolean;
116
117end Gela.Plain_Type_Views;
Note: See TracBrowser for help on using the repository browser.