ocarina-me_real-real_tree-utils.ads 8.82 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--      O C A R I N A . M E _ R E A L . R E A L _ T R E E . U T I L S       --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
jhugues's avatar
jhugues committed
9
--       Copyright (C) 2009 Telecom ParisTech, 2010-2012 ESA & ISAE.        --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--                                                                          --
-- Ocarina  is free software;  you  can  redistribute  it and/or  modify    --
-- it under terms of the GNU General Public License as published by the     --
-- Free Software Foundation; either version 2, or (at your option) any      --
-- later version. Ocarina is distributed  in  the  hope  that it will be    --
-- useful, but WITHOUT ANY WARRANTY;  without even the implied warranty of  --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received  a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING.   --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA.                                       --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable to be   --
-- covered  by the  GNU  General  Public  License. This exception does not  --
-- however invalidate  any other reasons why the executable file might be   --
-- covered by the GNU Public License.                                       --
--                                                                          --
jhugues's avatar
jhugues committed
29
30
--                 Ocarina is maintained by the TASTE project               --
--                      (taste-users@lists.tuxfamily.org)                   --
31
32
33
34
35
36
37
38
39
40
--                                                                          --
------------------------------------------------------------------------------

--  Defines types for REAL

with Types;
with Ocarina.ME_REAL.Tokens;
with Ocarina.ME_REAL.REAL_Tree.Debug;

package Ocarina.ME_REAL.REAL_Tree.Utils is
41

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
   use Types;
   use Ocarina.ME_REAL.Tokens;

   --  Operators values

   OV_Invalid       : constant Operator_Id := 0;
   OV_Equal         : constant Operator_Id := 1;
   OV_Not           : constant Operator_Id := 2;
   OV_And           : constant Operator_Id := 3;
   OV_Or            : constant Operator_Id := 4;
   OV_Greater       : constant Operator_Id := 5;
   OV_Less_Equal    : constant Operator_Id := 6;
   OV_Greater_Equal : constant Operator_Id := 7;
   OV_Less          : constant Operator_Id := 8;
   OV_Minus         : constant Operator_Id := 9;
   OV_Plus          : constant Operator_Id := 10;
   OV_Star          : constant Operator_Id := 11;
   OV_Modulo        : constant Operator_Id := 12;
   OV_Slash         : constant Operator_Id := 13;
   OV_Different     : constant Operator_Id := 14;
   OV_Power         : constant Operator_Id := 15;
   OV_If_Then_Else  : constant Operator_Id := 16;
   OV_Affect        : constant Operator_Id := 17;

   --  Predfined sets values

   SV_No_Type                : constant := 0;
   SV_Generic                : constant := 1;
   SV_Processor_Set          : constant := 18;
   SV_Virtual_Processor_Set  : constant := 19;
   SV_Virtual_Bus_Set        : constant := 20;
   SV_Process_Set            : constant := 21;
   SV_Thread_Set             : constant := 22;
   SV_Threadgroup_Set        : constant := 23;
   SV_Subprogram_Call_Set    : constant := 24;
   SV_Sequence_Call_Set      : constant := 25;
   SV_Subprogram_Set         : constant := 26;
   SV_Data_Set               : constant := 27;
   SV_Memory_Set             : constant := 28;
   SV_Bus_Set                : constant := 29;
   SV_Connection_Set         : constant := 30;
   SV_Device_Set             : constant := 31;
   SV_System_Set             : constant := 32;
   SV_End_To_End_Flows_Set   : constant := 33;
   SV_Local_Set              : constant := 34;
87
   SV_Abstract_Set           : constant := 35;
88
   SV_Root_System_Set        : constant := 36;
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

   --  Selection functions codes

   FC_Is_Subcomponent_Of     : constant := 1;
   FC_Is_Bound_To            : constant := 2;
   FC_Is_Connected_To        : constant := 3;
   FC_Is_Called_By           : constant := 5;
   FC_Is_Accessed_By         : constant := 6;
   FC_Is_Connecting_To       : constant := 7;
   FC_Is_Passing_Through     : constant := 8;
   FC_Is_Calling             : constant := 9;
   FC_Is_Provided_Class      : constant := 10;
   FC_Is_Predecessor_Of      : constant := 11;
   FC_Is_Accessing_To        : constant := 12;

   FC_Get_Property_Value        : constant := 20;
   FC_Get_System_Property_Value : constant := 21;
   FC_Cardinal                  : constant := 22;
   FC_First                     : constant := 23;
   FC_Last                      : constant := 24;
   FC_Property_Exists           : constant := 25;
   FC_Expr                      : constant := 26;
   FC_Int                       : constant := 27;
   FC_Float                     : constant := 28;
   FC_List                      : constant := 29;
   FC_Max                       : constant := 30;
   FC_Min                       : constant := 31;
   FC_Is_In                     : constant := 32;
   FC_LCM                       : constant := 33;
   FC_GCD                       : constant := 34;
   FC_Non_Null                  : constant := 35;
   FC_Head                      : constant := 36;
   FC_Queue                     : constant := 37;
   FC_Size                      : constant := 38;
   FC_All_Equals                : constant := 39;
   FC_Product                   : constant := 40;
   FC_Sum                       : constant := 41;
126
127
128
129
130
131
132
133
134
   FC_Cos                       : constant := 42;
   FC_Sin                       : constant := 43;
   FC_Tan                       : constant := 44;
   FC_Cosh                      : constant := 45;
   FC_Sinh                      : constant := 46;
   FC_Tanh                      : constant := 47;
   FC_Ln                        : constant := 48;
   FC_Exp                       : constant := 49;
   FC_Sqrt                      : constant := 50;
135
136
   FC_Ceil                      : constant := 51;
   FC_Floor                     : constant := 52;
137
138
139
140
141
142
143
144

   FC_MMax                      : constant := 60;
   FC_MMin                      : constant := 61;
   FC_MAll_Equals               : constant := 62;
   FC_MProduct                  : constant := 63;
   FC_MSum                      : constant := 64;

   FC_Unknown                   : constant := 65;
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

   --  return types

   RT_Boolean                : constant := 1;
   RT_Integer                : constant := 2;
   RT_Float                  : constant := 3;
   RT_String                 : constant := 4;
   RT_Float_List             : constant := 5;
   RT_Int_List               : constant := 6;
   RT_String_List            : constant := 7;
   RT_Bool_List              : constant := 8;
   RT_Range                  : constant := 9;
   RT_Range_List             : constant := 10;
   RT_Element                : constant := 11;
   RT_Element_List           : constant := 12;
   RT_Error                  : constant := 13;
   RT_Unknown                : constant := 14;

   subtype Operator_Values is Operator_Id
     range OV_Equal .. OV_Star;

   subtype Predefined_Set_Values is Byte
     range SV_Processor_Set .. SV_Local_Set;

   subtype Return_Type is Value_Id
     range RT_Boolean .. RT_Unknown;

   function To_Lower (Str : Name_Id) return Name_Id;

   procedure Capitalize (S : in out String);

   function Quoted (S : String; D : Character := '"') return String;
   function Quoted (S : String; D : Character := '"') return Name_Id;
   function Quoted (N : Name_Id; D : Character := '"') return String;
   function Quoted (N : Name_Id; D : Character := '"') return Name_Id;
   --  Embrace string S or name N with character D

   function Image (Node : Node_Id) return String
     renames Ocarina.ME_REAL.REAL_Tree.Debug.Image;

   function Remove_Prefix (N : Name_Id) return Name_Id;
   --  returns the token after the last "::" separator

   function Translate_Predefined_Sets (T : Token_Type) return Value_Id;

   function Translate_Predefined_Sets (T : Value_Id) return Token_Type;

   function Translate_Function_Code (T : Token_Type) return Value_Id;

   function Get_Returned_Type (T : Value_Id) return Return_Type;

end Ocarina.ME_REAL.REAL_Tree.Utils;