source: trunk/ada-2012/src/api/gela-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: 5.2 KB
Line 
1-- This package provides Environment_Set interface and its methods.
2with Gela.Defining_Name_Cursors;
3with Gela.Elements.Defining_Names;
4with Gela.Lexical_Types;
5with Gela.Semantic_Types;
6
7package Gela.Environments is
8 pragma Preelaborate;
9
10 type Environment_Set is limited interface;
11 type Environment_Set_Access is access all Environment_Set'Class;
12 for Environment_Set_Access'Storage_Size use 0;
13
14 not overriding function Library_Level_Environment
15 (Self : Environment_Set)
16 return Gela.Semantic_Types.Env_Index is abstract;
17 -- Return environment that incudes only library level names.
18
19 not overriding function Empty_Environment
20 (Self : Environment_Set)
21 return Gela.Semantic_Types.Env_Index is abstract;
22 -- Return environment that incudes no names nor use/with clauses at all.
23
24 not overriding function Add_With_Clause
25 (Self : in out Environment_Set;
26 Index : Gela.Semantic_Types.Env_Index;
27 Symbol : Gela.Lexical_Types.Symbol)
28 return Gela.Semantic_Types.Env_Index is abstract;
29 -- Create new environment by adding with clause for given Symbol
30 -- to provided env with given Index. Return index of created environment
31
32 not overriding function Library_Unit_Environment
33 (Self : access Environment_Set;
34 Symbol : Gela.Lexical_Types.Symbol)
35 return Gela.Semantic_Types.Env_Index is abstract;
36 -- Return environment index corresponding to unit of given Symbol
37 -- This environment points to region of corresponding declaration and
38 -- includes all child units at the end of region.
39
40 not overriding procedure Set_Library_Unit_Environment
41 (Self : access Environment_Set;
42 Symbol : Gela.Lexical_Types.Symbol;
43 Value : Gela.Semantic_Types.Env_Index) is abstract;
44 -- Save environment index as corresponding to unit of given Symbol
45 -- After Value set as library unit environment for given Symbol
46 -- any call to Add_Defining_Name will update mapping for the Symbol.
47
48 not overriding function Direct_Visible
49 (Self : access Environment_Set;
50 Index : Gela.Semantic_Types.Env_Index;
51 Symbol : Gela.Lexical_Types.Symbol)
52 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class is abstract;
53 -- Return list of direct visible defining names from the environment
54 -- pointed by Index with given Symbol.
55
56 not overriding function Use_Visible
57 (Self : access Environment_Set;
58 Index : Gela.Semantic_Types.Env_Index;
59 Symbol : Gela.Lexical_Types.Symbol)
60 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class is abstract;
61 -- Return list of use visible defining names from the environment
62 -- pointed by Index with given Symbol.
63
64 not overriding function Visible
65 (Self : access Environment_Set;
66 Index : Gela.Semantic_Types.Env_Index;
67 Region : Gela.Elements.Defining_Names.Defining_Name_Access;
68 Symbol : Gela.Lexical_Types.Symbol;
69 Found : access Boolean)
70 return Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class is abstract;
71 -- Return list of defining names from the environment pointed by Index
72 -- with given Symbol which visible inside declarative region corresponding
73 -- to given Region name. Return Found = False if no such region found.
74 -- If Region is null, use current (top) region to search in.
75
76 not overriding function Add_Defining_Name
77 (Self : in out Environment_Set;
78 Index : Gela.Semantic_Types.Env_Index;
79 Symbol : Gela.Lexical_Types.Symbol;
80 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
81 return Gela.Semantic_Types.Env_Index is abstract;
82 -- Create new environment by adding (Symbol, Name) to provided env with
83 -- given Index. Return index of created environment
84
85 not overriding function Add_Use_Package
86 (Self : in out Environment_Set;
87 Index : Gela.Semantic_Types.Env_Index;
88 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
89 return Gela.Semantic_Types.Env_Index is abstract;
90 -- Create new environment by adding use package <Name> to provided env
91 -- with given Index. Return index of created environment
92
93 not overriding function Enter_Declarative_Region
94 (Self : access Environment_Set;
95 Index : Gela.Semantic_Types.Env_Index;
96 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
97 return Gela.Semantic_Types.Env_Index is abstract;
98 -- Create new environment by extending provided env with new empty
99 -- declarative region named by Region defining name.
100 -- Return index of created environment
101
102 not overriding function Enter_Completion_Region
103 (Self : access Environment_Set;
104 Index : Gela.Semantic_Types.Env_Index;
105 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
106 return Gela.Semantic_Types.Env_Index is abstract;
107 -- Create new environment by extending provided env with completion of
108 -- declarative region named by Region defining name.
109 -- Return index of created environment
110
111 not overriding function Leave_Declarative_Region
112 (Self : access Environment_Set;
113 Index : Gela.Semantic_Types.Env_Index)
114 return Gela.Semantic_Types.Env_Index is abstract;
115 -- Create new environment by closing top declarative region in provided env
116 -- Return index of created environment
117
118end Gela.Environments;
Note: See TracBrowser for help on using the repository browser.