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

Last change on this file since 398 was 398, checked in by Maxim Reznik, 5 years ago

Create completion region for package_body

File size: 3.5 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_Completion_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 Enter_Declarative_Region
69 (Self : access Environment_Set;
70 Index : Gela.Semantic_Types.Env_Index;
71 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
72 return Gela.Semantic_Types.Env_Index;
73
74 overriding function Leave_Declarative_Region
75 (Self : access Environment_Set;
76 Index : Gela.Semantic_Types.Env_Index)
77 return Gela.Semantic_Types.Env_Index;
78
79 overriding function Library_Level_Environment
80 (Self : Environment_Set)
81 return Gela.Semantic_Types.Env_Index;
82
83 overriding function Library_Unit_Environment
84 (Self : access Environment_Set;
85 Symbol : Gela.Lexical_Types.Symbol)
86 return Gela.Semantic_Types.Env_Index;
87
88 overriding procedure Set_Library_Unit_Environment
89 (Self : access Environment_Set;
90 Symbol : Gela.Lexical_Types.Symbol;
91 Value : Gela.Semantic_Types.Env_Index);
92
93 overriding function Use_Visible
94 (Self : access Environment_Set;
95 Index : Gela.Semantic_Types.Env_Index;
96 Symbol : Gela.Lexical_Types.Symbol)
97 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class;
98
99end Gela.Library_Environments;
Note: See TracBrowser for help on using the repository browser.