source: trunk/ada-2012/src/api/gela-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: 4.8 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
75 not overriding function Add_Defining_Name
76 (Self : in out Environment_Set;
77 Index : Gela.Semantic_Types.Env_Index;
78 Symbol : Gela.Lexical_Types.Symbol;
79 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
80 return Gela.Semantic_Types.Env_Index is abstract;
81 -- Create new environment by adding (Symbol, Name) to provided env with
82 -- given Index. Return index of created environment
83
84 not overriding function Add_Use_Package
85 (Self : in out Environment_Set;
86 Index : Gela.Semantic_Types.Env_Index;
87 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
88 return Gela.Semantic_Types.Env_Index is abstract;
89 -- Create new environment by adding use package <Name> to provided env
90 -- with given Index. Return index of created environment
91
92 not overriding function Enter_Declarative_Region
93 (Self : access Environment_Set;
94 Index : Gela.Semantic_Types.Env_Index;
95 Region : Gela.Elements.Defining_Names.Defining_Name_Access)
96 return Gela.Semantic_Types.Env_Index is abstract;
97 -- Create new environment by extending provided env with new empty
98 -- declarative region named by Region defining name.
99 -- Return index of created environment
100
101 not overriding function Leave_Declarative_Region
102 (Self : access Environment_Set;
103 Index : Gela.Semantic_Types.Env_Index)
104 return Gela.Semantic_Types.Env_Index is abstract;
105 -- Create new environment by closing top declarative region in provided env
106 -- Return index of created environment
107
108end Gela.Environments;
Note: See TracBrowser for help on using the repository browser.