1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
11 * Copyright (C) 1992-2001, Free Software Foundation, Inc. *
13 * GNAT is free software; you can redistribute it and/or modify it under *
14 * terms of the GNU General Public License as published by the Free Soft- *
15 * ware Foundation; either version 2, or (at your option) any later ver- *
16 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
17 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
19 * for more details. You should have received a copy of the GNU General *
20 * Public License distributed with GNAT; see file COPYING. If not, write *
21 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
22 * MA 02111-1307, USA. *
24 * GNAT was originally developed by the GNAT team at New York University. *
25 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
27 ****************************************************************************/
29 /* This is the C file that corresponds to the Ada package spec Types. It was
30 created manually from the files types.ads and types.adb.
32 This package contains host independent type definitions which are used
33 throughout the compiler modules. The comments in the C version are brief
34 reminders of the purpose of each declaration. For complete documentation,
35 see the Ada version of these definitions. */
39 /* Boolean type (cannot use enum, because of bit field restriction on some
41 typedef unsigned char Boolean
;
45 /* General Use Integer Types */
47 /* Signed 32/bit integer */
50 /* Signed 16 bit integer */
53 /* Non/negative Int values */
56 /* Positive Int values */
59 /* 8/bit unsigned integer */
62 /* 8/Bit Character and String Types: */
64 /* 8/bit character type */
67 /* Graphic characters, as defined in ARM */
68 typedef Char Graphic_Character
;
70 /* Line terminator characters (LF, VT, FF, CR) */
71 typedef Char Line_Terminator
;
73 /* Characters with the upper bit set */
74 typedef Char Upper_Half_Character
;
76 /* String type built on Char (note that zero is an OK index) */
79 /* Pointer to string of Chars */
80 typedef Char
*Str_Ptr
;
82 /* Types for the fat pointer used for strings and the template it
84 typedef struct {int Low_Bound
, High_Bound
; } String_Template
;
85 typedef struct {const char *Array
; String_Template
*Bounds
; }
86 __attribute ((aligned (sizeof (char *) * 2))) Fat_Pointer
;
88 /* Types for Node/Entity Kinds: */
90 /* The reason that these are defined here in the C version, rather than in the
91 corresponding packages is that the requirement for putting bodies of
92 inlined stuff IN the C header changes the dependencies. Both a-sinfo.h
93 and a-einfo.h now reference routines defined in tree.h.
95 Note: these types would more naturally be defined as unsigned char, but
96 once again, the annoying restriction on bit fields for some compilers
99 typedef unsigned int Node_Kind
;
100 typedef unsigned int Entity_Kind
;
102 /* Types used for Text Buffer Handling: */
104 /* Type used for subscripts in text buffer. */
105 typedef Int Text_Ptr
;
107 /* Text buffer used to hold source file or library information file. */
108 typedef Char
*Text_Buffer
;
110 /* Pointer to text buffer. */
111 typedef Char
*Text_Buffer_Ptr
;
113 /* Types used for Source Input Handling: */
115 /* Line number type, used for storing all line numbers. */
116 typedef Int Line_Number_Type
;
118 /* Column number type, used for storing all column numbers. */
119 typedef Int Column_Number_Type
;
121 /* Type used to store text of a source file. */
122 typedef Text_Buffer Source_Buffer
;
124 /* Pointer to source buffer. */
125 typedef Text_Buffer_Ptr Source_Buffer_Ptr
;
127 /* Type used for source location. */
128 typedef Text_Ptr Source_Ptr
;
130 /* Value used to indicate no source position set. */
131 #define No_Location -1
133 /* Used for Sloc in all nodes in the representation of package Standard. */
134 #define Standard_Location -2
136 /* Type used for union of all possible ID values covering all ranges */
137 typedef int Union_Id
;
139 /* Range definitions for Tree Data: */
141 #define List_Low_Bound -100000000
142 #define List_High_Bound 0
144 #define Node_Low_Bound 0
145 #define Node_High_Bound 99999999
147 #define Elist_Low_Bound 100000000
148 #define Elist_High_Bound 199999999
150 #define Elmt_Low_Bound 200000000
151 #define Elmt_High_Bound 299999999
153 #define Names_Low_Bound 300000000
154 #define Names_High_Bound 399999999
156 #define Strings_Low_Bound 400000000
157 #define Strings_High_Bound 499999999
159 #define Ureal_Low_Bound 500000000
160 #define Ureal_High_Bound 599999999
162 #define Uint_Low_Bound 600000000
163 #define Uint_Table_Start 2000000000
164 #define Uint_High_Bound 2099999999
166 #define Char_Code_Bias 2100000000
168 SUBTYPE (List_Range
, Int
, List_Low_Bound
, List_High_Bound
)
169 SUBTYPE (Node_Range
, Int
, Node_Low_Bound
, Node_High_Bound
)
170 SUBTYPE (Elist_Range
, Int
, Elist_Low_Bound
, Elist_High_Bound
)
171 SUBTYPE (Elmt_Range
, Int
, Elmt_Low_Bound
, Elmt_High_Bound
)
172 SUBTYPE (Names_Range
, Int
, Names_Low_Bound
, Names_High_Bound
)
173 SUBTYPE (Strings_Range
, Int
, Strings_Low_Bound
, Strings_High_Bound
)
174 SUBTYPE (Uint_Range
, Int
, Uint_Low_Bound
, Uint_High_Bound
)
175 SUBTYPE (Ureal_Range
, Int
, Ureal_Low_Bound
, Ureal_High_Bound
)
176 SUBTYPE (Char_Code_Range
, Int
, Char_Code_Bias
, (Char_Code_Bias
+ 65535))
178 /* Types for Names_Table Package: */
182 /* Name_Id value for no name present. */
183 #define No_Name Names_Low_Bound
185 /* Name_Id value for bad name. */
186 #define Error_Name (Names_Low_Bound + 1)
188 /* First subscript of names table. */
189 #define First_Name_Id (Names_Low_Bound + 2)
191 /* Types for Tree Package: */
193 /* Subscript of nodes table entry. */
196 /* Used in semantics for Node_Id value referencing an entity. */
197 typedef Node_Id Entity_Id
;
205 /* Subscript of first allocated node. */
206 #define First_Node_Id Empty
208 /* Subscript of entry in lists table. */
211 /* Indicates absence of a list. */
215 #define Error_List List_Low_Bound
217 /* Subscript of first allocated list header. */
218 #define First_List_Id Error_List
220 /* Element list Id, subscript value of entry in lists table. */
221 typedef Int Elist_Id
;
223 /* Used to indicate absence of an element list. */
224 #define No_Elist Elist_Low_Bound
226 /* Subscript of first allocated elist header */
227 #define First_Elist_Id (No_Elist + 1)
229 /* Element Id, subscript value of entry in elements table. */
232 /* Used to indicate absence of a list element. */
233 #define No_Elmt Elmt_Low_Bound
235 /* Subscript of first allocated element */
236 #define First_Elmt_Id (No_Elmt + 1)
238 /* Types for String_Table Package: */
240 /* Subscript of strings table entry. */
241 typedef Int String_Id
;
243 /* Used to indicate missing string Id. */
244 #define No_String Strings_Low_Bound
246 /* Subscript of first entry in strings table. */
247 #define First_String_Id (No_String + 1)
249 /* Types for Uint_Support Package: */
251 /* Type used for representation of universal integers. */
254 /* Used to indicate missing Uint value. */
255 #define No_Uint Uint_Low_Bound
257 /* Base value used to represent Uint values. */
260 /* Minimum and maximum integers directly representable as Uint values */
261 #define Min_Direct (-(Base - 1))
262 #define Max_Direct ((Base - 1) * (Base - 1))
264 #define Uint_Direct_Bias (Uint_Low_Bound + Base)
265 #define Uint_Direct_First (Uint_Direct_Bias + Min_Direct)
266 #define Uint_Direct_Last (Uint_Direct_Bias + Max_Direct)
268 /* Define range of direct biased values */
269 SUBTYPE (Uint_Direct
, Uint
, Uint_Direct_First
, Uint_Direct_Last
)
271 /* Constants in Uint format. */
272 #define Uint_0 (Uint_Direct_Bias + 0)
273 #define Uint_1 (Uint_Direct_Bias + 1)
274 #define Uint_2 (Uint_Direct_Bias + 2)
275 #define Uint_10 (Uint_Direct_Bias + 10)
276 #define Uint_16 (Uint_Direct_Bias + 16)
278 /* Types for Ureal_Support Package: */
280 /* Type used for representation of universal reals. */
283 /* Used to indicate missing Uint value. */
284 #define No_Ureal Ureal_Low_Bound
286 /* Subscript of first entry in Ureal table. */
287 #define Ureal_First_Entry (No_Ureal + 1)
289 /* Character Code Type: */
291 /* Character code value, intended to be 16 bits. */
292 typedef short Char_Code
;
294 /* Types Used for Library Management: */
297 typedef Int Unit_Number_Type
;
299 /* Unit number value for main unit. */
302 /* Type used for lines table. */
303 typedef Source_Ptr
*Lines_Table_Type
;
305 /* Type used for pointer to lines table. */
306 typedef Source_Ptr
*Lines_Table_Ptr
;
308 /* Length of time stamp value. */
309 #define Time_Stamp_Length 22
311 /* Type used to represent time stamp. */
312 typedef Char
*Time_Stamp_Type
;
314 /* Name_Id synonym used for file names. */
315 typedef Name_Id File_Name_Type
;
317 /* Constant used to indicate no file found. */
318 #define No_File No_Name
320 /* Name_Id synonym used for unit names. */
321 typedef Name_Id Unit_Name_Type
;
323 /* Definitions for mechanism type and values */
324 typedef Int Mechanism_Type
;
327 #define By_Reference (-2)
328 #define By_Descriptor (-3)
329 #define By_Descriptor_UBS (-4)
330 #define By_Descriptor_UBSB (-5)
331 #define By_Descriptor_UBA (-6)
332 #define By_Descriptor_S (-7)
333 #define By_Descriptor_SB (-8)
334 #define By_Descriptor_A (-9)
335 #define By_Descriptor_NCA (-10)