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

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

Add chosen_interpretation to number_declaration

to distinguish integer and real numbers.

  • Property svn:keywords set to Author Date Revision
File size: 5.7 KB
Line 
1------------------------------------------------------------------------------
2-- G E L A A S I S --
3-- ASIS implementation for Gela project, a portable Ada compiler --
4-- a portable Ada compiler --
5-- http://gela.ada-ru.org/ --
6-- - - - - - - - - - - - - - - - --
7-- Read copyright and license in gela.ads file --
8------------------------------------------------------------------------------
9
10with Gela.Compilations;
11with Gela.Elements.Compilation_Unit_Declarations;
12with Gela.Elements.Defining_Names;
13with Gela.Elements.Defining_Identifiers;
14with Gela.Elements.Number_Declarations;
15with Gela.Elements.Use_Package_Clauses;
16with Gela.Lexical_Types;
17with Gela.Semantic_Types;
18with Gela.Resolve;
19with Gela.Inheritance;
20with Gela.Instantiation;
21with Gela.Interpretations;
22
23package Gela.Pass_Utils is
24 pragma Preelaborate;
25
26 package Resolve renames Gela.Resolve;
27 package Instantiation renames Gela.Instantiation;
28 package Inheritance renames Gela.Inheritance;
29
30 function Add_Name_Create_Region
31 (Comp : Gela.Compilations.Compilation_Access;
32 Env : Gela.Semantic_Types.Env_Index;
33 Symbol : Gela.Lexical_Types.Symbol;
34 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
35 Decl : Gela.Elements.Element_Access)
36 return Gela.Semantic_Types.Env_Index;
37 -- Add (Symbol, Name) to Env
38 -- Check if Name is part of enumeration type declaration
39 -- else create new declarative region
40
41 function Leave_Declarative_Region
42 (Comp : Gela.Compilations.Compilation_Access;
43 Index : Gela.Semantic_Types.Env_Index;
44 Name : Gela.Elements.Defining_Names.Defining_Name_Access)
45 return Gela.Semantic_Types.Env_Index;
46
47 function Create_Completion_Region
48 (Comp : Gela.Compilations.Compilation_Access;
49 Env : Gela.Semantic_Types.Env_Index;
50 Symbol : Gela.Lexical_Types.Symbol;
51 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
52 Decl : Gela.Elements.Element_Access)
53 return Gela.Semantic_Types.Env_Index;
54 -- If corresponding declaration is not found, call Add_Name_Create_Region
55
56 function Add_Names
57 (Comp : Gela.Compilations.Compilation_Access;
58 Env : Gela.Semantic_Types.Env_Index;
59 List : Gela.Lexical_Types.Symbol_List;
60 Names : Gela.Elements.Defining_Identifiers
61 .Defining_Identifier_Sequence_Access)
62 return Gela.Semantic_Types.Env_Index;
63 -- Add (Symbol, Name) from List and Names to Env
64
65 function Add_Use_Package
66 (Comp : Gela.Compilations.Compilation_Access;
67 Env : Gela.Semantic_Types.Env_Index;
68 Node : not null Gela.Elements.Use_Package_Clauses.
69 Use_Package_Clause_Access)
70 return Gela.Semantic_Types.Env_Index;
71 -- Add "use {Symbol};" to Env
72
73 function Add_Names_Create_Region
74 (Comp : Gela.Compilations.Compilation_Access;
75 Env : Gela.Semantic_Types.Env_Index;
76 List : Gela.Lexical_Types.Symbol_List;
77 Names : Gela.Elements.Defining_Identifiers
78 .Defining_Identifier_Sequence_Access)
79 return Gela.Semantic_Types.Env_Index;
80 -- Add (Symbol, Name) from List and Names to Env, then create new
81 -- declarative region
82
83 function Parents_Declarative_Region
84 (Comp : Gela.Compilations.Compilation_Access;
85 Full_Name : Gela.Lexical_Types.Symbol)
86 return Gela.Semantic_Types.Env_Index;
87 -- Return end of declarative region of unit's parent
88
89 function Create_String_Value
90 (Comp : Gela.Compilations.Compilation_Access;
91 Full_Name : Gela.Lexical_Types.Token_Index)
92 return Gela.Semantic_Types.Value_Index;
93 -- Return end of declarative region of unit's parent
94
95 function Create_Numeric_Value
96 (Comp : Gela.Compilations.Compilation_Access;
97 Value : Gela.Lexical_Types.Token_Index)
98 return Gela.Semantic_Types.Value_Index;
99 -- Return end of declarative region of unit's parent
100
101 function Create_Function_Call_Value
102 (Comp : Gela.Compilations.Compilation_Access;
103 Name : Gela.Semantic_Types.Value_Index;
104 Arguments : Gela.Semantic_Types.Value_Index)
105 return Gela.Semantic_Types.Value_Index;
106
107 procedure End_Of_Compilation_Unit_Declaration
108 (Comp : Gela.Compilations.Compilation_Access;
109 Unit : Gela.Elements.Compilation_Unit_Declarations.
110 Compilation_Unit_Declaration_Access;
111 Symbol : Gela.Lexical_Types.Symbol;
112 Env : Gela.Semantic_Types.Env_Index);
113
114 procedure Add_Implicit_Declarations
115 (Comp : Gela.Compilations.Compilation_Access;
116 Tipe : Gela.Elements.Element_Access;
117 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
118 Env : in out Gela.Semantic_Types.Env_Index);
119
120 procedure Choose_Auxiliary_Apply_Interpretation
121 (Comp : Gela.Compilations.Compilation_Access;
122 Down : Gela.Interpretations.Interpretation_Index;
123 Result : in out Gela.Interpretations.Unknown_Auxiliary_Apply_Kinds);
124 -- Maybe move it into separate unit???
125
126 procedure Choose_Composite_Constraint_Interpretation
127 (Comp : Gela.Compilations.Compilation_Access;
128 Node : access Gela.Elements.Element'Class;
129 Result : out Gela.Interpretations.Constraint_Kinds);
130
131 procedure Choose_Number_Declaration_Interpretation
132 (Comp : Gela.Compilations.Compilation_Access;
133 Node : access Gela.Elements.Number_Declarations.
134 Number_Declaration'Class;
135 Result : out Gela.Interpretations.Number_Declaration_Kinds);
136
137end Gela.Pass_Utils;
Note: See TracBrowser for help on using the repository browser.