source: trunk/ada-2012/src/semantic/gela-derived_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: 3.8 KB
Line 
1with Gela.Elements.Defining_Names;
2with Gela.Elements.Full_Type_Declarations;
3with Gela.Elements.Subtype_Marks;
4with Gela.Lexical_Types;
5with Gela.Types.Arrays;
6with Gela.Types.Simple;
7with Gela.Types.Untagged_Records;
8with Gela.Types.Visitors;
9with Gela.Type_Categories;
10with Gela.Semantic_Types;
11
12package Gela.Derived_Type_Views is
13 pragma Preelaborate;
14
15 type Type_View is new Gela.Type_Categories.Type_View
16 and Gela.Types.Simple.Enumeration_Type
17 and Gela.Types.Simple.Signed_Integer_Type
18 and Gela.Types.Simple.Floating_Point_Type
19 and Gela.Types.Simple.Object_Access_Type
20 and Gela.Types.Simple.Subprogram_Access_Type
21 and Gela.Types.Untagged_Records.Untagged_Record_Type
22 and Gela.Types.Arrays.Array_Type with private;
23
24 type Type_View_Access is access all Type_View'Class;
25
26 function Create_Derived_Type
27 (Parent : not null Gela.Type_Categories.Type_View_Access;
28 Decl : Gela.Elements.Full_Type_Declarations
29 .Full_Type_Declaration_Access)
30 return Gela.Type_Categories.Type_View_Access;
31
32private
33
34 type Type_View is new Gela.Type_Categories.Type_View
35 and Gela.Types.Simple.Enumeration_Type
36 and Gela.Types.Simple.Signed_Integer_Type
37 and Gela.Types.Simple.Floating_Point_Type
38 and Gela.Types.Simple.Object_Access_Type
39 and Gela.Types.Simple.Subprogram_Access_Type
40 and Gela.Types.Untagged_Records.Untagged_Record_Type
41 and Gela.Types.Arrays.Array_Type with
42 record
43 Parent : not null Gela.Type_Categories.Type_View_Access;
44 Decl : Gela.Elements.Full_Type_Declarations
45 .Full_Type_Declaration_Access;
46 end record;
47
48 overriding function Category
49 (Self : Type_View) return Gela.Type_Categories.Category_Kinds;
50
51 overriding function Get_Discriminant
52 (Self : Type_View;
53 Symbol : Gela.Lexical_Types.Symbol)
54 return Gela.Elements.Defining_Names.Defining_Name_Access;
55
56 overriding function Get_Component
57 (Self : Type_View;
58 Symbol : Gela.Lexical_Types.Symbol)
59 return Gela.Elements.Defining_Names.Defining_Name_Access;
60
61 overriding function Get_Designated
62 (Self : Type_View)
63 return Gela.Elements.Subtype_Marks.Subtype_Mark_Access;
64
65 overriding function Index_Types
66 (Self : Type_View) return Gela.Types.Simple.Discrete_Type_Array;
67
68 overriding function Index_Types
69 (Self : Type_View) return Gela.Semantic_Types.Type_Index_Array;
70
71 overriding function Dimension (Self : Type_View) return Positive;
72
73 overriding function Component_Type
74 (Self : Type_View) return Gela.Semantic_Types.Type_Index;
75
76 overriding function Is_The_Same_Type
77 (Left : Type_View;
78 Right : Gela.Types.Type_View'Class) return Boolean;
79
80 overriding function Is_Expected_Type
81 (Self : Type_View;
82 Expected : not null Gela.Types.Type_View_Access) return Boolean;
83
84 overriding procedure Visit
85 (Self : not null access Type_View;
86 Visiter : in out Gela.Types.Visitors.Type_Visitor'Class);
87
88 overriding function Is_Array (Self : Type_View) return Boolean;
89
90 overriding function Is_Character (Self : Type_View) return Boolean;
91
92 overriding function Is_Enumeration (Self : Type_View) return Boolean;
93
94 overriding function Is_Floating_Point (Self : Type_View) return Boolean;
95
96 overriding function Is_Modular_Integer (Self : Type_View) return Boolean;
97
98 overriding function Is_Object_Access (Self : Type_View) return Boolean;
99
100 overriding function Is_Record (Self : Type_View) return Boolean;
101
102 overriding function Is_Signed_Integer (Self : Type_View) return Boolean;
103
104 overriding function Is_Universal (Self : Type_View) return Boolean;
105
106 overriding function Is_Root (Self : Type_View) return Boolean;
107
108 overriding function Defining_Name (Self : Type_View)
109 return Gela.Elements.Defining_Names.Defining_Name_Access;
110
111end Gela.Derived_Type_Views;
Note: See TracBrowser for help on using the repository browser.