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

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

Keep package_renaming_declaration in Env

to be able expand selected names in Visible call.

  • Property svn:keywords set to Author Date Revision
File size: 4.4 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 Add_Rename_Package
63 (Self : in out Environment_Set;
64 Index : Gela.Semantic_Types.Env_Index;
65 Region : Gela.Elements.Defining_Names.Defining_Name_Access;
66 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
67 return Gela.Semantic_Types.Env_Index;
68
69 overriding function Add_Completion
70 (Self : in out Environment_Set;
71 Index : Gela.Semantic_Types.Env_Index;
72 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
73 Completion : Gela.Elements.Defining_Names.Defining_Name_Access)
74 return Gela.Semantic_Types.Env_Index;
75
76 overriding function Completions
77 (Self : in out Environment_Set;
78 Index : Gela.Semantic_Types.Env_Index;
79 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
80 return Gela.Environments.Completion_List;
81
82 overriding function Enter_Completion_Region
83 (Self : access Environment_Set;
84 Index : Gela.Semantic_Types.Env_Index;
85 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
86 return Gela.Semantic_Types.Env_Index;
87
88 overriding function Enter_Declarative_Region
89 (Self : access Environment_Set;
90 Index : Gela.Semantic_Types.Env_Index;
91 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
92 return Gela.Semantic_Types.Env_Index;
93
94 overriding function Leave_Declarative_Region
95 (Self : access Environment_Set;
96 Index : Gela.Semantic_Types.Env_Index)
97 return Gela.Semantic_Types.Env_Index;
98
99 overriding function Library_Level_Environment
100 (Self : Environment_Set)
101 return Gela.Semantic_Types.Env_Index;
102
103 overriding function Library_Unit_Environment
104 (Self : access Environment_Set;
105 Symbol : Gela.Lexical_Types.Symbol)
106 return Gela.Semantic_Types.Env_Index;
107
108 overriding procedure Set_Library_Unit_Environment
109 (Self : access Environment_Set;
110 Symbol : Gela.Lexical_Types.Symbol;
111 Value : Gela.Semantic_Types.Env_Index);
112
113 overriding function Use_Visible
114 (Self : access Environment_Set;
115 Index : Gela.Semantic_Types.Env_Index;
116 Symbol : Gela.Lexical_Types.Symbol)
117 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class;
118
119end Gela.Library_Environments;
Note: See TracBrowser for help on using the repository browser.