source: trunk/ada-2012/src/semantic/gela-library_environments.ads@ 318

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

Move Ada 2012 code to trunk

File size: 3.3 KB
Line 
1-- This package provides Environment_Set for library level declarations.
2with Gela.Contexts;
3with Gela.Defining_Name_Cursors;
4with Gela.Elements.Defining_Names;
5with Gela.Environments;
6with Gela.Lexical_Types;
7with Gela.Semantic_Types;
8
9package Gela.Library_Environments is
10 pragma Preelaborate;
11
12 type Environment_Set (Context : access Gela.Contexts.Context'Class) is
13 new Gela.Environments.Environment_Set with private;
14 type Environment_Set_Access is access all Environment_Set'Class;
15 for Environment_Set_Access'Storage_Size use 0;
16
17 overriding function Direct_Visible
18 (Self : access Environment_Set;
19 Index : Gela.Semantic_Types.Env_Index;
20 Symbol : Gela.Lexical_Types.Symbol)
21 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class;
22
23 overriding function Visible
24 (Self : access Environment_Set;
25 Index : Gela.Semantic_Types.Env_Index;
26 Region : Gela.Elements.Defining_Names.Defining_Name_Access;
27 Symbol : Gela.Lexical_Types.Symbol;
28 Found : access Boolean)
29 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class;
30
31 Library_Env : constant Gela.Semantic_Types.Env_Index :=
32 Gela.Semantic_Types.Env_Index'Last;
33
34private
35
36 type Environment_Set (Context : access Gela.Contexts.Context'Class) is
37 new Gela.Environments.Environment_Set with null record;
38
39 overriding function Empty_Environment
40 (Self : Environment_Set)
41 return Gela.Semantic_Types.Env_Index;
42
43 overriding function Add_With_Clause
44 (Self : in out Environment_Set;
45 Index : Gela.Semantic_Types.Env_Index;
46 Symbol : Gela.Lexical_Types.Symbol)
47 return Gela.Semantic_Types.Env_Index;
48
49 overriding function Add_Defining_Name
50 (Self : in out Environment_Set;
51 Index : Gela.Semantic_Types.Env_Index;
52 Symbol : Gela.Lexical_Types.Symbol;
53 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
54 return Gela.Semantic_Types.Env_Index;
55
56 overriding function Add_Use_Package
57 (Self : in out Environment_Set;
58 Index : Gela.Semantic_Types.Env_Index;
59 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
60 return Gela.Semantic_Types.Env_Index;
61
62 overriding function Enter_Declarative_Region
63 (Self : access Environment_Set;
64 Index : Gela.Semantic_Types.Env_Index;
65 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
66 return Gela.Semantic_Types.Env_Index;
67
68 overriding function Leave_Declarative_Region
69 (Self : access Environment_Set;
70 Index : Gela.Semantic_Types.Env_Index)
71 return Gela.Semantic_Types.Env_Index;
72
73 overriding function Library_Level_Environment
74 (Self : Environment_Set)
75 return Gela.Semantic_Types.Env_Index;
76
77 overriding function Library_Unit_Environment
78 (Self : access Environment_Set;
79 Symbol : Gela.Lexical_Types.Symbol)
80 return Gela.Semantic_Types.Env_Index;
81
82 overriding procedure Set_Library_Unit_Environment
83 (Self : access Environment_Set;
84 Symbol : Gela.Lexical_Types.Symbol;
85 Value : Gela.Semantic_Types.Env_Index);
86
87 overriding function Use_Visible
88 (Self : access Environment_Set;
89 Index : Gela.Semantic_Types.Env_Index;
90 Symbol : Gela.Lexical_Types.Symbol)
91 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class;
92
93end Gela.Library_Environments;
Note: See TracBrowser for help on using the repository browser.