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

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

Split subtype_indication into two

scalar_subtype_indication and composite_subtype_indication.
This allows have different types for "Up" property.
scalar_subtype_indication has Interpretation_Set_Index and
composite_subtype_indication has Interpretation_Tuple_List_Index.
"Up" property of scalar_subtype_indication should have the same
type as expression, because both of them are membership_choice.

  • Property svn:keywords set to Author Date Revision
File size: 10.0 KB
Line 
1with Gela.Compilations;
2with Gela.Interpretations;
3with Gela.Lexical_Types;
4with Gela.Semantic_Types;
5with Gela.Elements.Defining_Names;
6with Gela.Elements.Generic_Associations;
7
8package Gela.Resolve is
9 pragma Preelaborate;
10
11 procedure Direct_Name
12 (Comp : Gela.Compilations.Compilation_Access;
13 Env : Gela.Semantic_Types.Env_Index;
14 Symbol : Gela.Lexical_Types.Symbol;
15 Set : out Gela.Interpretations.Interpretation_Set_Index);
16 -- Resolve Symbol as direct_name and populate interpretation set with
17 -- defining name interpretations
18
19 procedure Selected_Component
20 (Comp : Gela.Compilations.Compilation_Access;
21 Env : Gela.Semantic_Types.Env_Index;
22 Prefix : Gela.Interpretations.Interpretation_Set_Index;
23 Symbol : Gela.Lexical_Types.Symbol;
24 Set : out Gela.Interpretations.Interpretation_Set_Index);
25 -- Resolve Symbol as selected_component and populate interpretation set
26 -- with defining name interpretations
27
28 procedure Attribute_Reference
29 (Comp : Gela.Compilations.Compilation_Access;
30 Env : Gela.Semantic_Types.Env_Index;
31 Prefix : Gela.Interpretations.Interpretation_Set_Index;
32 Symbol : Gela.Lexical_Types.Symbol;
33 Set : out Gela.Interpretations.Interpretation_Set_Index);
34 -- Resolve Symbol as attr. reference designator and populate interpretation
35 -- set with interpretations
36
37 procedure Simple_Expression_Range
38 (Comp : Gela.Compilations.Compilation_Access;
39 Env : Gela.Semantic_Types.Env_Index;
40 Left : Gela.Interpretations.Interpretation_Set_Index;
41 Right : Gela.Interpretations.Interpretation_Set_Index;
42 Set : out Gela.Interpretations.Interpretation_Set_Index);
43
44 procedure Membership_Test
45 (Comp : Gela.Compilations.Compilation_Access;
46 Env : Gela.Semantic_Types.Env_Index;
47 Left : Gela.Interpretations.Interpretation_Set_Index;
48 Right : Gela.Interpretations.Interpretation_Set_Index;
49 Set : out Gela.Interpretations.Interpretation_Set_Index);
50
51 procedure Discrete_Range
52 (Comp : Gela.Compilations.Compilation_Access;
53 Env : Gela.Semantic_Types.Env_Index;
54 Left : Gela.Interpretations.Interpretation_Set_Index;
55 Right : Gela.Interpretations.Interpretation_Set_Index;
56 Tipe : out Gela.Semantic_Types.Type_Index);
57
58 procedure Discrete_Range_Lower
59 (Comp : Gela.Compilations.Compilation_Access;
60 Env : Gela.Semantic_Types.Env_Index;
61 Left : Gela.Interpretations.Interpretation_Set_Index;
62 Right : Gela.Interpretations.Interpretation_Set_Index;
63 Result : out Gela.Interpretations.Interpretation_Index);
64
65 procedure Discrete_Range_Upper
66 (Comp : Gela.Compilations.Compilation_Access;
67 Env : Gela.Semantic_Types.Env_Index;
68 Left : Gela.Interpretations.Interpretation_Set_Index;
69 Right : Gela.Interpretations.Interpretation_Set_Index;
70 Result : out Gela.Interpretations.Interpretation_Index);
71
72 procedure Function_Call
73 (Comp : Gela.Compilations.Compilation_Access;
74 Env : Gela.Semantic_Types.Env_Index;
75 Prefix : Gela.Interpretations.Interpretation_Set_Index;
76 Args : Gela.Interpretations.Interpretation_Tuple_List_Index;
77 Set : out Gela.Interpretations.Interpretation_Set_Index);
78
79 procedure Qualified_Expression
80 (Comp : Gela.Compilations.Compilation_Access;
81 Env : Gela.Semantic_Types.Env_Index;
82 Prefix : Gela.Interpretations.Interpretation_Set_Index;
83 Arg : Gela.Interpretations.Interpretation_Set_Index;
84 Set : out Gela.Interpretations.Interpretation_Set_Index);
85
86 procedure Shall_Be_Subtype
87 (Comp : Gela.Compilations.Compilation_Access;
88 Env : Gela.Semantic_Types.Env_Index;
89 Set : Gela.Interpretations.Interpretation_Set_Index;
90 Result : out Gela.Interpretations.Interpretation_Index);
91 -- Set of interpretation shall resolve to denote a subtype. 3.2.2 (8)
92
93 procedure To_Type
94 (Comp : Gela.Compilations.Compilation_Access;
95 Env : Gela.Semantic_Types.Env_Index;
96 Type_Up : Gela.Interpretations.Interpretation_Set_Index;
97 Expr_Up : Gela.Interpretations.Interpretation_Set_Index;
98 Result : out Gela.Interpretations.Interpretation_Index);
99 -- Resolve Type_Up to be type, then resolve Expr_Up have this type
100
101 procedure To_The_Same_Type
102 (Comp : Gela.Compilations.Compilation_Access;
103 Env : Gela.Semantic_Types.Env_Index;
104 Type_Up : Gela.Interpretations.Interpretation_Set_Index;
105 Expr_Up : Gela.Interpretations.Interpretation_Set_Index;
106 Result : out Gela.Interpretations.Interpretation_Index);
107 -- Resolve Type_Up to be an expression of some type, then resolve Expr_Up
108 -- to have this type.
109
110 procedure Case_Statement
111 (Comp : Gela.Compilations.Compilation_Access;
112 Env : Gela.Semantic_Types.Env_Index;
113 Expr_Up : Gela.Interpretations.Interpretation_Set_Index;
114 Tuple : Gela.Interpretations.Interpretation_Tuple_List_Index;
115 Result : out Gela.Interpretations.Interpretation_Index);
116 -- Resolve Type_Up to be an expression of some type, then resolve each item
117 -- of Tuple to have this type.
118
119 procedure To_Type_Or_The_Same_Type
120 (Comp : Gela.Compilations.Compilation_Access;
121 Env : Gela.Semantic_Types.Env_Index;
122 Type_Up : Gela.Interpretations.Interpretation_Set_Index;
123 Expr_Up : Gela.Interpretations.Interpretation_Set_Index;
124 Result : out Gela.Interpretations.Interpretation_Index);
125 -- Resolve Type_Up to be a type or an expression of some type,
126 -- then resolve Expr_Up to have this type.
127
128 procedure Character_Literal
129 (Comp : Gela.Compilations.Compilation_Access;
130 Result : out Gela.Interpretations.Interpretation_Set_Index);
131
132 procedure Numeric_Literal
133 (Comp : Gela.Compilations.Compilation_Access;
134 Token : Gela.Lexical_Types.Token_Count;
135 Result : out Gela.Interpretations.Interpretation_Set_Index);
136
137 procedure String_Literal
138 (Comp : Gela.Compilations.Compilation_Access;
139 Token : Gela.Lexical_Types.Token_Count;
140 Result : out Gela.Interpretations.Interpretation_Set_Index);
141
142 procedure Interpretation
143 (Comp : Gela.Compilations.Compilation_Access;
144 Env : Gela.Semantic_Types.Env_Index;
145 Set : Gela.Interpretations.Interpretation_Set_Index;
146 Result : out Gela.Interpretations.Interpretation_Index);
147 -- Get any interpretation from the Set excluding Symbol
148
149 function Placeholder
150 (Comp : Gela.Compilations.Compilation_Access)
151 return Gela.Interpretations.Interpretation_Set_Index;
152
153 procedure Constraint
154 (Comp : Gela.Compilations.Compilation_Access;
155 Constraint : access Gela.Elements.Element'Class;
156 Env : Gela.Semantic_Types.Env_Index;
157 Type_Up : Gela.Interpretations.Interpretation_Set_Index;
158 Constr : Gela.Interpretations.Interpretation_Tuple_List_Index;
159 Result : out Gela.Interpretations.Interpretation_Index);
160
161 procedure Constraint
162 (Comp : Gela.Compilations.Compilation_Access;
163 Constraint : access Gela.Elements.Element'Class;
164 Env : Gela.Semantic_Types.Env_Index;
165 Type_Up : Gela.Interpretations.Interpretation_Set_Index;
166 Constr : Gela.Interpretations.Interpretation_Set_Index;
167 Result : out Gela.Interpretations.Interpretation_Index);
168
169 procedure Variant_Part
170 (Comp : Gela.Compilations.Compilation_Access;
171 Env : Gela.Semantic_Types.Env_Index;
172 Name_Up : Gela.Interpretations.Interpretation_Set_Index;
173 Variants : Gela.Interpretations.Interpretation_Tuple_List_Index;
174 Result : out Gela.Interpretations.Interpretation_Index);
175 -- Resolve variant_part using Name_Up as interpretations of discriminant,
176 -- Variants is putle of tuples of discrete_choice interpretations
177
178 procedure Assignment_Right
179 (Comp : Gela.Compilations.Compilation_Access;
180 Env : Gela.Semantic_Types.Env_Index;
181 Left : Gela.Interpretations.Interpretation_Set_Index;
182 Right : Gela.Interpretations.Interpretation_Set_Index;
183 Result : out Gela.Interpretations.Interpretation_Index);
184
185 procedure Signed_Integer_Type
186 (Comp : Gela.Compilations.Compilation_Access;
187 Up : Gela.Interpretations.Interpretation_Set_Index;
188 Result : out Gela.Interpretations.Interpretation_Index);
189
190 procedure Real_Type
191 (Comp : Gela.Compilations.Compilation_Access;
192 Up : Gela.Interpretations.Interpretation_Set_Index;
193 Result : out Gela.Interpretations.Interpretation_Index);
194
195 function Record_Matcher
196 return not null Gela.Interpretations.Type_Matcher_Access;
197
198 function Array_Matcher
199 return not null Gela.Interpretations.Type_Matcher_Access;
200
201 procedure Record_Aggregate
202 (Comp : Gela.Compilations.Compilation_Access;
203 Env : Gela.Semantic_Types.Env_Index;
204 Up : Gela.Interpretations.Interpretation_Index;
205 Tuple : Gela.Interpretations.Interpretation_Tuple_List_Index;
206 Result : out Gela.Interpretations.Interpretation_Index);
207
208 procedure Generic_Association
209 (Comp : Gela.Compilations.Compilation_Access;
210 Env : Gela.Semantic_Types.Env_Index;
211-- Actual_Part : Gela.Elements.Generic_Associations.
212-- Generic_Association_Sequence_Access;
213 Up : Gela.Interpretations.Interpretation_Set_Index;
214 Result : out Gela.Interpretations.Interpretation_Index);
215
216 procedure Generic_Association_List
217 (Comp : Gela.Compilations.Compilation_Access;
218 Env : Gela.Semantic_Types.Env_Index;
219 Instance : Gela.Elements.Element_Access;
220 Generic_Name : Gela.Elements.Defining_Names.Defining_Name_Access;
221 Actual_Part : Gela.Elements.Generic_Associations.
222 Generic_Association_Sequence_Access;
223 Associations : Gela.Interpretations.Interpretation_Tuple_Index;
224 Result : out Gela.Interpretations.Interpretation_Index);
225
226end Gela.Resolve;
Note: See TracBrowser for help on using the repository browser.