source: trunk/ada-2012/src/semantic/gela-array_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

File size: 2.9 KB
Line 
1private with Gela.Elements.Defining_Names;
2with Gela.Elements.Full_Type_Declarations;
3with Gela.Types.Arrays;
4with Gela.Types.Simple;
5with Gela.Types.Visitors;
6with Gela.Type_Categories;
7with Gela.Semantic_Types;
8
9package Gela.Array_Type_Views is
10 pragma Preelaborate;
11
12 type Type_View (<>) is new Gela.Type_Categories.Type_View
13 and Gela.Types.Arrays.Array_Type with private;
14
15 type Type_View_Access is access all Type_View'Class;
16
17 function Create_Full_Type
18 (Category : Gela.Type_Categories.Category_Kinds;
19 Decl : Gela.Elements.Full_Type_Declarations
20 .Full_Type_Declaration_Access;
21 Component : Gela.Semantic_Types.Type_Index;
22 Indexes : Gela.Semantic_Types.Type_Index_Array)
23 return Gela.Type_Categories.Type_View_Access;
24
25private
26
27 type Type_View (Length : Positive) is new Gela.Type_Categories.Type_View
28 and Gela.Types.Arrays.Array_Type with
29 record
30 Category : Gela.Type_Categories.Category_Kinds;
31 Indexes : Gela.Semantic_Types.Type_Index_Array (1 .. Length);
32 Component : Gela.Semantic_Types.Type_Index;
33 Decl : Gela.Elements.Full_Type_Declarations
34 .Full_Type_Declaration_Access;
35 end record;
36
37 overriding function Category
38 (Self : Type_View) return Gela.Type_Categories.Category_Kinds;
39
40 overriding function Is_The_Same_Type
41 (Left : Type_View;
42 Right : Gela.Types.Type_View'Class) return Boolean;
43
44 overriding function Is_Expected_Type
45 (Self : Type_View;
46 Expected : not null Gela.Types.Type_View_Access) return Boolean;
47
48 overriding procedure Visit
49 (Self : not null access Type_View;
50 Visiter : in out Gela.Types.Visitors.Type_Visitor'Class);
51
52 overriding function Is_Array (Self : Type_View) return Boolean;
53
54 overriding function Is_Character (Self : Type_View) return Boolean;
55
56 overriding function Is_Enumeration (Self : Type_View) return Boolean;
57
58 overriding function Is_Floating_Point (Self : Type_View) return Boolean;
59
60 overriding function Is_Modular_Integer (Self : Type_View) return Boolean;
61
62 overriding function Is_Object_Access (Self : Type_View) return Boolean;
63
64 overriding function Is_Record (Self : Type_View) return Boolean;
65
66 overriding function Is_Signed_Integer (Self : Type_View) return Boolean;
67
68 overriding function Is_Universal (Self : Type_View) return Boolean;
69
70 overriding function Is_Root (Self : Type_View) return Boolean;
71
72 overriding function Index_Types
73 (Self : Type_View) return Gela.Types.Simple.Discrete_Type_Array;
74
75 overriding function Index_Types
76 (Self : Type_View) return Gela.Semantic_Types.Type_Index_Array;
77
78 overriding function Dimension (Self : Type_View) return Positive;
79
80 overriding function Component_Type
81 (Self : Type_View) return Gela.Semantic_Types.Type_Index;
82
83 overriding function Defining_Name (Self : Type_View)
84 return Gela.Elements.Defining_Names.Defining_Name_Access;
85
86end Gela.Array_Type_Views;
Note: See TracBrowser for help on using the repository browser.