source: trunk/ada-2012/src/semantic/gela-pass_utils.adb@ 370

Last change on this file since 370 was 370, checked in by Maxim Reznik, 6 years ago

Add evaluation for numeric static expression

File size: 23.9 KB
Line 
1------------------------------------------------------------------------------
2-- G E L A A S I S --
3-- ASIS implementation for Gela project, a portable Ada compiler --
4-- a portable Ada compiler --
5-- http://gela.ada-ru.org/ --
6-- - - - - - - - - - - - - - - - --
7-- Read copyright and license in gela.ads file --
8------------------------------------------------------------------------------
9
10with League.Strings;
11
12with Gela.Element_Factories;
13with Gela.Element_Visiters;
14with Gela.Elements.Compilation_Unit_Bodies;
15with Gela.Elements.Context_Items;
16with Gela.Elements.Defining_Designators;
17with Gela.Elements.Enumeration_Type_Definitions;
18with Gela.Elements.Full_Type_Declarations;
19with Gela.Elements.Function_Declarations;
20with Gela.Elements.Identifiers;
21with Gela.Elements.Package_Declarations;
22with Gela.Elements.Parameter_Specifications;
23with Gela.Elements.Procedure_Bodies;
24with Gela.Elements.Program_Unit_Names;
25with Gela.Elements.Selected_Identifiers;
26with Gela.Elements.Selector_Names;
27with Gela.Elements.Subtype_Mark_Or_Access_Definitions;
28with Gela.Elements.Type_Definitions;
29with Gela.Elements.Use_Package_Clauses;
30with Gela.Elements.With_Clauses;
31with Gela.Environments;
32with Gela.Plain_Type_Managers;
33with Gela.Symbol_Sets;
34with Gela.Elements.Defining_Operator_Symbols;
35with Gela.Defining_Name_Cursors;
36
37package body Gela.Pass_Utils is
38
39 procedure Preprocess_Standard
40 (Comp : Gela.Compilations.Compilation_Access;
41 Unit : Gela.Elements.Element_Access);
42
43 procedure Postprocess_Standard
44 (Comp : Gela.Compilations.Compilation_Access;
45 Unit : Gela.Elements.Compilation_Unit_Declarations.
46 Compilation_Unit_Declaration_Access;
47 Env : in out Gela.Semantic_Types.Env_Index);
48
49 function Is_Enumeration
50 (Decl : Gela.Elements.Element_Access) return Boolean;
51
52 procedure Add_Library_Level_Use_Clauses
53 (Comp : Gela.Compilations.Compilation_Access;
54 Decl : Gela.Elements.Element_Access;
55 Env : in out Gela.Semantic_Types.Env_Index);
56
57 procedure Add_Library_Level_Use_Clauses
58 (Comp : Gela.Compilations.Compilation_Access;
59 Decl : Gela.Elements.Element_Access;
60 Env : in out Gela.Semantic_Types.Env_Index)
61 is
62
63 package Get is
64
65 type Visiter is new Gela.Element_Visiters.Visiter with record
66 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
67 end record;
68
69 overriding procedure Compilation_Unit_Body
70 (Self : in out Visiter;
71 Node : not null Gela.Elements.Compilation_Unit_Bodies.
72 Compilation_Unit_Body_Access);
73
74 overriding procedure Compilation_Unit_Declaration
75 (Self : in out Visiter;
76 Node : not null Gela.Elements.Compilation_Unit_Declarations.
77 Compilation_Unit_Declaration_Access);
78
79 overriding procedure Identifier
80 (Self : in out Visiter;
81 Node : not null Gela.Elements.Identifiers.Identifier_Access);
82
83 overriding procedure Package_Declaration
84 (Self : in out Visiter;
85 Node : not null Gela.Elements.Package_Declarations.
86 Package_Declaration_Access);
87
88 overriding procedure Procedure_Body
89 (Self : in out Visiter;
90 Node : not null Gela.Elements.Procedure_Bodies.
91 Procedure_Body_Access);
92
93 overriding procedure Selected_Identifier
94 (Self : in out Visiter;
95 Node : not null Gela.Elements.Selected_Identifiers.
96 Selected_Identifier_Access);
97
98 overriding procedure Use_Package_Clause
99 (Self : in out Visiter;
100 Node : not null Gela.Elements.Use_Package_Clauses.
101 Use_Package_Clause_Access);
102
103 overriding procedure With_Clause -- Use env.out instead
104 (Self : in out Visiter;
105 Node : not null Gela.Elements.With_Clauses.With_Clause_Access);
106 end Get;
107
108 package body Get is
109
110 overriding procedure Compilation_Unit_Body
111 (Self : in out Visiter;
112 Node : not null Gela.Elements.Compilation_Unit_Bodies.
113 Compilation_Unit_Body_Access)
114 is
115 List : constant Gela.Elements.Context_Items.
116 Context_Item_Sequence_Access := Node.Context_Clause_Elements;
117
118 Cursor : Gela.Elements.Element_Sequence_Cursor'Class := List.First;
119 begin
120 while Cursor.Has_Element loop
121 Cursor.Element.Visit (Self);
122 Cursor.Next;
123 end loop;
124 end Compilation_Unit_Body;
125
126 overriding procedure Compilation_Unit_Declaration
127 (Self : in out Visiter;
128 Node : not null Gela.Elements.Compilation_Unit_Declarations.
129 Compilation_Unit_Declaration_Access)
130 is
131 List : constant Gela.Elements.Context_Items.
132 Context_Item_Sequence_Access := Node.Context_Clause_Elements;
133
134 Cursor : Gela.Elements.Element_Sequence_Cursor'Class := List.First;
135 begin
136 while Cursor.Has_Element loop
137 Cursor.Element.Visit (Self);
138 Cursor.Next;
139 end loop;
140 end Compilation_Unit_Declaration;
141
142 overriding procedure Identifier
143 (Self : in out Visiter;
144 Node : not null Gela.Elements.Identifiers.Identifier_Access) is
145 begin
146 Self.Name := Node.Defining_Name;
147 end Identifier;
148
149 overriding procedure Package_Declaration
150 (Self : in out Visiter;
151 Node : not null Gela.Elements.Package_Declarations.
152 Package_Declaration_Access) is
153 begin
154 Node.Enclosing_Element.Visit (Self);
155 end Package_Declaration;
156
157 overriding procedure Procedure_Body
158 (Self : in out Visiter;
159 Node : not null Gela.Elements.Procedure_Bodies.
160 Procedure_Body_Access) is
161 begin
162 Node.Enclosing_Element.Visit (Self);
163 end Procedure_Body;
164
165 overriding procedure Selected_Identifier
166 (Self : in out Visiter;
167 Node : not null Gela.Elements.Selected_Identifiers.
168 Selected_Identifier_Access)
169 is
170 Selector : constant Gela.Elements.Selector_Names.
171 Selector_Name_Access := Node.Selector;
172 begin
173 Selector.Visit (Self);
174 end Selected_Identifier;
175
176 overriding procedure Use_Package_Clause
177 (Self : in out Visiter;
178 Node : not null Gela.Elements.Use_Package_Clauses.
179 Use_Package_Clause_Access)
180 is
181 Set : constant Gela.Environments.Environment_Set_Access :=
182 Comp.Context.Environment_Set;
183 List : constant Gela.Elements.Program_Unit_Names.
184 Program_Unit_Name_Sequence_Access := Node.Clause_Names;
185 Cursor : Gela.Elements.Element_Sequence_Cursor'Class := List.First;
186 begin
187 while Cursor.Has_Element loop
188 Cursor.Element.Visit (Self);
189
190 Env := Set.Add_Use_Package
191 (Index => Env,
192 Name => Self.Name);
193
194 Cursor.Next;
195 end loop;
196 end Use_Package_Clause;
197
198 overriding procedure With_Clause -- Use env.out instead
199 (Self : in out Visiter;
200 Node : not null Gela.Elements.With_Clauses.With_Clause_Access)
201 is
202 pragma Unreferenced (Self);
203 use type Gela.Lexical_Types.Symbol_List;
204
205 List : Gela.Lexical_Types.Symbol_List := Node.With_List;
206 Set : constant Gela.Environments.Environment_Set_Access :=
207 Comp.Context.Environment_Set;
208 begin
209 while List /= Gela.Lexical_Types.Empty_Symbol_List loop
210 Env := Set.Add_With_Clause
211 (Index => Env,
212 Symbol => Comp.Context.Symbols.Head (List));
213 List := Comp.Context.Symbols.Tail (List);
214 end loop;
215 end With_Clause;
216
217 end Get;
218
219 V : Get.Visiter;
220 begin
221 Decl.Visit (V);
222 end Add_Library_Level_Use_Clauses;
223
224 ----------------------------
225 -- Add_Name_Create_Region --
226 ----------------------------
227
228 function Add_Name_Create_Region
229 (Comp : Gela.Compilations.Compilation_Access;
230 Env : Gela.Semantic_Types.Env_Index;
231 Symbol : Gela.Lexical_Types.Symbol;
232 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
233 Decl : Gela.Elements.Element_Access)
234 return Gela.Semantic_Types.Env_Index
235 is
236 use type Gela.Semantic_Types.Env_Index;
237 use type Gela.Lexical_Types.Symbol;
238
239 Library_Level : constant Boolean :=
240 Env = Comp.Context.Environment_Set.Library_Level_Environment;
241
242 Env_0 : Gela.Semantic_Types.Env_Index;
243 Env_1 : Gela.Semantic_Types.Env_Index;
244 Env_2 : Gela.Semantic_Types.Env_Index;
245 begin
246 if Library_Level then
247 Env_0 := Parents_Declarative_Region (Comp, Symbol);
248
249 if Symbol = Gela.Lexical_Types.Predefined_Symbols.Standard then
250 Preprocess_Standard (Comp, Decl);
251 end if;
252
253 else
254 Env_0 := Env;
255 end if;
256
257 Env_1 := Comp.Context.Environment_Set.Add_Defining_Name
258 (Index => Env_0,
259 Symbol => Symbol,
260 Name => Name);
261
262 if Is_Enumeration (Decl) then
263 return Env_1;
264 end if;
265
266 Env_2 := Comp.Context.Environment_Set.Enter_Declarative_Region
267 (Index => Env_1,
268 Region => Name);
269
270 if Library_Level then
271 Add_Library_Level_Use_Clauses (Comp, Decl, Env_2);
272 end if;
273
274 return Env_2;
275 end Add_Name_Create_Region;
276
277 ---------------
278 -- Add_Names --
279 ---------------
280
281 function Add_Names
282 (Comp : Gela.Compilations.Compilation_Access;
283 Env : Gela.Semantic_Types.Env_Index;
284 List : Gela.Lexical_Types.Symbol_List;
285 Names : Gela.Elements.Defining_Identifiers
286 .Defining_Identifier_Sequence_Access)
287 return Gela.Semantic_Types.Env_Index
288 is
289 Tail : Gela.Lexical_Types.Symbol_List := List;
290 Env_1 : Gela.Semantic_Types.Env_Index := Env;
291 Symbol : Gela.Lexical_Types.Symbol;
292 Name : Gela.Elements.Defining_Identifiers.Defining_Identifier_Access;
293 Cursor : Gela.Elements.Defining_Identifiers
294 .Defining_Identifier_Sequence_Cursor := Names.First;
295 Set : constant Gela.Symbol_Sets.Symbol_Set_Access :=
296 Comp.Context.Symbols;
297 begin
298 while Cursor.Has_Element loop
299 Name := Cursor.Element;
300 Symbol := Set.Head (Tail);
301 Tail := Set.Tail (Tail);
302 Cursor.Next;
303
304 Env_1 := Comp.Context.Environment_Set.Add_Defining_Name
305 (Index => Env_1,
306 Symbol => Symbol,
307 Name => Gela.Elements.Defining_Names
308 .Defining_Name_Access (Name));
309 end loop;
310
311 return Env_1;
312 end Add_Names;
313
314 -----------------------------
315 -- Add_Names_Create_Region --
316 -----------------------------
317
318 function Add_Names_Create_Region
319 (Comp : Gela.Compilations.Compilation_Access;
320 Env : Gela.Semantic_Types.Env_Index;
321 List : Gela.Lexical_Types.Symbol_List;
322 Names : Gela.Elements.Defining_Identifiers
323 .Defining_Identifier_Sequence_Access)
324 return Gela.Semantic_Types.Env_Index
325 is
326 Env_1 : Gela.Semantic_Types.Env_Index;
327 Env_2 : Gela.Semantic_Types.Env_Index;
328 Name : Gela.Elements.Defining_Identifiers.Defining_Identifier_Access;
329 Cursor : constant Gela.Elements.Defining_Identifiers
330 .Defining_Identifier_Sequence_Cursor := Names.First;
331 begin
332 Name := Cursor.Element;
333 Env_1 := Add_Names (Comp, Env, List, Names);
334
335 Env_2 := Comp.Context.Environment_Set.Enter_Declarative_Region
336 (Index => Env_1,
337 Region => Gela.Elements.Defining_Names.Defining_Name_Access (Name));
338
339 return Env_2;
340 end Add_Names_Create_Region;
341
342 --------------------------------
343 -- Create_Function_Call_Value --
344 --------------------------------
345
346 function Create_Function_Call_Value
347 (Comp : Gela.Compilations.Compilation_Access;
348 Name : Gela.Semantic_Types.Value_Index;
349 Arguments : Gela.Semantic_Types.Value_Index)
350 return Gela.Semantic_Types.Value_Index
351 is
352 Result : Gela.Semantic_Types.Value_Index;
353 begin
354 Comp.Context.Values.Apply
355 (Name => Name,
356 Args => Arguments,
357 Value => Result);
358
359 return Result;
360 end Create_Function_Call_Value;
361
362 function Create_Numeric_Value
363 (Comp : Gela.Compilations.Compilation_Access;
364 Value : Gela.Lexical_Types.Token_Index)
365 return Gela.Semantic_Types.Value_Index
366 is
367 Token : constant Gela.Lexical_Types.Token := Comp.Get_Token (Value);
368 Source : constant League.Strings.Universal_String := Comp.Source;
369 Image : constant League.Strings.Universal_String :=
370 Source.Slice (Token.First, Token.Last);
371 Result : Gela.Semantic_Types.Value_Index;
372 begin
373 Comp.Context.Values.Numeric_Literal (Image, Result);
374
375 return Result;
376 end Create_Numeric_Value;
377
378 -------------------------
379 -- Create_String_Value --
380 -------------------------
381
382 function Create_String_Value
383 (Comp : Gela.Compilations.Compilation_Access;
384 Full_Name : Gela.Lexical_Types.Token_Index)
385 return Gela.Semantic_Types.Value_Index
386 is
387 Token : constant Gela.Lexical_Types.Token := Comp.Get_Token (Full_Name);
388 Source : constant League.Strings.Universal_String := Comp.Source;
389 Image : constant League.Strings.Universal_String :=
390 Source.Slice (Token.First, Token.Last);
391 Result : Gela.Semantic_Types.Value_Index;
392 begin
393 Comp.Context.Values.String_Literal
394 (Image.Slice (2, Image.Length - 1), Result);
395
396 return Result;
397 end Create_String_Value;
398
399 procedure End_Of_Compilation_Unit_Declaration
400 (Comp : Gela.Compilations.Compilation_Access;
401 Unit : Gela.Elements.Compilation_Unit_Declarations.
402 Compilation_Unit_Declaration_Access;
403 Symbol : Gela.Lexical_Types.Symbol;
404 Env : in out Gela.Semantic_Types.Env_Index)
405 is
406 use type Gela.Lexical_Types.Symbol;
407 begin
408 if Symbol = Gela.Lexical_Types.Predefined_Symbols.Standard then
409 Postprocess_Standard (Comp, Unit, Env);
410 end if;
411 end End_Of_Compilation_Unit_Declaration;
412
413 --------------------
414 -- Is_Enumeration --
415 --------------------
416
417 function Is_Enumeration
418 (Decl : Gela.Elements.Element_Access) return Boolean
419 is
420 package Get is
421
422 type Visiter is new Gela.Element_Visiters.Visiter with record
423 Result : Boolean := False;
424 end record;
425
426 overriding procedure Full_Type_Declaration
427 (Self : in out Visiter;
428 Node : not null Gela.Elements.Full_Type_Declarations.
429 Full_Type_Declaration_Access);
430
431 overriding procedure Enumeration_Type_Definition
432 (Self : in out Visiter;
433 Node : not null Gela.Elements.Enumeration_Type_Definitions.
434 Enumeration_Type_Definition_Access);
435
436 end Get;
437
438 package body Get is
439
440 overriding procedure Full_Type_Declaration
441 (Self : in out Visiter;
442 Node : not null Gela.Elements.Full_Type_Declarations.
443 Full_Type_Declaration_Access)
444 is
445 View : constant Gela.Elements.Type_Definitions.
446 Type_Definition_Access := Node.Type_Declaration_View;
447 begin
448 View.Visit (Self);
449 end Full_Type_Declaration;
450
451 overriding procedure Enumeration_Type_Definition
452 (Self : in out Visiter;
453 Node : not null Gela.Elements.Enumeration_Type_Definitions.
454 Enumeration_Type_Definition_Access)
455 is
456 pragma Unreferenced (Node);
457 begin
458 Self.Result := True;
459 end Enumeration_Type_Definition;
460
461 end Get;
462
463 use type Gela.Elements.Element_Access;
464 V : Get.Visiter;
465 begin
466 if Decl /= null then
467 Decl.Visit (V);
468 end if;
469
470 return V.Result;
471 end Is_Enumeration;
472
473 ------------------------------
474 -- Leave_Declarative_Region --
475 ------------------------------
476
477 function Leave_Declarative_Region
478 (Comp : Gela.Compilations.Compilation_Access;
479 Index : Gela.Semantic_Types.Env_Index;
480 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
481 return Gela.Semantic_Types.Env_Index is
482 begin
483 if Is_Enumeration (Name.Enclosing_Element) then
484 return Index;
485 else
486 return Comp.Context.Environment_Set.Leave_Declarative_Region (Index);
487 end if;
488 end Leave_Declarative_Region;
489
490 --------------------------------
491 -- Parents_Declarative_Region --
492 --------------------------------
493
494 function Parents_Declarative_Region
495 (Comp : Gela.Compilations.Compilation_Access;
496 Full_Name : Gela.Lexical_Types.Symbol)
497 return Gela.Semantic_Types.Env_Index
498 is
499 use type Gela.Lexical_Types.Symbol;
500
501 Set : constant Gela.Symbol_Sets.Symbol_Set_Access :=
502 Comp.Context.Symbols;
503 Parent : constant Gela.Lexical_Types.Symbol := Set.Parent (Full_Name);
504 Result : Gela.Semantic_Types.Env_Index;
505 begin
506 if Parent = Gela.Lexical_Types.No_Symbol then
507 return 0;
508 end if;
509
510 Result := Comp.Context.Environment_Set.Library_Unit_Environment (Parent);
511
512 return Result;
513 end Parents_Declarative_Region;
514
515 --------------------------
516 -- Postprocess_Standard --
517 --------------------------
518
519 procedure Postprocess_Standard
520 (Comp : Gela.Compilations.Compilation_Access;
521 Unit : Gela.Elements.Compilation_Unit_Declarations.
522 Compilation_Unit_Declaration_Access;
523 Env : in out Gela.Semantic_Types.Env_Index)
524 is
525 pragma Unreferenced (Unit);
526
527 function Create_Operator
528 (Operator_Symbol : Gela.Lexical_Types.Symbol;
529 Type_Symbol : Gela.Lexical_Types.Symbol)
530 return Gela.Elements.Function_Declarations.
531 Function_Declaration_Access;
532
533 function Create_Subtype
534 (Type_Symbol : Gela.Lexical_Types.Symbol)
535 return Gela.Elements.Subtype_Mark_Or_Access_Definitions.
536 Subtype_Mark_Or_Access_Definition_Access;
537
538 function Get_Type
539 (Type_Symbol : Gela.Lexical_Types.Symbol)
540 return Gela.Elements.Defining_Names.Defining_Name_Access;
541
542 Env_Set : constant Gela.Environments.Environment_Set_Access :=
543 Comp.Context.Environment_Set;
544
545 Factory : constant Gela.Element_Factories.Element_Factory_Access :=
546 Comp.Factory;
547
548 ---------------------
549 -- Create_Operator --
550 ---------------------
551
552 function Create_Operator
553 (Operator_Symbol : Gela.Lexical_Types.Symbol;
554 Type_Symbol : Gela.Lexical_Types.Symbol)
555 return Gela.Elements.Function_Declarations.
556 Function_Declaration_Access
557 is
558 FD : Gela.Elements.Function_Declarations.Function_Declaration_Access;
559
560 Oper : constant Gela.Elements.Defining_Operator_Symbols.
561 Defining_Operator_Symbol_Access :=
562 Factory.Defining_Operator_Symbol
563 (Operator_Symbol_Token => 0);
564
565 Name : Gela.Elements.Defining_Designators.Defining_Designator_Access;
566
567 Param : Gela.Elements.Parameter_Specifications.
568 Parameter_Specification_Access;
569
570 Params : constant Gela.Elements.Parameter_Specifications.
571 Parameter_Specification_Sequence_Access :=
572 Factory.Parameter_Specification_Sequence;
573
574 Mark : Gela.Elements.Subtype_Mark_Or_Access_Definitions.
575 Subtype_Mark_Or_Access_Definition_Access;
576 begin
577 Oper.Set_Full_Name (Operator_Symbol);
578
579 Name := Gela.Elements.Defining_Designators.Defining_Designator_Access
580 (Oper);
581
582 for J in 1 .. 2 loop
583 Mark := Create_Subtype (Type_Symbol);
584
585 Param := Factory.Parameter_Specification
586 (Names =>
587 Factory.Defining_Identifier_Sequence,
588 Colon_Token => 0,
589 Aliased_Token => 0,
590 In_Token => 0,
591 Out_Token => 0,
592 Not_Token => 0,
593 Null_Token => 0,
594 Object_Declaration_Subtype => Mark,
595 Assignment_Token => 0,
596 Initialization_Expression => null);
597 Params.Append (Param);
598 end loop;
599
600 Mark := Create_Subtype (Type_Symbol);
601
602 FD := Factory.Function_Declaration
603 (Not_Token => 0,
604 Overriding_Token => 0,
605 Function_Token => 0,
606 Names => Name,
607 Lp_Token => 0,
608 Parameter_Profile => Params,
609 Rp_Token => 0,
610 Return_Token => 0,
611 Return_Not_Token => 0,
612 Return_Null_Token => 0,
613 Result_Subtype => Mark,
614 Is_Token => 0,
615 Abstract_Token => 0,
616 Result_Expression => null,
617 Renames_Token => 0,
618 Renamed_Entity => null,
619 Separate_Token => 0,
620 Aspect_Specifications => Factory.Aspect_Specification_Sequence,
621 Semicolon_Token => 0);
622
623 Env := Env_Set.Add_Defining_Name
624 (Index => Env,
625 Symbol => Operator_Symbol,
626 Name => Gela.Elements.Defining_Names.Defining_Name_Access
627 (Name));
628
629 return FD;
630 end Create_Operator;
631
632 --------------------
633 -- Create_Subtype --
634 --------------------
635
636 function Create_Subtype
637 (Type_Symbol : Gela.Lexical_Types.Symbol)
638 return Gela.Elements.Subtype_Mark_Or_Access_Definitions.
639 Subtype_Mark_Or_Access_Definition_Access
640 is
641 Identifier : Gela.Elements.Identifiers.Identifier_Access;
642
643 Mark : Gela.Elements.Subtype_Mark_Or_Access_Definitions.
644 Subtype_Mark_Or_Access_Definition_Access;
645 begin
646 Identifier := Factory.Identifier (Identifier_Token => 0);
647 Identifier.Set_Full_Name (Type_Symbol);
648 Identifier.Set_Defining_Name (Get_Type (Type_Symbol));
649
650 Mark := Gela.Elements.Subtype_Mark_Or_Access_Definitions.
651 Subtype_Mark_Or_Access_Definition_Access (Identifier);
652
653 return Mark;
654 end Create_Subtype;
655
656 --------------
657 -- Get_Type --
658 --------------
659
660 function Get_Type
661 (Type_Symbol : Gela.Lexical_Types.Symbol)
662 return Gela.Elements.Defining_Names.Defining_Name_Access
663 is
664 Pos : constant Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class
665 := Env_Set.Direct_Visible (Env, Type_Symbol);
666 begin
667 if Pos.Has_Element then
668 return Pos.Element;
669 else
670 raise Constraint_Error;
671 end if;
672 end Get_Type;
673
674 FD : Gela.Elements.Function_Declarations.Function_Declaration_Access;
675 pragma Unreferenced (FD);
676 begin
677 FD := Create_Operator
678 (Operator_Symbol => Gela.Lexical_Types.Operators.Hyphen_Operator,
679 Type_Symbol => Gela.Lexical_Types.Predefined_Symbols.Integer);
680
681 FD := Create_Operator
682 (Operator_Symbol => Gela.Lexical_Types.Operators.Ampersand_Operator,
683 Type_Symbol => Gela.Lexical_Types.Predefined_Symbols.String);
684 end Postprocess_Standard;
685
686 -------------------------
687 -- Preprocess_Standard --
688 -------------------------
689
690 procedure Preprocess_Standard
691 (Comp : Gela.Compilations.Compilation_Access;
692 Unit : Gela.Elements.Element_Access) is
693 begin
694 Gela.Plain_Type_Managers.Type_Manager_Access
695 (Comp.Context.Types).Initialize (Unit);
696 end Preprocess_Standard;
697
698end Gela.Pass_Utils;
Note: See TracBrowser for help on using the repository browser.