1
------------------------------------------------------------------------------
3
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
5
-- A S I S . E X T E N S I O N S . F L A T _ K I N D S --
9
-- Copyright (c) 1995-1999, Free Software Foundation, Inc. --
11
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
12
-- under terms of the GNU General Public License as published by the Free --
13
-- Software Foundation; either version 2, or (at your option) any later --
14
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
15
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
16
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
17
-- Public License for more details. You should have received a copy of the --
18
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
19
-- COPYING. If not, write to the Free Software Foundation, 59 Temple Place --
20
-- - Suite 330, Boston, MA 02111-1307, USA. --
22
-- As a special exception, if other files instantiate generics from this --
23
-- unit, or you link this unit with other files to produce an executable, --
24
-- this unit does not by itself cause the resulting executable to be --
25
-- covered by the GNU General Public License. This exception does not --
26
-- however invalidate any other reasons why the executable file might be --
27
-- covered by the GNU Public License. --
29
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
30
-- Software Engineering Laboratory of the Swiss Federal Institute of --
31
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
32
-- Scientific Research Computer Center of Moscow State University (SRCC --
33
-- MSU), Russia, with funding partially provided by grants from the Swiss --
34
-- National Science Foundation and the Swiss Academy of Engineering --
35
-- Sciences. ASIS-for-GNAT is now maintained by Ada Core Technologies Inc --
36
-- (http://www.gnat.com). --
38
------------------------------------------------------------------------------
40
-- This package provides the "flat" Element classification as a part of ASIS
41
-- extensions provided by ASIS-for-GNAT. This classification is equivalent
42
-- to the element classification hierarchy defined in the Asis package.
46
package Asis.Extensions.Flat_Kinds is
48
type Flat_Element_Kinds is new A4G.Int_Knds.Internal_Element_Kinds
49
range Not_An_Element .. An_Exception_Handler;
50
-- This type provides the flat Element classification for using in ASIS
51
-- applications. The main reasons to define it as a type derived from
52
-- the type providing similar flat classification for implementation
53
-- purposes are to hide the implementation-specific values added to
54
-- the internal flat classification (they are of no use for applications)
55
-- and to simplify the possible maintenance problems by having only one
56
-- set of enumeration literals representing the flat Element
57
-- classification. The set of enumeration literals inherited by the
58
-- Flat_Element_Kinds type is given below as a "commented" copy of
59
-- a part of the declaration of the A4G.Int_Knds.Internal_Element_Kinds
62
-- The way how the flat classification is obtained from the hierarchy is
63
-- strightforward: all the enumeration values of the ASIS Element_Kinds
64
-- type, which represent kinds having subordinate subkinds are recursively
65
-- replaced with the enumeration values of the subordinate kinds
66
-- (excluding Not_A_... starting values). A very few exceptions corresponds
67
-- to the situation where in the ASIS-defined Element classification we
68
-- have not hierarchy, but some kind of a net (for example, there is a
69
-- classification of access types applied bot to ordinary type definitions
70
-- and to formal type definitions. For such cases, the flat classification
71
-- introduces new (self-descriptive) names.
73
-- In the definition of Internal_Element_Kinds we keep most of the
74
-- documentation from the Element classification hierarchy as it is defined
75
-- in the Asis package, slightly reformatted to staicfy the GNAT coding
78
-- Below is the commented copy of a part of the definition of the
79
-- Internal_Element_Kinds type.
81
----------------------------------------------------------
82
-- Element_Kinds Hierarchy, as defined by Asis package: --
83
----------------------------------------------------------
85
-- Element_Kinds -> Subordinate Kinds
86
---------------------------------------------------------------------
88
-- Key: Read "->" as "can be further categorized by its"
90
-- A_Pragma -> Pragma_Kinds
92
-- A_Defining_Name -> Defining_Name_Kinds
95
-- A_Declaration -> Declaration_Kinds
97
-- -> Declaration_Origin
101
-- A_Definition -> Definition_Kinds
105
-- -> Formal_Type_Kinds
107
-- -> Access_Type_Kinds
108
-- -> Root_Type_Kinds
109
-- -> Constraint_Kinds
110
-- -> Discrete_Range_Kinds
112
-- An_Expression -> Expression_Kinds
114
-- -> Attribute_Kinds
116
-- An_Association -> Association_Kinds
118
-- A_Statement -> Statement_Kinds
120
-- A_Path -> Path_Kinds
122
-- A_Clause -> Clause_Kinds
123
-- -> Representation_Clause_Kinds
125
-- An_Exception_Handler
127
-------------------------------------------------------------------------
129
-- type Internal_Element_Kinds is
131
-- (Not_An_Element, -- Nil_Element
133
-- All the other Not_A_XXX values for subordinate kinds are not included
134
-- in the flat element classification - they just are not needed.
136
-------------------------------------------------------------
138
-- A_Pragma, -- Asis.Elements
140
-- Detailed classification for Asis.Element_Kinds (A_Pragma) literal,
141
-- corresponds to subtype Internal_Pragma_Kinds
142
------------------------------------------------------------
145
-- An_All_Calls_Remote_Pragma, -- E.2.3(4)
146
-- An_Asynchronous_Pragma, -- E.4.1(2)
147
-- An_Atomic_Pragma, -- C.6(2)
148
-- An_Atomic_Components_Pragma, -- C.6(2)
149
-- An_Attach_Handler_Pragma, -- C.3.1(3)
150
-- A_Controlled_Pragma, -- 13.11.3(2)
151
-- A_Convention_Pragma, -- B.1(4)
152
-- A_Discard_Names_Pragma, -- C.5(2),
153
-- An_Elaborate_Pragma, -- 10.2.1(19),
154
-- An_Elaborate_All_Pragma, -- 10.2.1(19)
155
-- An_Elaborate_Body_Pragma, -- 10.2.1(19)
156
-- An_Export_Pragma, -- B.1(4)
157
-- An_Import_Pragma, -- B.1(4)
158
-- An_Inline_Pragma, -- 6.3.2(2)
159
-- An_Inspection_Point_Pragma, -- H.3.2(2)
160
-- An_Interrupt_Handler_Pragma, -- C.3.1(1)
161
-- An_Interrupt_Priority_Pragma, -- D.1(4)
162
-- A_Linker_Options_Pragma, -- B.1(4),
163
-- A_List_Pragma, -- 2.8(20)
164
-- A_Locking_Policy_Pragma, -- D.3(2)
165
-- A_Normalize_Scalars_Pragma, -- H.1(2)
166
-- An_Optimize_Pragma, -- 2.8(20)
167
-- A_Pack_Pragma, -- 13.2(2)
168
-- A_Page_Pragma, -- 2.8(20)
169
-- A_Preelaborate_Pragma, -- 10.2.1(2)
170
-- A_Priority_Pragma, -- D.1(2)
171
-- A_Pure_Pragma, -- 10.2.1(13)
172
-- A_Queuing_Policy_Pragma, -- D.4(2)
173
-- A_Remote_Call_Interface_Pragma, -- E.2.3(2)
174
-- A_Remote_Types_Pragma, -- E.2.2(2)
175
-- A_Restrictions_Pragma, -- 13.12(2)
176
-- A_Reviewable_Pragma, -- H.3.1(2)
177
-- A_Shared_Passive_Pragma, -- E.2.1(2)
178
-- A_Storage_Size_Pragma, -- 13.3(62),
179
-- A_Suppress_Pragma, -- 11.5(3)
180
-- A_Task_Dispatching_Policy_Pragma, -- D.2.2(2)
181
-- A_Volatile_Pragma, -- C.6(2)
182
-- A_Volatile_Components_Pragma, -- C.6(2)
184
-- An_Implementation_Defined_Pragma, -- Vendor Appendix M
186
-- An_Unknown_Pragma, -- Unknown to the compiler.
188
------------------------------------------------------------
190
-- A_Defining_Name, -- Asis.Declarations
192
-- Detailed classification for Asis.Element_Kinds (A_Defining_Name)
193
-- literal, corresponds to subtype Internal_Defining_Name_Kinds
194
------------------------------------------------------------
196
-- A_Defining_Identifier, -- 3.1
197
-- A_Defining_Character_Literal, -- 3.5.1
198
-- A_Defining_Enumeration_Literal, -- 3.5.1
200
-- A_Defining_Operator_Symbol
202
-- Detailed classification for
203
-- Asis.Operator_Kinds (A_Defining_Operator_Symbol) literal,
204
-- corresponds to subtype Internal_Defining_Operator_Kinds
206
-- A_Defining_And_Operator, -- and
207
-- A_Defining_Or_Operator, -- or
208
-- A_Defining_Xor_Operator, -- xor
209
-- A_Defining_Equal_Operator, -- =
210
-- A_Defining_Not_Equal_Operator, -- /=
211
-- A_Defining_Less_Than_Operator, -- <
212
-- A_Defining_Less_Than_Or_Equal_Operator, -- <=
213
-- A_Defining_Greater_Than_Operator, -- >
214
-- A_Defining_Greater_Than_Or_Equal_Operator, -- >=
215
-- A_Defining_Plus_Operator, -- +
216
-- A_Defining_Minus_Operator, -- -
217
-- A_Defining_Concatenate_Operator, -- &
218
-- A_Defining_Unary_Plus_Operator, -- +
219
-- A_Defining_Unary_Minus_Operator, -- -
220
-- A_Defining_Multiply_Operator, -- *
221
-- A_Defining_Divide_Operator, -- /
222
-- A_Defining_Mod_Operator, -- mod
223
-- A_Defining_Rem_Operator, -- rem
224
-- A_Defining_Exponentiate_Operator, -- **
225
-- A_Defining_Abs_Operator, -- abs
226
-- A_Defining_Not_Operator, -- not
228
-- A_Defining_Expanded_Name,
229
-- 6.1 program_unit_name.defining_identifier
231
------------------------------------------------------------
233
-- A_Declaration, -- Asis.Declarations
235
-- Detailed classification for
236
-- Asis.Element_Kinds (A_Declaration) literal
237
-- corresponds to subtype Internal_Declaration_Kinds
238
------------------------------------------------------------
240
-- An_Ordinary_Type_Declaration, -- 3.2.1
241
-- A_Task_Type_Declaration, -- 3.2.1
242
-- A_Protected_Type_Declaration, -- 3.2.1
243
-- An_Incomplete_Type_Declaration, -- 3.2.1
244
-- A_Private_Type_Declaration, -- 3.2.1
245
-- A_Private_Extension_Declaration, -- 3.2.1
247
-- A_Subtype_Declaration, -- 3.2.2
249
-- A_Variable_Declaration, -- 3.3.1 -> Trait_Kinds
250
-- A_Constant_Declaration, -- 3.3.1 -> Trait_Kinds
251
-- A_Deferred_Constant_Declaration, -- 3.3.1 -> Trait_Kinds
252
-- A_Single_Task_Declaration, -- 3.3.1
253
-- A_Single_Protected_Declaration, -- 3.3.1
255
-- An_Integer_Number_Declaration, -- 3.3.2
256
-- A_Real_Number_Declaration, -- 3.3.2
258
-- An_Enumeration_Literal_Specification, -- 3.5.1
260
-- A_Discriminant_Specification, -- 3.7 -> Trait_Kinds
262
-- A_Component_Declaration, -- 3.8
264
-- A_Loop_Parameter_Specification, -- 5.5 -> Trait_Kinds
266
-- A_Procedure_Declaration, -- 6.1 -> Trait_Kinds
267
-- A_Function_Declaration, -- 6.1 -> Trait_Kinds
269
-- A_Parameter_Specification, -- 6.1 -> Trait_Kinds
272
-- A_Procedure_Body_Declaration, -- 6.3
273
-- A_Function_Body_Declaration, -- 6.3
275
-- A_Package_Declaration, -- 7.1
276
-- A_Package_Body_Declaration, -- 7.2
278
-- An_Object_Renaming_Declaration, -- 8.5.1
279
-- An_Exception_Renaming_Declaration, -- 8.5.2
280
-- A_Package_Renaming_Declaration, -- 8.5.3
281
-- A_Procedure_Renaming_Declaration, -- 8.5.4
282
-- A_Function_Renaming_Declaration, -- 8.5.4
283
-- A_Generic_Package_Renaming_Declaration, -- 8.5.5
284
-- A_Generic_Procedure_Renaming_Declaration, -- 8.5.5
285
-- A_Generic_Function_Renaming_Declaration, -- 8.5.5
287
-- A_Task_Body_Declaration, -- 9.1
288
-- A_Protected_Body_Declaration, -- 9.4
290
-- An_Entry_Declaration, -- 9.5.2
291
-- An_Entry_Body_Declaration, -- 9.5.2
292
-- An_Entry_Index_Specification, -- 9.5.2
294
-- A_Procedure_Body_Stub, -- 10.1.3
295
-- A_Function_Body_Stub, -- 10.1.3
296
-- A_Package_Body_Stub, -- 10.1.3
297
-- A_Task_Body_Stub, -- 10.1.3
298
-- A_Protected_Body_Stub, -- 10.1.3
300
-- An_Exception_Declaration, -- 11.1
301
-- A_Choice_Parameter_Specification, -- 11.2
303
-- A_Generic_Procedure_Declaration, -- 12.1
304
-- A_Generic_Function_Declaration, -- 12.1
305
-- A_Generic_Package_Declaration, -- 12.1
307
-- A_Package_Instantiation, -- 12.3
308
-- A_Procedure_Instantiation, -- 12.3
309
-- A_Function_Instantiation, -- 12.3
311
-- A_Formal_Object_Declaration, -- 12.4 -> Mode_Kinds
312
-- A_Formal_Type_Declaration, -- 12.5
313
-- A_Formal_Procedure_Declaration, -- 12.6 -> Default_Kinds
314
-- A_Formal_Function_Declaration, -- 12.6 -> Default_Kinds
315
-- A_Formal_Package_Declaration, -- 12.7
316
-- A_Formal_Package_Declaration_With_Box, -- 12.7
318
------------------------------------------------------------
320
-- A_Definition, -- Asis.Definitions
322
-- Detailed classification for Asis.Element_Kinds (A_Definition)
323
-- literal, corresponds to subtype Internal_Definition_Kinds
324
------------------------------------------------------------
326
-- A_Type_Definition, -- 3.2.1 -> Type_Kinds
328
-- Detailed classification for Asis.Definition_Kinds (A_Type_Definition)
329
-- literal, corresponds to subtype Internal_Type_Kinds
331
-- A_Derived_Type_Definition, -- 3.4 -> Trait_Kinds
332
-- A_Derived_Record_Extension_Definition, -- 3.4 -> Trait_Kinds
334
-- An_Enumeration_Type_Definition, -- 3.5.1
336
-- A_Signed_Integer_Type_Definition, -- 3.5.4
337
-- A_Modular_Type_Definition, -- 3.5.4
339
-- A_Root_Type_Definition, -- 3.5.4(10), 3.5.6(4)
340
-- -> Root_Type_Kinds
341
-- Detailed classification for Asis.Type_Kinds (A_Root_Type_Definition)
342
-- literal, corresponds to subtype Internal_Root_Type_Kinds
344
-- A_Root_Integer_Definition, -- 3.5.4(9)
345
-- A_Root_Real_Definition, -- 3.5.6(2)
347
-- A_Universal_Integer_Definition, -- 3.5.4(10)
348
-- A_Universal_Real_Definition, -- 3.5.6(4)
349
-- A_Universal_Fixed_Definition, -- 3.5.6(4)
352
-- A_Floating_Point_Definition, -- 3.5.7
354
-- An_Ordinary_Fixed_Point_Definition, -- 3.5.9
355
-- A_Decimal_Fixed_Point_Definition, -- 3.5.9
357
-- An_Unconstrained_Array_Definition, -- 3.6
358
-- A_Constrained_Array_Definition, -- 3.6
360
-- A_Record_Type_Definition, -- 3.8 -> Trait_Kinds
361
-- A_Tagged_Record_Type_Definition, -- 3.8 -> Trait_Kinds
363
-- An_Access_Type_Definition, -- 3.10 -> Access_Type_Kinds
365
-- Detailed classification for
366
-- Asis.Type_Kinds (An_Access_Type_Definition) literal,
367
-- corresponds to subtype Internal_Access_Type_Kinds
369
-- A_Pool_Specific_Access_To_Variable, -- access subtype_indication
370
-- An_Access_To_Variable, -- access all subtype_indication
371
-- An_Access_To_Constant, -- access constant subtype_indication
373
-- An_Access_To_Procedure, -- access procedure
374
-- An_Access_To_Protected_Procedure, -- access protected procedure
375
-- An_Access_To_Function, -- access function
376
-- An_Access_To_Protected_Function, -- access protected function
378
-- A_Subtype_Indication, -- 3.2.2
380
-- A_Constraint, -- 3.2.2 -> Constraint_Kinds
382
-- Detailed classification for Asis.Definition_Kinds (A_Constraint)
383
-- literal, corresponds to subtype Internal_Constraint_Kinds
385
-- A_Range_Attribute_Reference, -- 3.2.2, 3.5
386
-- A_Simple_Expression_Range, -- 3.2.2, 3.5
387
-- A_Digits_Constraint, -- 3.2.2, 3.5.9
388
-- A_Delta_Constraint, -- 3.2.2, N.3
389
-- An_Index_Constraint, -- 3.2.2, 3.6.1
390
-- A_Discriminant_Constraint, -- 3.2.2
392
-- A_Component_Definition, -- 3.6
394
-- A_Discrete_Subtype_Definition, -- 3.6 -> Discrete_Range_Kinds
396
-- Detailed classification for
397
-- Asis.Definition_Kinds (A_Discrete_Subtype_Definition) literal,
398
-- corresponds to subtype Internal_Discrete_Subtype_Definition_Kinds
400
-- A_Discrete_Subtype_Indication_As_Subtype_Definition, -- 3.6.1, 3.2.2
401
-- A_Discrete_Range_Attribute_Reference_As_Subtype_Definition,
403
-- A_Discrete_Simple_Expression_Range_As_Subtype_Definition,
406
-- There is no syntactical difference between
407
-- A_Discrete_Subtype_Definition kinds and A_Discrete_Range kinds, the
408
-- difference is in the context in which they occur - the first defines
409
-- subtype in an array type definition, the second should corresponds to
410
-- some existing subtype in a range constraint
412
-- This is the case when in the ASIS-defined Element classification
413
-- we have a net instead of a hierarchy
415
-- A_Discrete_Range, -- 3.6.1 -> Discrete_Range_Kinds
417
-- Detailed classification for Asis.Definition_Kinds (A_Discrete_Range)
418
-- literal, corresponds to subtype Internal_Discrete_Range_Kinds
420
-- A_Discrete_Subtype_Indication, -- 3.6.1, 3.2.2
421
-- A_Discrete_Range_Attribute_Reference, -- 3.6.1, 3.5
422
-- A_Discrete_Simple_Expression_Range, -- 3.6.1, 3.5
425
-- An_Unknown_Discriminant_Part, -- 3.7
426
-- A_Known_Discriminant_Part, -- 3.7
428
-- A_Record_Definition, -- 3.8
429
-- A_Null_Record_Definition, -- 3.8
431
-- A_Null_Component, -- 3.8
432
-- A_Variant_Part, -- 3.8
435
-- An_Others_Choice, -- 3.8.1, 4.3.1, 4.3.3, 11.2
437
-- A_Private_Type_Definition, -- 7.3 -> Trait_Kinds
438
-- A_Tagged_Private_Type_Definition, -- 7.3 -> Trait_Kinds
439
-- A_Private_Extension_Definition, -- 7.3 -> Trait_Kinds
441
-- A_Task_Definition, -- 9.1
442
-- A_Protected_Definition, -- 9.4
444
-- A_Formal_Type_Definition, -- 12.5 -> Formal_Type_Kinds
446
-- Detailed classification for
447
-- Asis.Definition_Kinds (A_Formal_Type_Definition) literal,
448
-- corresponds to subtype Internal_Formal_Type_Kinds
450
-- A_Formal_Private_Type_Definition, -- 12.5.1 -> Trait_Kinds
451
-- A_Formal_Tagged_Private_Type_Definition, -- 12.5.1 -> Trait_Kinds
453
-- A_Formal_Derived_Type_Definition, -- 12.5.1 -> Trait_Kinds
455
-- A_Formal_Discrete_Type_Definition, -- 12.5.2
457
-- A_Formal_Signed_Integer_Type_Definition, -- 12.5.2
458
-- A_Formal_Modular_Type_Definition, -- 12.5.2
460
-- A_Formal_Floating_Point_Definition, -- 12.5.2
462
-- A_Formal_Ordinary_Fixed_Point_Definition, -- 12.5.2
463
-- A_Formal_Decimal_Fixed_Point_Definition, -- 12.5.2
465
-- A_Formal_Unconstrained_Array_Definition, -- 12.5.3
466
-- A_Formal_Constrained_Array_Definition, -- 12.5.3
468
-- A_Formal_Access_Type_Definition, -- 12.5.4 -> Access_Type_Kinds
470
-- Detailed classification for
471
-- Asis.Definition_Kinds.Internal_Formal_Type_Kinds
472
-- (A_Formal_Access_Type_Definition) literal,
473
-- corresponds to subtype Internal_Formal_Access_Type_Kinds
475
-- A_Formal_Pool_Specific_Access_To_Variable,
476
-- -- access subtype_indication
477
-- A_Formal_Access_To_Variable, -- access all subtype_indication
478
-- A_Formal_Access_To_Constant, -- access constant subtype_indication
480
-- A_Formal_Access_To_Procedure, -- access procedure
481
-- A_Formal_Access_To_Protected_Procedure, -- access protected procedure
482
-- A_Formal_Access_To_Function, -- access function
483
-- A_Formal_Access_To_Protected_Function, -- access protected function
485
------------------------------------------------------------
487
-- An_Expression, -- Asis.Expressions
489
-- Detailed classification for Asis.Element_Kinds (An_Expression)
490
-- literal corresponds to subtype Internal_Expression_Kinds
491
------------------------------------------------------------
493
-- An_Integer_Literal, -- 2.4
494
-- A_Real_Literal, -- 2.4.1
495
-- A_String_Literal, -- 2.6
497
-- An_Identifier, -- 4.1
499
-- An_Operator_Symbol, -- 4.1
501
-- Detailed classification for
502
-- Asis.Expression_Kinds (An_Operator_Symbol) literal
503
-- corresponds to subtype Internal_Operator_Symbol_Kinds
505
-- An_And_Operator, -- and
506
-- An_Or_Operator, -- or
507
-- An_Xor_Operator, -- xor
508
-- An_Equal_Operator, -- =
509
-- A_Not_Equal_Operator, -- /=
510
-- A_Less_Than_Operator, -- <
511
-- A_Less_Than_Or_Equal_Operator, -- <=
512
-- A_Greater_Than_Operator, -- >
513
-- A_Greater_Than_Or_Equal_Operator, -- >=
514
-- A_Plus_Operator, -- +
515
-- A_Minus_Operator, -- -
516
-- A_Concatenate_Operator, -- &
517
-- A_Unary_Plus_Operator, -- +
518
-- A_Unary_Minus_Operator, -- -
519
-- A_Multiply_Operator, -- *
520
-- A_Divide_Operator, -- /
521
-- A_Mod_Operator, -- mod
522
-- A_Rem_Operator, -- rem
523
-- An_Exponentiate_Operator, -- **
524
-- An_Abs_Operator, -- abs
525
-- A_Not_Operator, -- not
527
-- A_Character_Literal, -- 4.1
528
-- An_Enumeration_Literal, -- 4.1
529
-- An_Explicit_Dereference, -- 4.1
530
-- A_Function_Call, -- 4.1
532
-- An_Indexed_Component, -- 4.1.1
534
-- A_Selected_Component, -- 4.1.3
536
-- An_Attribute_Reference, -- 4.1.4
538
-- Detailed classification for
539
-- Asis.Expression_Kinds (An_Attribute_Reference) literal
540
-- corresponds to subtype Internal_Attribute_Reference_Kinds
542
-- An_Access_Attribute, -- 3.10.2(24), 3.10.2(32), K(2), K(4)
543
-- An_Address_Attribute, -- 13.3(11), J.7.1(5), K(6)
544
-- An_Adjacent_Attribute, -- A.5.3(48), K(8)
545
-- An_Aft_Attribute, -- 3.5.10(5), K(12)
546
-- An_Alignment_Attribute, -- 13.3(23), K(14)
547
-- A_Base_Attribute, -- 3.5(15), K(17)
548
-- A_Bit_Order_Attribute, -- 13.5.3(4), K(19)
549
-- A_Body_Version_Attribute, -- E.3(4), K(21)
550
-- A_Callable_Attribute, -- 9.9(2), K(23)
551
-- A_Caller_Attribute, -- C.7.1(14), K(25)
552
-- A_Ceiling_Attribute, -- A.5.3(33), K(27)
553
-- A_Class_Attribute, -- 3.9(14), 7.3.1(9), K(31), K(34)
554
-- A_Component_Size_Attribute, -- 13.3(69), K(36)
555
-- A_Compose_Attribute, -- A.5.3(24), K(38)
556
-- A_Constrained_Attribute, -- 3.7.2(3), J.4(2), K(42)
557
-- A_Copy_Sign_Attribute, -- A.5.3(51), K(44)
558
-- A_Count_Attribute, -- 9.9(5), K(48)
559
-- A_Definite_Attribute, -- 12.5.1(23), K(50)
560
-- A_Delta_Attribute, -- 3.5.10(3), K(52)
561
-- A_Denorm_Attribute, -- A.5.3(9), K(54)
562
-- A_Digits_Attribute, -- 3.5.8(2), 3.5.10(7), K(56), K(58)
563
-- An_Exponent_Attribute, -- A.5.3(18), K(60)
564
-- An_External_Tag_Attribute, -- 13.3(75), K(64)
565
-- A_First_Attribute, -- 3.5(12), 3.6.2(3), K(68), K(70)
566
-- A_First_Bit_Attribute, -- 13.5.2(3), K(72)
567
-- A_Floor_Attribute, -- A.5.3(30), K(74)
568
-- A_Fore_Attribute, -- 3.5.10(4), K(78)
569
-- A_Fraction_Attribute, -- A.5.3(21), K(80)
570
-- An_Identity_Attribute, -- 11.4.1(9), C.7.1(12), K(84), K(86)
571
-- An_Image_Attribute, -- 3.5(35), K(88)
572
-- An_Input_Attribute, -- 13.13.2(22), 13.13.2(32), K(92), K(96)
573
-- A_Last_Attribute, -- 3.5(13), 3.6.2(5), K(102), K(104)
574
-- A_Last_Bit_Attribute, -- 13.5.2(4), K(106)
575
-- A_Leading_Part_Attribute, -- A.5.3(54), K(108)
576
-- A_Length_Attribute, -- 3.6.2(9), K(117)
577
-- A_Machine_Attribute, -- A.5.3(60), K(119)
578
-- A_Machine_Emax_Attribute, -- A.5.3(8), K(123)
579
-- A_Machine_Emin_Attribute, -- A.5.3(7), K(125)
580
-- A_Machine_Mantissa_Attribute, -- A.5.3(6), K(127)
581
-- A_Machine_Overflows_Attribute, -- A.5.3(12), A.5.4(4), K(129), K(131)
582
-- A_Machine_Radix_Attribute, -- A.5.3(2), A.5.4(2), K(133), K(135)
583
-- A_Machine_Rounds_Attribute, -- A.5.3(11), A.5.4(3), K(137), K(139)
584
-- A_Max_Attribute, -- 3.5(19), K(141)
585
-- A_Max_Size_In_Storage_Elements_Attribute, -- 13.11.1(3), K(145)
586
-- A_Min_Attribute, -- 3.5(16), K(147)
587
-- A_Model_Attribute, -- A.5.3(68), G.2.2(7), K(151)
588
-- A_Model_Emin_Attribute, -- A.5.3(65), G.2.2(4), K(155)
589
-- A_Model_Epsilon_Attribute, -- A.5.3(66), K(157)
590
-- A_Model_Mantissa_Attribute, -- A.5.3(64), G.2.2(3), K(159)
591
-- A_Model_Small_Attribute, -- A.5.3(67), K(161)
592
-- A_Modulus_Attribute, -- 3.5.4(17), K(163)
593
-- An_Output_Attribute, -- 13.13.2(19), 13.13.2(29), K(165), K(169)
594
-- A_Partition_ID_Attribute, -- E.1(9), K(173)
595
-- A_Pos_Attribute, -- 3.5.5(2), K(175)
596
-- A_Position_Attribute, -- 13.5.2(2), K(179)
597
-- A_Pred_Attribute, -- 3.5(25), K(181)
598
-- A_Range_Attribute, -- 3.5(14), 3.6.2(7), K(187), K(189)
599
-- A_Read_Attribute, -- 13.13.2(6), 13.13.2(14), K(191), K(195)
600
-- A_Remainder_Attribute, -- A.5.3(45), K(199)
601
-- A_Round_Attribute, -- 3.5.10(12), K(203)
602
-- A_Rounding_Attribute, -- A.5.3(36), K(207)
603
-- A_Safe_First_Attribute, -- A.5.3(71), G.2.2(5), K(211)
604
-- A_Safe_Last_Attribute, -- A.5.3(72), G.2.2(6), K(213)
605
-- A_Scale_Attribute, -- 3.5.10(11), K(215)
606
-- A_Scaling_Attribute, -- A.5.3(27), K(217)
607
-- A_Signed_Zeros_Attribute, -- A.5.3(13), K(221)
608
-- A_Size_Attribute, -- 13.3(40), 13.3(45), K(223), K(228)
609
-- A_Small_Attribute, -- 3.5.10(2), K(230)
610
-- A_Storage_Pool_Attribute, -- 13.11(13), K(232)
611
-- A_Storage_Size_Attribute, -- 13.3(60), 13.11(14), J.9(2), K(234),
613
-- A_Succ_Attribute, -- 3.5(22), K(238)
614
-- A_Tag_Attribute, -- 3.9(16), 3.9(18), K(242), K(244)
615
-- A_Terminated_Attribute, -- 9.9(3), K(246)
616
-- A_Truncation_Attribute, -- A.5.3(42), K(248)
617
-- An_Unbiased_Rounding_Attribute, -- A.5.3(39), K(252)
618
-- An_Unchecked_Access_Attribute, -- 13.10(3), H.4(18), K(256)
619
-- A_Val_Attribute, -- 3.5.5(5), K(258)
620
-- A_Valid_Attribute, -- 13.9.2(3), H(6), K(262)
621
-- A_Value_Attribute, -- 3.5(52), K(264)
622
-- A_Version_Attribute, -- E.3(3), K(268)
623
-- A_Wide_Image_Attribute, -- 3.5(28), K(270)
624
-- A_Wide_Value_Attribute, -- 3.5(40), K(274)
625
-- A_Wide_Width_Attribute, -- 3.5(38), K(278)
626
-- A_Width_Attribute, -- 3.5(39), K(280)
627
-- A_Write_Attribute, -- 13.13.2(3), 13.13.2(11), K(282), K(286)
629
-- An_Implementation_Defined_Attribute, -- Vendor Annex M
630
-- An_Unknown_Attribute,
632
-- A_Record_Aggregate, -- 4.3
633
-- An_Extension_Aggregate, -- 4.3
634
-- A_Positional_Array_Aggregate, -- 4.3
635
-- A_Named_Array_Aggregate, -- 4.3
637
-- An_And_Then_Short_Circuit, -- 4.4
638
-- An_Or_Else_Short_Circuit, -- 4.4
640
-- An_In_Range_Membership_Test, -- 4.4
641
-- A_Not_In_Range_Membership_Test, -- 4.4
642
-- An_In_Type_Membership_Test, -- 4.4
643
-- A_Not_In_Type_Membership_Test, -- 4.4
645
-- A_Null_Literal, -- 4.4
646
-- A_Parenthesized_Expression, -- 4.4
648
-- A_Type_Conversion, -- 4.6
649
-- A_Qualified_Expression, -- 4.7
651
-- An_Allocation_From_Subtype, -- 4.8
652
-- An_Allocation_From_Qualified_Expression, -- 4.8
654
------------------------------------------------------------
656
-- An_Association, -- Asis.Expressions
658
-- Detailed classification for Asis.Element_Kinds (An_Association)
659
-- literal corresponds to subtype Internal_Association_Kinds
660
------------------------------------------------------------
662
-- A_Pragma_Argument_Association, -- 2.8
663
-- A_Discriminant_Association, -- 3.7.1
664
-- A_Record_Component_Association, -- 4.3.1
665
-- An_Array_Component_Association, -- 4.3.3
666
-- A_Parameter_Association, -- 6.4
667
-- A_Generic_Association, -- 12.3
669
------------------------------------------------------------
671
-- A_Statement, -- Asis.Statements
673
-- Detailed classification for Asis.Element_Kinds (A_Statement) literal
674
-- corresponds to subtype Internal_Statement_Kinds
675
------------------------------------------------------------
677
-- A_Null_Statement, -- 5.1
678
-- An_Assignment_Statement, -- 5.2
679
-- An_If_Statement, -- 5.3
680
-- A_Case_Statement, -- 5.4
682
-- A_Loop_Statement, -- 5.5
683
-- A_While_Loop_Statement, -- 5.5
684
-- A_For_Loop_Statement, -- 5.5
686
-- A_Block_Statement, -- 5.6
687
-- An_Exit_Statement, -- 5.7
688
-- A_Goto_Statement, -- 5.8
690
-- A_Procedure_Call_Statement, -- 6.4
691
-- A_Return_Statement, -- 6.5
693
-- An_Accept_Statement, -- 9.5.2
694
-- An_Entry_Call_Statement, -- 9.5.3
696
-- A_Requeue_Statement, -- 9.5.4
697
-- A_Requeue_Statement_With_Abort, -- 9.5.4
699
-- A_Delay_Until_Statement, -- 9.6
700
-- A_Delay_Relative_Statement, -- 9.6
702
-- A_Terminate_Alternative_Statement, -- 9.7.1
704
-- A_Selective_Accept_Statement, -- 9.7.2
705
-- A_Timed_Entry_Call_Statement, -- 9.7.3
706
-- A_Conditional_Entry_Call_Statement, -- 9.7.3
707
-- An_Asynchronous_Select_Statement, -- 9.7.4
709
-- An_Abort_Statement, -- 9.8
710
-- A_Raise_Statement, -- 11.3
711
-- A_Code_Statement, -- 13.8
713
------------------------------------------------------------
715
-- Literals -- Ada RM
717
-- Detailed classification for Asis.Element_Kinds (A_Path) literal
718
-- corresponds to subtype Internal_Path_Kinds
719
------------------------------------------------------------
721
-- An_If_Path, -- 5.3:
723
-- sequence_of_statements
725
-- An_Elsif_Path, -- 5.3:
726
-- elsif condition then
727
-- sequence_of_statements
729
-- An_Else_Path, -- 5.3, 9.7.1, 9.7.3:
730
-- else sequence_of_statements
732
-- A_Case_Path, -- 5.4:
733
-- when discrete_choice_list =>
734
-- sequence_of_statements
736
-- A_Select_Path, -- 9.7.1:
737
-- select [guard] select_alternative
739
-- select entry_call_alternative
741
-- select triggering_alternative
743
-- An_Or_Path, -- 9.7.1:
744
-- or [guard] select_alternative
746
-- or delay_alternative
748
-- A_Then_Abort_Path, -- 9.7.4
749
-- then abort sequence_of_statements
752
------------------------------------------------------------
754
-- A_Clause, -- Asis.Clauses
756
-- Detailed classification for Asis.Element_Kinds (A_Clause) literal
757
-- corresponds to subtype Internal_Clause_Kinds
758
------------------------------------------------------------
760
-- A_Use_Package_Clause, -- 8.4
761
-- A_Use_Type_Clause, -- 8.4
762
-- A_With_Clause, -- 10.1.2
764
-- A_Representation_Clause, -- 13.1 -> Representation_Clause_Kinds
766
-- Detailed classification for
767
-- Asis.Clause_Kinds (A_Representation_Clause) literal,
768
-- corresponds to subtype Internal_Representation_Clause_Kinds
770
-- An_Attribute_Definition_Clause, -- 13.3.1
771
-- An_Enumeration_Representation_Clause, -- 13.4
772
-- A_Record_Representation_Clause, -- 13.5.3
773
-- An_At_Clause, -- N.7
775
-- A_Component_Clause, -- 13.5.3
777
------------------------------------------------------------
779
-- An_Exception_Handler, -- Asis.Statements
781
-- The rest of the A4G.Int_Knds.Internal_Element_Kinds values are the
782
-- special values added the ASIS implementation needs.
785
-- The subtype definitions below define ranges corresponding to the
786
-- positions (subordinate kinds) in the original Element kinds
787
-- classification hierarchy defined in the Asis package, as well as
788
-- some other ranges which may be useful for applications
790
subtype Flat_Pragma_Kinds is Flat_Element_Kinds
791
range An_All_Calls_Remote_Pragma .. An_Unknown_Pragma;
793
subtype Flat_Defining_Name_Kinds is Flat_Element_Kinds
794
range A_Defining_Identifier .. A_Defining_Expanded_Name;
796
subtype Flat_Defining_Operator_Kinds is Flat_Defining_Name_Kinds
797
range A_Defining_And_Operator .. A_Defining_Not_Operator;
799
subtype Flat_Declaration_Kinds is Flat_Element_Kinds range
800
An_Ordinary_Type_Declaration .. A_Formal_Package_Declaration_With_Box;
802
subtype A_Flat_Type_Declaration is Flat_Declaration_Kinds
803
range An_Ordinary_Type_Declaration .. A_Private_Extension_Declaration;
805
subtype A_Flat_Full_Type_Declaration is Flat_Declaration_Kinds
806
range An_Ordinary_Type_Declaration .. A_Protected_Type_Declaration;
808
subtype A_Flat_Object_Declaration is Flat_Declaration_Kinds
809
range A_Variable_Declaration .. A_Single_Protected_Declaration;
811
subtype A_Flat_Number_Declaration is Flat_Declaration_Kinds
812
range An_Integer_Number_Declaration .. A_Real_Number_Declaration;
814
subtype A_Flat_Renaming_Declaration is Flat_Declaration_Kinds
815
range An_Object_Renaming_Declaration ..
816
A_Generic_Function_Renaming_Declaration;
818
subtype A_Flat_Body_Stub is Flat_Declaration_Kinds
819
range A_Procedure_Body_Stub .. A_Protected_Body_Stub;
821
subtype A_Flat_Generic_Declaration is Flat_Declaration_Kinds
822
range A_Generic_Procedure_Declaration .. A_Generic_Package_Declaration;
824
subtype A_Flat_Generic_Instantiation is Flat_Declaration_Kinds
825
range A_Package_Instantiation .. A_Function_Instantiation;
827
subtype A_Flat_Formal_Declaration is Flat_Declaration_Kinds range
828
A_Formal_Object_Declaration .. A_Formal_Package_Declaration_With_Box;
830
subtype Flat_Definition_Kinds is Flat_Element_Kinds range
831
A_Derived_Type_Definition .. A_Formal_Access_To_Protected_Function;
833
subtype Flat_Type_Kinds is Flat_Definition_Kinds
834
range A_Derived_Type_Definition .. An_Access_To_Protected_Function;
836
subtype Flat_Access_Type_Kinds is Flat_Type_Kinds range
837
A_Pool_Specific_Access_To_Variable .. An_Access_To_Protected_Function;
839
subtype Flat_Access_To_Object_Definition is Flat_Access_Type_Kinds
840
range A_Pool_Specific_Access_To_Variable .. An_Access_To_Constant;
842
subtype Flat_Access_To_Subprogram_Definition is Flat_Access_Type_Kinds
843
range An_Access_To_Procedure .. An_Access_To_Protected_Function;
845
subtype Flat_Root_Type_Kinds is Flat_Type_Kinds
846
range A_Root_Integer_Definition .. A_Universal_Fixed_Definition;
848
subtype Flat_Constraint_Kinds is Flat_Definition_Kinds
849
range A_Range_Attribute_Reference .. A_Discriminant_Constraint;
851
subtype Flat_Discrete_Subtype_Definition_Kinds is Flat_Definition_Kinds
852
range A_Discrete_Subtype_Indication_As_Subtype_Definition ..
853
A_Discrete_Simple_Expression_Range_As_Subtype_Definition;
855
subtype Flat_Discrete_Range_Kinds is Flat_Definition_Kinds range
856
A_Discrete_Subtype_Indication .. A_Discrete_Simple_Expression_Range;
858
subtype Flat_Formal_Type_Kinds is Flat_Definition_Kinds
859
range A_Formal_Private_Type_Definition ..
860
A_Formal_Access_To_Protected_Function;
862
subtype Flat_Formal_Access_Type_Kinds is Flat_Formal_Type_Kinds
863
range A_Formal_Pool_Specific_Access_To_Variable ..
864
A_Formal_Access_To_Protected_Function;
866
subtype Flat_Association_Kinds is Flat_Element_Kinds
867
range A_Pragma_Argument_Association .. A_Generic_Association;
869
subtype Flat_Expression_Kinds is Flat_Element_Kinds
870
range An_Integer_Literal .. An_Allocation_From_Qualified_Expression;
872
subtype Flat_Operator_Symbol_Kinds is Flat_Expression_Kinds
873
range An_And_Operator .. A_Not_Operator;
875
subtype Flat_Attribute_Reference_Kinds is Flat_Expression_Kinds
876
range An_Access_Attribute .. An_Unknown_Attribute;
878
subtype Flat_Statement_Kinds is Flat_Element_Kinds
879
range A_Null_Statement .. A_Code_Statement;
881
subtype Flat_Loop_Statement is Flat_Statement_Kinds
882
range A_Loop_Statement .. A_For_Loop_Statement;
884
subtype Flat_Path_Kinds is Flat_Element_Kinds
885
range An_If_Path .. A_Then_Abort_Path;
887
subtype Flat_Clause_Kinds is Flat_Element_Kinds
888
range A_Use_Package_Clause .. A_Component_Clause;
890
subtype Flat_Use_Clause_Kinds is Flat_Clause_Kinds
891
range A_Use_Package_Clause .. A_Use_Type_Clause;
893
subtype Flat_Context_Clause_Kinds is Flat_Clause_Kinds
894
range A_Use_Package_Clause .. A_With_Clause;
896
subtype Flat_Representation_Clause_Kinds is Flat_Clause_Kinds
897
range An_Attribute_Definition_Clause .. An_At_Clause;
899
---------------------------------------------------------------
900
-- Queries implementing the flat Element classification and --
901
-- mapping it onto the ASIS-defined classification hierarchy --
902
---------------------------------------------------------------
904
function Flat_Element_Kind
905
(Element : Asis.Element)
906
return Flat_Element_Kinds;
907
-- Returns the Flat_Element_Kinds value of Element. Not_An_Element is
908
-- returned if and only if Element is Nil_Element
910
-- The following functions convert the value of Flat_Element_Kinds
911
-- given as their argument into the corresponding value of the
912
-- corresponding Asis Element Classification subordinate kind.
913
-- Not_A_XXX is returned if the argument does not belong to the
914
-- corresponding subordinate kind of the Element classification
915
-- hierarchy (and, thereforo to the corresponding flat classification
918
function Asis_From_Flat_Kind
919
(Flat_Kind : Flat_Element_Kinds)
920
return Asis.Element_Kinds;
922
function Pragma_Kind_From_Flat
923
(Flat_Kind : Flat_Element_Kinds)
924
return Asis.Pragma_Kinds;
926
function Defining_Name_Kind_From_Flat
927
(Flat_Kind : Flat_Element_Kinds)
928
return Asis.Defining_Name_Kinds;
930
function Declaration_Kind_From_Flat
931
(Flat_Kind : Flat_Element_Kinds)
932
return Asis.Declaration_Kinds;
933
function Definition_Kind_From_Flat
934
(Flat_Kind : Flat_Element_Kinds)
935
return Asis.Definition_Kinds;
937
function Type_Kind_From_Flat
938
(Flat_Kind : Flat_Element_Kinds)
939
return Asis.Type_Kinds;
941
function Formal_Type_Kind_From_Flat
942
(Flat_Kind : Flat_Element_Kinds)
943
return Asis.Formal_Type_Kinds;
945
function Access_Type_Kind_From_Flat
946
(Flat_Kind : Flat_Element_Kinds)
947
return Asis.Access_Type_Kinds;
949
function Root_Type_Kind_From_Flat
950
(Flat_Kind : Flat_Element_Kinds)
951
return Asis.Root_Type_Kinds;
953
function Constraint_Kind_From_Flat
954
(Flat_Kind : Flat_Element_Kinds)
955
return Asis.Constraint_Kinds;
957
function Discrete_Range_Kind_From_Flat
958
(Flat_Kind : Flat_Element_Kinds)
959
return Asis.Discrete_Range_Kinds;
961
function Expression_Kind_From_Flat
962
(Flat_Kind : Flat_Element_Kinds)
963
return Asis.Expression_Kinds;
965
function Operator_Kind_From_Flat
966
(Flat_Kind : Flat_Element_Kinds)
967
return Asis.Operator_Kinds;
969
function Attribute_Kind_From_Flat
970
(Flat_Kind : Flat_Element_Kinds)
971
return Asis.Attribute_Kinds;
973
function Association_Kind_From_Flat
974
(Flat_Kind : Flat_Element_Kinds)
975
return Asis.Association_Kinds;
977
function Statement_Kind_From_Flat
978
(Flat_Kind : Flat_Element_Kinds)
979
return Asis.Statement_Kinds;
981
function Path_Kind_From_Flat
982
(Flat_Kind : Flat_Element_Kinds)
983
return Asis.Path_Kinds;
985
function Clause_Kind_From_Flat
986
(Flat_Kind : Flat_Element_Kinds)
987
return Asis.Clause_Kinds;
989
function Representation_Clause_Kind_From_Flat
990
(Flat_Kind : Flat_Element_Kinds)
991
return Asis.Representation_Clause_Kinds;
993
-------------------------------------
994
-- Additional Classification items --
995
-------------------------------------
997
function Def_Operator_Kind
998
(Op_Kind : Flat_Element_Kinds)
999
return Flat_Element_Kinds;
1000
-- this function "converts" the value of Flat_Operator_Symbol_Kinds
1001
-- into the corresponding value of Flat_Defining_Operator_Kinds,
1002
-- implementing the "mapping" between usage and defining occurences of tthe
1003
-- operator signs. It is an error to call it to an Flat_Element_Kinds
1004
-- value which does not belong to Flat_Operator_Symbol_Kinds
1006
end Asis.Extensions.Flat_Kinds;
b'\\ No newline at end of file'