This file is indexed.

/usr/share/ada/adainclude/asis/asis-definitions.ads is in libasis2014-dev 2014-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  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
  87
  88
  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
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 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
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
------------------------------------------------------------------------------
--                                                                          --
--                   ASIS-for-GNAT INTERFACE COMPONENTS                     --
--                                                                          --
--                      A S I S . D E F I N I T I O N S                     --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
--            Copyright (C) 2006-2012, Free Software Foundation, Inc.       --
--                                                                          --
-- This   specification  is  adapted   from  the  Ada   Semantic  Interface --
-- Specification Standard (ISO/IEC 15291) for use with GNAT.  In accordance --
-- with the copyright of that document, you can freely copy and modify this --
-- specification, provided that if you redistribute a modified version, any --
-- changes that you have made are clearly indicated.                        --
--                                                                          --
-- This  specification  also  contains  suggestions  and  discussion  items --
-- related to revising the  ASIS Standard according to the changes proposed --
-- for  the  new  revision of the Ada standard. The copyright notice above, --
-- and the license provisions that follow apply solely to these suggestions --
-- and  discussion  items  that  are separated by the corresponding comment --
-- sentinels                                                                --
--                                                                          --
-- ASIS-for-GNAT 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. ASIS-for-GNAT is distributed  in the hope  that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY 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  ASIS-for-GNAT; see file --
-- COPYING.  If not,  write  to the  Free Software Foundation,  51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA.                         --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
-- ASIS-for-GNAT was originally developed  by the ASIS-for-GNAT team at the --
-- Software  Engineering  Laboratory  of  the Swiss  Federal  Institute  of --
-- Technology (LGL-EPFL) in Lausanne,  Switzerland, in cooperation with the --
-- Scientific  Research  Computer  Center of  Moscow State University (SRCC --
-- MSU), Russia,  with funding partially provided  by grants from the Swiss --
-- National  Science  Foundation  and  the  Swiss  Academy  of  Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore                     --
-- (http://www.adacore.com).                                                --
--                                                                          --
------------------------------------------------------------------------------

------------------------------------------------------------------------------
--  16 package Asis.Definitions

--  Suggestions related to changing this specification to accept new Ada
--  features as defined in incoming revision of the Ada Standard (ISO 8652)
--  are marked by following comment sentinels:
--
--  --|A2005 start
--   ... the suggestion goes here ...
--  --|A2005 end
--
--  and the discussion items are marked by the comment sentinels of teh form:
--
--  --|D2005 start
--   ... the discussion item goes here ...
--  --|D2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
package Asis.Definitions is
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--  Asis.Definitions encapsulates a set of queries that operate on A_Definition
--  and An_Association elements.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--  16.1  function Corresponding_Type_Operators
------------------------------------------------------------------------------
--  --|ER---------------------------------------------------------------------
--  --|ER A_Type_Definition - 3.2.1
------------------------------------------------------------------------------

   function Corresponding_Type_Operators
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Declaration_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the type to query
--
--  Returns a list of operators.  These include all predefined operators, and
--  all user-defined operator overloads, that have been implicitly or
--  explicitly declared for the type. (Reference Manual 7.3.1(2))
--
--  This list includes only operators appropriate for the type, from the set:
--       and or xor = /= < <= > >= + - & * / mod rem ** abs not
--
--  Returns a Nil_Element_List if there are no predefined or overloaded
--  operators for the type.
--
--  Returns a Nil_Element_List if the implementation does not provide
--  such implicit declarations.
--
--  The Enclosing_Element for each implicit declaration is the declaration
--  (type or object) that declared the type.
--
--  For limited private types, if a user-defined equality operator has
--  been defined, an Ada implementation has two choices when dealing with an
--  instance of the "/=" operator.  a) treat A/=B as NOT(A=B), b) implicitly
--  create a "/=" operator.  Implementations that take the second alternative
--  will include this implicit inequality operation in their result.
--  Implementations that choose the first alternative are encouraged to hide
--  this choice beneath the ASIS interface and to "fake" an inequality
--  operation.  Failing that, the function call, representing the NOT
--  operation, must have Is_Part_Of_Implicit = True so that an ASIS application
--  can tell the  difference between a user-specified NOT(A=B) and an
--  implementation-specific A/=B transformation.
--
--  Appropriate Definition_Kinds:
--       A_Type_Definition
--       A_Formal_Type_Declaration
--
--  Returns Declaration_Kinds:
--       A_Function_Declaration
--       A_Function_Body_Declaration
--       A_Function_Body_Stub
--       A_Function_Renaming_Declaration
--       A_Function_Instantiation
--       A_Formal_Function_Declaration
--
--  --|IP Implementation Permissions:
--  --|IP
--  --|IP The result may or may not include language defined operators that
--  --|IP have been overridden by user-defined overloads.  Operators that are
--  --|IP totally hidden, in all contexts, by user-defined operators may be
--  --|IP omitted from the list.
--  --|IP
--  --|IP Some implementations do not represent all forms of implicit
--  --|IP declarations such that elements representing them can be easily
--  --|IP provided.  An implementation can choose whether or not to construct
--  --|IP and provide artificial declarations for implicitly declared elements.
--  --|IP
--  --|D2005 start
--
--  It seems that there are at least three serious problems with the definition
--  of this query
--
--  1. Consider an Element representing an implicit inherited user-defined
--     operator function. According to the definition of this query, the
--     Enclosing_Element for this Element should be a type DECLARATION, but the
--     same (that is, Is_Equal) Element can be obtained as a result of applying
--     Implicit_Inherited_Subprograms to the type DEFINITION, and the
--     documentation of Implicit_Inherited_Subprograms says that the
--     Enclosing_Element for this operator function Element should be the
--     type DEFINITION. But for two Is_Equal Elements the corresponding results
--     of Enclosing_Element should also be Is_Equal!
--
--  2. Should this query return ALL the operator function having the argument
--     type as a type of a parameter or result, or should it return only those
--     operator functions that are PRIMITIVE OPERATIONS of the type? The first
--     approach looks too expensive from the implementation viewpoint
--
--  3. The list of appropriate kinds looks inconsistent - we have a one
--     position from Definition_Kinds and another - from Declaration_Kinds.
--     The query is located in Asis.Definitions package, so it is supposed to
--     operate of A_Definition Elements.
--
--  This query is now implemented with the following ramification of its
--  definition:
--
--  1. The list of appropriate kinds is:
--
--     Appropriate Definition_Kinds:
--       A_Type_Definition
--       A_Formal_Type_Declaration
--       A_Private_Type_Definition
--       A_Tagged_Private_Type_Definition
--       A_Private_Extension_Definition
--       A_Task_Definition
--       A_Protected_Definition
--
--  2. The query returns only primitive operators of the type, except if the
--     argument is A_Formal_Type_Declaration. In the latter case the result
--     contains inherited user-defined operators and all the formal
--     operators defined for this type
--
--  3. Any operator that satisfy conditions given in (2) and that has a
--     parameter or returns the result of the argument type is returned.
--
--  4. In case of a private type and private extension, the query returns
--     the same results when applied to the private and to the full view.
--
--  5. Implicit declarations of predefined operators are not supported. So
--     they are not included in the result of the query
--
--  --|D2005 end

--  --|ER---------------------------------------------------------------------
--  --|ER A_Derived_Type_Definition - 3.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Parent_Subtype_Indication
--  --|ER---------------------------------------------------------------------
--  --|ER A_Derived_Record_Extension_Definition - 3.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Parent_Subtype_Indication
--  --|CR    function Record_Definition
--
------------------------------------------------------------------------------
--  16.2  function Parent_Subtype_Indication
------------------------------------------------------------------------------

   function Parent_Subtype_Indication
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Subtype_Indication;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the derived_type_definition to query
--
--  Returns the parent_subtype_indication following the reserved word "new".
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Returns Definition_Kinds:
--       A_Subtype_Indication
--
------------------------------------------------------------------------------
--  16.3  function Record_Definition
------------------------------------------------------------------------------

   function Record_Definition
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Definition;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the definition to query
--
--  Returns the record definition of the type_definition.
--
--  Appropriate Type_Kinds:
--       A_Derived_Record_Extension_Definition
--       A_Record_Type_Definition
--       A_Tagged_Record_Type_Definition
--
--  Returns Definition_Kinds:
--       A_Record_Definition
--       A_Null_Record_Definition
--
------------------------------------------------------------------------------
--  16.4  function Implicit_Inherited_Declarations
------------------------------------------------------------------------------

   function Implicit_Inherited_Declarations
     (Definition : Asis.Definition)
      return       Asis.Declaration_List;

------------------------------------------------------------------------------
--  Definition - Specifies the derived type to query
--
--  Returns a list of Is_Part_Of_Implicit inherited enumeration literals,
--  discriminants, components, protected subprograms, or entries of a
--  derived_type_definition whose parent type is an enumeration type, or a
--  composite type other than an array type.  See Reference Manual 3.4(10-14).
--
--  Returns a Nil_Element_List if the root type of derived_type_definition is
--  not an enumeration, record, task, or protected type.
--
--  Returns a Nil_Element_List if the implementation does not provide
--  such implicit declarations.
--
--  The Enclosing_Element for each of the implicit declarations is the
--  Definition argument.
--
--  Appropriate Definition_Kinds:
--       A_Type_Definition
--       A_Private_Extension_Definition
--       A_Formal_Type_Definition
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Derived_Type_Definition
--
--  Returns Declaration_Kinds:
--
--       An_Enumeration_Literal_Specification
--       A_Discriminant_Specification
--       A_Component_Declaration
--       A_Procedure_Declaration
--       A_Function_Declaration
--       An_Entry_Declaration
--
--  --|IP Implementation Permissions:
--  --|IP
--  --|IP Some implementations do not represent all forms of implicit
--  --|IP declarations such that elements representing them can be easily
--  --|IP provided.  An implementation can choose whether or not to construct
--  --|IP and provide artificial declarations for implicitly declared elements.
--  --|IP
--  --|AN Application Note:
--  --|AN
--  --|AN This query returns only implicit inherited entry declarations for
--  --|AN derived task types. All representation clauses and pragmas associated
--  --|AN with the entries of the original task type (the root type of the
--  --|AN derived task type) apply to the inherited entries. Those are
--  --|AN available by examining the original type or by calling
--  --|AN Corresponding_Pragmas and Corresponding_Representation_Clauses.
--  --|AN These functions will return the pragmas and clauses from the original
--  --|AN type.
--
------------------------------------------------------------------------------
--  16.5  function Implicit_Inherited_Subprograms
------------------------------------------------------------------------------

   function Implicit_Inherited_Subprograms
     (Definition : Asis.Definition)
      return       Asis.Declaration_List;

------------------------------------------------------------------------------
--  Definition - Specifies the derived type to query
--
--  Returns the list of user-defined inherited primitive subprograms that have
--  been implicitly declared for the derived_type_definition.
--
--  The list result does not include hidden inherited subprograms
--  (Reference Manual 8.3).
--
--  Returns a Nil_Element_List if there are no inherited subprograms for the
--  derived type.
--
--  Returns a Nil_Element_List if the implementation does not provide
--  such implicit declarations.
--
--  The Enclosing_Element for each of the subprogram declarations is the
--  Definition argument.
--
--  Appropriate Definition_Kinds:
--       A_Type_Definition
--       A_Private_Extension_Definition
--       A_Formal_Type_Definition
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Derived_Type_Definition
--
--  Returns Declaration_Kinds:
--       A_Function_Declaration
--       A_Procedure_Declaration
--
--  --|IP Implementation Permissions:
--  --|IP
--  --|IP Some implementations do not represent all forms of implicit
--  --|IP declarations such that elements representing them can be easily
--  --|IP provided.  An implementation can choose whether or not to construct
--  --|IP and provide artificial declarations for implicitly declared elements.
--
------------------------------------------------------------------------------
--  16.6  function Corresponding_Parent_Subtype
------------------------------------------------------------------------------

   function Corresponding_Parent_Subtype
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Declaration;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the derived_type_definition to query
--
--  Returns the parent subtype declaration of the derived_type_definition.
--  The parent subtype is defined by the parent_subtype_indication.
--
--  --|D2005 start
--
--  It is not clear what should be returned, if the argument type definition
--  contains an attribute reference as the subtype_mark in the
--  parent_subtype_indication (only 'Base attribute is possible in this
--  context):
--
--    type Derived_Type is new Parent_Type'Base;
--
--  We return Nil_Element in this case as an indication that this case needs
--  some special processing in the application code.
--
--  --|D2005 end
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Returns Declaration_Kinds:
--       An_Ordinary_Type_Declaration
--       A_Task_Type_Declaration
--       A_Protected_Type_Declaration
--       A_Subtype_Declaration
--       A_Formal_Type_Declaration
--       An_Incomplete_Type_Declaration
--       A_Private_Type_Declaration
--       A_Private_Extension_Declaration
--
------------------------------------------------------------------------------
--  16.7  function Corresponding_Root_Type
------------------------------------------------------------------------------

   function Corresponding_Root_Type
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Declaration;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the derived_type_definition to query
--
--  This function recursively unwinds all type derivations and subtyping to
--  arrive at a full_type_declaration that is neither a derived type nor a
--  subtype.
--
--  In case of numeric types, this function always returns some user-defined
--  type, not an implicitly defined root type corresponding to
--  A_Root_Type_Definition. The only ways to get implicitly declared numeric
--  root or universal types are to ask for the type of a universal expression
--  or from the parameter and result profile of a predefined operation working
--  with numeric types.
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Returns Declaration_Kinds:
--       An_Ordinary_Type_Declaration
--       A_Task_Type_Declaration
--       A_Protected_Type_Declaration
--       A_Formal_Type_Declaration
--       A_Private_Type_Declaration
--       A_Private_Extension_Declaration
--
------------------------------------------------------------------------------
--  16.8  function Corresponding_Type_Structure
------------------------------------------------------------------------------

   function Corresponding_Type_Structure
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Declaration;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the derived_type_definition to query
--
--  Returns the type structure from which the specified type definition has
--  been derived.  This function will recursively unwind derivations and
--  subtyping until the type_declaration derives a change of representation or
--  is no longer derived.  See Reference Manual 13.6.
--
--  Appropriate Type_Kinds:
--       A_Derived_Type_Definition
--       A_Derived_Record_Extension_Definition
--
--  Returns Declaration_Kinds:
--       An_Ordinary_Type_Declaration
--       A_Task_Type_Declaration
--       A_Protected_Type_Declaration
--       A_Formal_Type_Declaration
--
--  --|ER---------------------------------------------------------------------
--  --|ER An_Enumeration_Type_Definition - 3.5.1
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Enumeration_Literal_Declarations
--
------------------------------------------------------------------------------
--  16.9  function Enumeration_Literal_Declarations
------------------------------------------------------------------------------

   function Enumeration_Literal_Declarations
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Declaration_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the enumeration type definition to query
--
--  Returns a list of the literals declared in an enumeration_type_definition,
--  in their order of appearance.
--
--  Appropriate Type_Kinds:
--       An_Enumeration_Type_Definition
--
--  Returns Declaration_Kinds:
--       An_Enumeration_Literal_Specification
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Signed_Integer_Type_Definition - 3.5.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Integer_Constraint
--

------------------------------------------------------------------------------
--  16.10 function Integer_Constraint
------------------------------------------------------------------------------

   function Integer_Constraint
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Range_Constraint;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the signed_integer_type_definition to query
--
--  Returns the range_constraint of the signed_integer_type_definition.
--
--  Appropriate Type_Kinds:
--       A_Signed_Integer_Type_Definition
--
--  Returns Constraint_Kinds:
--       A_Simple_Expression_Range
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Modular_Type_Definition - 3.5.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Mod_Static_Expression
--
------------------------------------------------------------------------------
--  16.11 function Mod_Static_Expression
------------------------------------------------------------------------------

   function Mod_Static_Expression
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Expression;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the modular_type_definition to query
--
--  Returns the static_expression following the reserved word "mod".
--
--  Appropriate Type_Kinds:
--       A_Modular_Type_Definition
--
--  Returns Element_Kinds:
--       An_Expression
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Floating_Point_Definition - 3.5.7
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Digits_Expression
--  --|CR    function Real_Range_Constraint
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Decimal_Fixed_Point_Definition - 3.5.9
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Digits_Expression
--  --|CR    function Delta_Expression
--  --|CR    function Real_Range_Constraint
--
------------------------------------------------------------------------------
--  16.12 function Digits_Expression
------------------------------------------------------------------------------

   function Digits_Expression
     (Definition : Asis.Definition)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Definition  - Specifies the definition to query
--
--  Returns the static_expression following the reserved word "digits".
--
--  Appropriate Definition_Kinds:
--       A_Floating_Point_Definition
--       A_Decimal_Fixed_Point_Definition
--       A_Constraint
--           Appropriate Constraint_Kinds:
--                A_Digits_Constraint
--
--  Returns Element_Kinds:
--       An_Expression
--
--  --|ER---------------------------------------------------------------------
--  --|ER An_Ordinary_Fixed_Point_Definition - 3.5.9
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Delta_Expression
--
------------------------------------------------------------------------------
--  16.13 function Delta_Expression
------------------------------------------------------------------------------

   function Delta_Expression
     (Definition : Asis.Definition)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Definition  - Specifies the definition to query
--
--  Returns the static_expression following the reserved word "delta".
--
--  Appropriate Definition_Kinds:
--       An_Ordinary_Fixed_Point_Definition
--       A_Decimal_Fixed_Point_Definition
--       A_Constraint
--           Appropriate Constraint_Kinds:
--                A_Delta_Constraint
--
--  Returns Element_Kinds:
--       An_Expression
--
------------------------------------------------------------------------------
--  16.14 function Real_Range_Constraint
------------------------------------------------------------------------------

   function Real_Range_Constraint
     (Definition : Asis.Definition)
      return       Asis.Range_Constraint;

------------------------------------------------------------------------------
--  Definition  - Specifies the definition to query
--
--  Returns the real_range_specification range_constraint of the definition.
--
--  Returns a Nil_Element if there is no explicit range_constraint.
--
--  Appropriate Definition_Kinds:
--       A_Floating_Point_Definition
--       An_Ordinary_Fixed_Point_Definition
--       A_Decimal_Fixed_Point_Definition
--       A_Constraint
--           Appropriate Constraint_Kinds:
--                A_Digits_Constraint
--                A_Delta_Constraint
--
--  Returns Constraint_Kinds:
--       Not_A_Constraint
--       A_Simple_Expression_Range
--
--  --|ER---------------------------------------------------------------------
--  --|ER An_Unconstrained_Array_Definition 3.6
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Index_Subtype_Definitions
--  --|CR    function Array_Component_Definition
--

------------------------------------------------------------------------------
--  16.15 function Index_Subtype_Definitions
------------------------------------------------------------------------------

   function Index_Subtype_Definitions
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Expression_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the array_type_definition to query
--
--  Returns a list of the index_subtype_definition subtype mark names for
--  an unconstrained_array_definition, in their order of appearance.
--
--  Appropriate Type_Kinds:
--       An_Unconstrained_Array_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Unconstrained_Array_Definition
--
--  Returns Expression_Kinds:
--       An_Identifier
--       A_Selected_Component
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Constrained_Array_Definition 3.6
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discrete_Subtype_Definitions
--  --|CR    function Array_Component_Definition
--
------------------------------------------------------------------------------
--  16.16 function Discrete_Subtype_Definitions
------------------------------------------------------------------------------

   function Discrete_Subtype_Definitions
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Definition_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the array_type_definition to query
--
--  Returns the list of Discrete_Subtype_Definition elements of a
--  constrained_array_definition, in their order of appearance.
--
--  Appropriate Type_Kinds:
--       A_Constrained_Array_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Constrained_Array_Definition
--
--  Returns Definition_Kinds:
--       A_Discrete_Subtype_Definition
--
------------------------------------------------------------------------------
--  16.17 function Array_Component_Definition
------------------------------------------------------------------------------

   function Array_Component_Definition
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Component_Definition;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the array_type_definition to query
--
--  Returns the Component_Definition of the array_type_definition.
--
--  Appropriate Type_Kinds:
--       An_Unconstrained_Array_Definition
--       A_Constrained_Array_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Unconstrained_Array_Definition
--       A_Formal_Constrained_Array_Definition
--
--  Returns Definition_Kinds:
--       A_Component_Definition
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Record_Type_Definition - 3.8
--  --|ER A_Tagged_Record_Type_Definition - 3.8
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Record_Definition
--  --|ER---------------------------------------------------------------------
--  --|ER An_Access_Type_Definition - 3.10
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Access_To_Object_Definition
--  --|CR    function Access_To_Subprogram_Parameter_Profile
--  --|CR    function Access_To_Function_Result_Profile
--
------------------------------------------------------------------------------
--  16.18 function Access_To_Object_Definition
------------------------------------------------------------------------------

   function Access_To_Object_Definition
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Subtype_Indication;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the Access_Type_Definition to query
--
--  Returns the subtype_indication following the reserved word "access".
--
--  Appropriate Type_Kinds:
--       An_Access_Type_Definition.
--       A_Formal_Access_Type_Definition
--
--  Appropriate Access_Type_Kinds:
--       A_Pool_Specific_Access_To_Variable
--       An_Access_To_Variable
--       An_Access_To_Constant
--
--  Returns Element_Kinds:
--       A_Subtype_Indication
--
------------------------------------------------------------------------------
--  --|A2005 start (implemented)
--  16.N??? function Anonymous_Access_To_Object_Subtype_Mark
------------------------------------------------------------------------------
   function Anonymous_Access_To_Object_Subtype_Mark
     (Definition : Asis.Definition)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Definition - Specifies the anonymous access definition to query
--
--  Returns the subtype_mark following the reserved word(s) "access" or
--  "access constant".
--
--  Appropriate Definition_Kinds:
--       An_Access_Definition.
--
--  Appropriate Access_Definition_Kinds:
--       An_Anonymous_Access_To_Variable
--       An_Anonymous_Access_To_Constant
--
--  Returns Expression_Kinds:
--       An_Identifier
--       A_Selected_Component
--       An_Attribute_Reference

--  --|D2005 start
--  Another possibility could be to add this functionality to the
--  Access_To_Object_Definition query. What would be better?
--  --|D2005 end

--  --|A2005 end
------------------------------------------------------------------------------

------------------------------------------------------------------------------
--  16.19 function Access_To_Subprogram_Parameter_Profile
------------------------------------------------------------------------------

   function Access_To_Subprogram_Parameter_Profile
     (Type_Definition : Asis.Type_Definition)
      return            Asis.Parameter_Specification_List;

------------------------------------------------------------------------------
--  --|A2005 start
--  Type_Definition - Specifies the access type definition to query. It may be
--  access_type_definition from type_declaration or access_definition
--  defining an anonymous access type
--
--  Returns a list of parameter_specification elements in the formal part of
--  the parameter_profile in the access type definition defining access to
--  subprogram.
--  --|A2005 end
--
--  Returns a Nil_Element_List if the parameter_profile has no formal part.
--
--  Results of this query may vary across ASIS implementations.  Some
--  implementations normalize all multiple name parameter_specification
--  elements into an equivalent sequence of corresponding single name
--  parameter_specification elements.  See Reference Manual 3.3.1(7).
--
--  --|A2005 start
--  Appropriate Definition_Kinds:
--       A_Type_Definition
--       An_Access_Definition
--  --|A2005 end

--  Appropriate Type_Kinds:
--       An_Access_Type_Definition.
--       A_Formal_Access_Type_Definition.
--
--  Appropriate Access_Type_Kinds:
--       An_Access_To_Procedure
--       An_Access_To_Protected_Procedure
--       An_Access_To_Function
--       An_Access_To_Protected_Function
--
--  --|A2005 start
--  Appropriate Access_Definition_Kinds: (implemented)
--       An_Anonymous_Access_To_Procedure
--       An_Anonymous_Access_To_Protected_Procedure
--       An_Anonymous_Access_To_Function
--       An_Anonymous_Access_To_Protected_Function
--  --|A2005 end
--
--  Returns Declaration_Kinds:
--       A_Parameter_Specification
--
------------------------------------------------------------------------------
--  16.20 function Access_To_Function_Result_Profile
------------------------------------------------------------------------------

   function Access_To_Function_Result_Profile
     (Type_Definition : Asis.Type_Definition)
--  --|A2005 start
      return Asis.Element;
--  --|A2005 end

------------------------------------------------------------------------------
--  --|A2005 start
--  Type_Definition - Specifies the access type definition to query. It may be
--  access_type_definition from type_declaration or access_definition
--  defining an anonymous access type
--
--  Returns the definition for the return type for the access function. It may
--  be subtype_mark expression or anonymous access_definition
--  --|A2005 end
--
--  --|A2005 start
--  Appropriate Definition_Kinds:
--       A_Type_Definition
--       An_Access_Definition
--  --|A2005 end
--
--  Appropriate Type_Kinds:
--       An_Access_Type_Definition
--       A_Formal_Access_Type_Definition
--
--  Appropriate Access_Type_Kinds:
--       An_Access_To_Function
--       An_Access_To_Protected_Function
--
--  --|A2005 start
--  Appropriate Access_Definition_Kinds: (implemented)
--       An_Anonymous_Access_To_Function
--       An_Anonymous_Access_To_Protected_Function
--  --|A2005 end
--
--  Returns Expression_Kinds:
--       An_Identifier
--       A_Selected_Component
--
--  --|A2005 start
--  Returns Definition_Kinds:
--       An_Access_Definition
--  --|A2005 end
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Root_Type_Definition - 3.5.4(9), 3.5.6(2) - No child elements
--  --|ER---------------------------------------------------------------------
--  --|ER
--  --|ER A_Subtype_Indication - 3.3.2
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Subtype_Mark
--  --|CR    function Subtype_Constraint
--
------------------------------------------------------------------------------
--  16.21 function Subtype_Mark
------------------------------------------------------------------------------

   function Subtype_Mark
     (Definition : Asis.Definition)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Definition  - Specifies the definition to query
--
--  Returns the subtype_mark expression of the definition.
--
--  Appropriate Definition_Kinds:
--       A_Subtype_Indication
--       A_Discrete_Subtype_Definition
--           Appropriate Discrete_Range_Kinds:
--                A_Discrete_Subtype_Indication
--       A_Discrete_Range
--           Appropriate Discrete_Range_Kinds:
--                A_Discrete_Subtype_Indication
--       A_Formal_Derived_Type_Definition
--
--  Returns Expression_Kinds:
--       An_Identifier
--       A_Selected_Component
--       An_Attribute_Reference
--

------------------------------------------------------------------------------
--  16.22 function Subtype_Constraint
------------------------------------------------------------------------------

   function Subtype_Constraint
     (Definition : Asis.Definition)
      return       Asis.Constraint;

------------------------------------------------------------------------------
--  Definition  - Specifies the definition to query
--
--  Returns the constraint of the subtype_indication.
--
--  Returns a Nil_Element if no explicit constraint is present.
--
--  Appropriate Definition_Kinds:
--       A_Subtype_Indication
--       A_Discrete_Subtype_Definition
--           Appropriate Discrete_Range_Kinds:
--                A_Discrete_Subtype_Indication
--       A_Discrete_Range
--           Appropriate Discrete_Range_Kinds:
--                A_Discrete_Subtype_Indication
--
--  Returns Definition_Kinds:
--       Not_A_Definition
--       A_Constraint
--
--  --|AN Application Note:
--  --|AN
--  --|AN When an unconstrained subtype indication for a type having
--  --|AN discriminants with default values is used, a Nil_Element is
--  --|AN returned by this function.  Use the queries Subtype_Mark, and
--  --|AN Corresponding_Name_Declaration [, and Corresponding_First_Subtype]
--  --|AN to obtain the declaration defining the defaults.
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Constraint - 3.2.2
--  --|ER
--  --|ER A_Simple_Expression_Range - 3.5
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Lower_Bound
--  --|CR    function Upper_Bound
--
------------------------------------------------------------------------------
--  16.23 function Lower_Bound
------------------------------------------------------------------------------
   function Lower_Bound
     (Constraint : Asis.Range_Constraint)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Constraint  - Specifies the range_constraint or discrete_range to query
--
--  Returns the simple_expression for the lower bound of the range.
--
--  Appropriate Constraint_Kinds:
--       A_Simple_Expression_Range
--
--  Appropriate Discrete_Range_Kinds:
--       A_Discrete_Simple_Expression_Range
--
--  Returns Element_Kinds:
--       An_Expression
--

------------------------------------------------------------------------------
--  16.24 function Upper_Bound
------------------------------------------------------------------------------

   function Upper_Bound
     (Constraint : Asis.Range_Constraint)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Constraint  - Specifies the range_constraint or discrete_range to query
--
--  Returns the simple_expression for the upper bound of the range.
--
--  Appropriate Constraint_Kinds:
--       A_Simple_Expression_Range
--
--  Appropriate Discrete_Range_Kinds:
--       A_Discrete_Simple_Expression_Range
--
--  Returns Element_Kinds:
--       An_Expression
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Range_Attribute_Reference - 3.5
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Range_Attribute
--
------------------------------------------------------------------------------
--  16.25 function Range_Attribute
------------------------------------------------------------------------------

   function Range_Attribute
     (Constraint : Asis.Range_Constraint)
      return       Asis.Expression;

------------------------------------------------------------------------------
--  Constraint  - Specifies the range_attribute_reference or
--                discrete_range attribute_reference to query
--
--  Returns the range_attribute_reference expression of the range.
--
--  Appropriate Constraint_Kinds:
--       A_Range_Attribute_Reference
--
--  Appropriate Discrete_Range_Kinds:
--       A_Discrete_Range_Attribute_Reference
--
--  Returns Expression_Kinds:
--       An_Attribute_Reference
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Digits_Constraint - 3.5.9
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Digits_Expression
--  --|CR    function Real_Range_Constraint
--  --|ER---------------------------------------------------------------------
--  --|ER A_Delta_Constraint - J.3
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Delta_Expression
--  --|CR    function Real_Range_Constraint
--  --|CR---------------------------------------------------------------------
--  --|ER An_Index_Constraint - 3.6.1
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discrete_Ranges
--

------------------------------------------------------------------------------
--  16.26 function Discrete_Ranges
------------------------------------------------------------------------------

   function Discrete_Ranges
     (Constraint : Asis.Constraint)
      return       Asis.Discrete_Range_List;

------------------------------------------------------------------------------
--  Constraint  - Specifies the array index_constraint to query
--
--  Returns the list of discrete_range components for an index_constraint,
--  in their order of appearance.
--
--  Appropriate Constraint_Kinds:
--       An_Index_Constraint
--
--  Returns Definition_Kinds:
--       A_Discrete_Range
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Discriminant_Constraint - 3.7.1
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discriminant_Associations
--
------------------------------------------------------------------------------
--  16.27 function Discriminant_Associations
------------------------------------------------------------------------------

   function Discriminant_Associations
     (Constraint : Asis.Constraint;
      Normalized : Boolean := False)
      return       Asis.Discriminant_Association_List;

------------------------------------------------------------------------------
--  Constraint  - Specifies the discriminant_constraint to query
--  Normalized  - Specifies whether the normalized form is desired
--
--  Returns a list of the discriminant_association elements of the
--  discriminant_constraint.
--
--  Returns a Nil_Element_List if there are no discriminant_association
--  elements.

--  --|D2005 start
--  A_Discriminant_Constraint can never contain no discriminant_association!
--  Just check with the definition of the syntax of this construct in the Ada
--  Standard
--  --|D2005 end

--
--  An unnormalized list contains only explicit associations ordered as they
--  appear in the program text.  Each unnormalized association has a list of
--  discriminant_selector_name elements and an explicit expression.
--
--  A normalized list contains artificial associations representing all
--  explicit associations.  It has a length equal to the number of
--  discriminant_specification elements of the known_discriminant_part.
--  The order of normalized associations matches the order of
--  discriminant_specification elements.
--
--  Each normalized association represents a one on one mapping of a
--  discriminant_specification to the explicit expression.  A normalized
--  association has one A_Defining_Name component that denotes the
--  discriminant_specification, and one An_Expression component that is the
--  explicit expression.
--
--
--  Appropriate Constraint_Kinds:
--       A_Discriminant_Constraint
--
--  Returns Association_Kinds:
--       A_Discriminant_Association
--
--  --|IR Implementation Requirements:
--  --|IR
--  --|IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit.
--  --|IR Normalized associations are never Is_Equal to unnormalized
--  --|IR associations.
--  --|IR
--  --|IP Implementation Permissions:
--  --|IP
--  --|IP An implementation may choose to normalize its internal representation
--  --|IP to use the defining_identifier element instead of the
--  --|IP discriminant_selector_name element.
--  --|IP
--  --|IP If so, this query will return Is_Normalized associations even if
--  --|IP Normalized is False, and the query
--  --|IP Discriminant_Associations_Normalized will return True.
--  --|IP
--  --|AN Application Note:
--  --|AN
--  --|AN It is not possible to obtain either a normalized or unnormalized
--  --|AN Discriminant_Association list for an unconstrained record or derived
--  --|AN subtype_indication where the discriminant_association elements are
--  --|AN by default; there is no constraint to query, and a Nil_Element is
--  --|AN supplied returned from the query Subtype_Constraint.
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Component_Definition - 3.6
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Component_Subtype_Indication
--
------------------------------------------------------------------------------
--  16.28 function Component_Subtype_Indication
------------------------------------------------------------------------------

   function Component_Subtype_Indication
     (Component_Definition : Asis.Component_Definition)
      return                 Asis.Subtype_Indication;

------------------------------------------------------------------------------
--  Component_Definition - Specifies the Component_Definition to query
--
--  Returns the subtype_indication of the Component_Definition.
--
--  --|A2005 start
--  --|D2005 start

--  In ASIS 2005 this query is an obsolescent feature, it should not be used
--  for analyzing Ada 2005 code. We need a proper warning note in the ASIS
--  Standard. The problem here that the name of the query requires to return
--  namely a subtype indication, but in Ada 2005 we may also return
--  access_defintion. See proposal in next section.

--  This query should be kept as is because of upward compatibility reasons

--  --|D2005 end
--  --|A2005 end
--  Appropriate Definition_Kinds:
--       A_Component_Definition
--
--  Returns Definition_Kinds:
--       A_Subtype_Indication
--
--  --|A2005 start
------------------------------------------------------------------------------
--  16.#??? function Component_Definition_View
------------------------------------------------------------------------------

   function Component_Definition_View
     (Component_Definition : Asis.Component_Definition)
      return                 Asis.Definition;

--  --|D2005 start
--  Is it a good name for the query?
--  --|D2005 end

------------------------------------------------------------------------------
--  Component_Definition - Specifies the Component_Definition to query
--
--  Returns the subtype_indication or access_definition of the
--  Component_Definition.
--
--  Appropriate Definition_Kinds:
--       A_Component_Definition
--
--  Returns Definition_Kinds:
--       A_Subtype_Indication
--       An_Access_Definition
--
--  --|A2005 end

--  --|ER---------------------------------------------------------------------
--  --|ER A_Discrete_Subtype_Definition - 3.6
--  --|ER A_Discrete_Range - 3.6.1
--  --|ER
--  --|ER A_Discrete_Subtype_Indication
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Subtype_Mark
--  --|CR    function Subtype_Constraint
--  --|CR
--  --|CR A_Discrete_Simple_Expression_Range
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Lower_Bound
--  --|CR    function Upper_Bound
--  --|ER
--  --|ER---------------------------------------------------------------------
--  --|ER A_Discrete_Range_Attribute_Reference - 3.5
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Range_Attribute
--  --|ER---------------------------------------------------------------------
--  --|ER An_Unknown_Discriminant_Part - 3.7 - No child elements
--  --|ER---------------------------------------------------------------------
--  --|ER A_Known_Discriminant_Part - 3.7
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discriminants
--

------------------------------------------------------------------------------
--  16.29 function Discriminants
------------------------------------------------------------------------------

   function Discriminants
     (Definition : Asis.Definition)
      return       Asis.Discriminant_Specification_List;

------------------------------------------------------------------------------
--  Definition - Specifies the known_discriminant_part to query
--
--  Returns a list of discriminant_specification elements, in their order of
--  appearance.
--
--  Results of this query may vary across ASIS implementations. Some
--  implementations normalize all multi-name discriminant_specification
--  elements into an equivalent sequence of single name
--  discriminant_specification elements. See Reference Manual 3.3.1(7).
--
--  Appropriate Definition_Kinds:
--       A_Known_Discriminant_Part
--
--  Returns Declaration_Kinds:
--       A_Discriminant_Specification
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Record_Definition - 3.8
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Record_Components
--  --|CR    function Implicit_Components
--
------------------------------------------------------------------------------
--  16.30 function Record_Components
------------------------------------------------------------------------------

   function Record_Components
     (Definition      : Asis.Definition;
      Include_Pragmas : Boolean := False)
      return            Asis.Record_Component_List;

------------------------------------------------------------------------------
--  Definition - Specifies the record_definition or variant to query
--  Include_Pragmas - Specifies whether pragmas are to be returned
--
--  Returns a list of the components and pragmas of the record_definition or
--  variant, in their order of appearance.
--
--  Declarations are not returned for implementation-defined components of the
--  record_definition. See Reference Manual 13.5.1 (15). These components are
--  not normally visible to the ASIS application. However, they can be obtained
--  with the query Implicit_Components.
--
--  Appropriate Definition_Kinds:
--       A_Record_Definition
--       A_Variant
--
--  Returns Element_Kinds:
--       A_Pragma
--       A_Declaration
--       A_Definition
--       A_Clause
--
--  Returns Declaration_Kinds:
--       A_Component_Declaration
--
--  Returns Definition_Kinds:
--       A_Null_Component
--       A_Variant_Part
--
--  Returns Representation_Clause_Kinds:
--       An_Attribute_Definition_Clause
--

------------------------------------------------------------------------------
--  16.31 function Implicit_Components
------------------------------------------------------------------------------

   function Implicit_Components
     (Definition : Asis.Definition)
      return       Asis.Record_Component_List;

------------------------------------------------------------------------------
--  Definition - Specifies the record_definition or variant to query
--
--  Returns a list of all implicit implementation-defined components of the
--  record_definition or variant.  The Enclosing_Element of each component is
--  the Definition argument.  Each component is Is_Part_Of_Implicit.
--
--  Returns a Nil_Element_List if there are no implicit implementation-defined
--  components or if the ASIS implementation does not support such
--  implicit declarations.
--
--  Appropriate Definition_Kinds:
--       A_Record_Definition
--       A_Variant
--
--  Returns Element_Kinds:
--       A_Declaration
--
--  Returns Declaration_Kinds:
--       A_Component_Declaration
--
--  --|IP Implementation Permissions:
--  --|IP
--  --|IP Some implementations do not represent all forms of implicit
--  --|IP declarations such that elements representing them can be easily
--  --|IP provided.  An implementation can choose whether or not to construct
--  --|IP and provide artificial declarations for implicitly declared elements.
--  --|IP
--  --|IP Use the query Implicit_Components_Supported to determine if the
--  --|IP implementation provides implicit record components.
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Null_Record_Definition - 3.8 - No child elements
--  --|ER---------------------------------------------------------------------
--  --|ER A_Variant_Part - 3.8.1
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discriminant_Direct_Name
--  --|CR    function Variants
--
------------------------------------------------------------------------------
--  16.32 function Discriminant_Direct_Name
------------------------------------------------------------------------------

   function Discriminant_Direct_Name
     (Variant_Part : Asis.Record_Component)
      return         Asis.Name;

------------------------------------------------------------------------------
--  Variant_Part    - Specifies the variant_part to query
--
--  Returns the Discriminant_Direct_Name of the variant_part.
--
--  Appropriate Definition_Kinds:
--       A_Variant_Part
--
--  Returns Expression_Kinds:
--       An_Identifier
--

------------------------------------------------------------------------------
--  16.33 function Variants
------------------------------------------------------------------------------

   function Variants
     (Variant_Part    : Asis.Record_Component;
      Include_Pragmas : Boolean := False)
      return Asis.Variant_List;

------------------------------------------------------------------------------
--   Variant_Part    - Specifies the variant_part to query
--   Include_Pragmas - Specifies whether pragmas are to be returned
--
--  Returns a list of variants that make up the record component, in their
--  order of appearance.
--
--  The only pragmas returned are those following the reserved word "is"
--  and preceding the reserved word "when" of first variant, and those between
--  following variants.
--
--  Appropriate Definition_Kinds:
--       A_Variant_Part
--
--  Returns Element_Kinds:
--       A_Pragma
--       A_Definition
--
--  Returns Definition_Kinds:
--       A_Variant
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Variant - 3.8.1
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Variant_Choices
--  --|CR    function Record_Components
--  --|CR    function Implicit_Components
--
------------------------------------------------------------------------------
--  16.34 function Variant_Choices
------------------------------------------------------------------------------

   function Variant_Choices
     (Variant : Asis.Variant)
      return    Asis.Element_List;

------------------------------------------------------------------------------
--  Variant - Specifies the variant to query
--
--  Returns the discrete_choice_list elements, in their order of appearance.
--  Choices are either an expression, a discrete range, or an others choice.
--
--  Appropriate Definition_Kinds:
--       A_Variant
--
--  Returns Element_Kinds:
--       An_Expression
--       A_Definition
--
--  Returns Definition_Kinds:
--       A_Discrete_Range
--       An_Others_Choice
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Private_Type_Definition - 7.3 - No child elements
--  --|ER A_Tagged_Private_Type_Definition - 7.3 - No child elements
--  --|ER---------------------------------------------------------------------
--  --|ER A_Private_Extension_Definition - 7.3
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Ancestor_Subtype_Indication
--

------------------------------------------------------------------------------
--  --|A2005 start (implemented)
--  16.#??? function Definition_Interface_List
------------------------------------------------------------------------------
   function Definition_Interface_List
      (Type_Definition : Asis.Definition)
       return            Asis.Expression_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the definition to query
--
--  Returns a list of subtype mark names making up the interface_list in the
--  argument definition, in their order of appearance.
--
--  Appropriate Definition_Kinds:
--       A_Private_Extension_Definition
--
--  Appropriate Type_Kinds:
--       A_Derived_Record_Extension_Definition
--       An_Interface_Type_Definition
--
--  Appropriate Formal_Type_Kinds:
--       A_Formal_Derived_Type_Definition
--       A_Formal_Interface_Type_Definition
--
--  Returns Expression_Kinds:
--       An_Identifier
--       A_Selected_Component
--  --|A2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--  16.35 function Ancestor_Subtype_Indication
------------------------------------------------------------------------------

   function Ancestor_Subtype_Indication
     (Definition : Asis.Definition)
      return       Asis.Subtype_Indication;

------------------------------------------------------------------------------
--  Definition - Specifies the definition to query
--
--  Returns the ancestor_subtype_indication following the reserved word "new"
--  in the private_extension_declaration.
--
--  Appropriate Definition_Kinds:
--       A_Private_Extension_Definition
--
--  Returns Definition_Kinds:
--       A_Subtype_Indication
--  --|ER---------------------------------------------------------------------
--  --|ER A_Task_Definition - 9.1
--  --|ER A_Protected_Definition - 9.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Visible_Part_Items
--  --|CR    function Private_Part_Items
--
------------------------------------------------------------------------------
--  16.36 function Visible_Part_Items
------------------------------------------------------------------------------

   function Visible_Part_Items
     (Definition      : Asis.Definition;
      Include_Pragmas : Boolean := False)
      return            Asis.Declarative_Item_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the type_definition to query
--  Include_Pragmas - Specifies whether pragmas are to be returned
--
--  Returns a list of declarations, representation clauses, and pragmas
--  in the visible part of the task or protected definition, in their order
--  of appearance. The list does not include discriminant_specification
--  elements of the known_discriminant_part, if any, of the protected type or
--  task type declaration.
--
--  Returns a Nil_Element_List if there are no items.
--
--  Appropriate Definition_Kinds:
--       A_Task_Definition
--       A_Protected_Definition
--
--  Returns Element_Kinds:
--       A_Pragma
--       A_Declaration
--       A_Clause
--
------------------------------------------------------------------------------
--  16.37 function Private_Part_Items
------------------------------------------------------------------------------

   function Private_Part_Items
     (Definition      : Asis.Definition;
      Include_Pragmas : Boolean := False)
      return            Asis.Declarative_Item_List;

------------------------------------------------------------------------------
--  Type_Definition - Specifies the task type definition to query
--  Include_Pragmas - Specifies whether pragmas are to be returned
--
--  Returns a list of declarations, representation clauses, and pragmas in the
--  private part of the task or protected definition, in their order of
--  appearance.
--
--  Returns a Nil_Element_List if there are no items.
--
--  Appropriate Definition_Kinds:
--       A_Task_Definition
--       A_Protected_Definition
--
--  Returns Element_Kinds:
--       A_Pragma
--       A_Declaration
--       A_Clause
--
------------------------------------------------------------------------------
--  16.38 function Is_Private_Present
------------------------------------------------------------------------------

   function Is_Private_Present
     (Definition : Asis.Definition)
      return       Boolean;

------------------------------------------------------------------------------
--  Definition - Specifies the definition to query
--
--  Returns True if the argument is a task_definition or a protected_definition
--  that has a reserved word "private" marking the beginning of a (possibly
--  empty) private part.
--
--  Returns False for any definition without a private part.
--  Returns False for any unexpected Element.
--
--  Expected Definition_Kinds:
--       A_Task_Definition
--       A_Protected_Definition
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Formal_Type_Definition - 12.5
--  --|ER
--  --|ER A_Formal_Private_Type_Definition         - 12.5.1 - No child elements
--  --|ER A_Formal_Tagged_Private_Type_Definition  - 12.5.1 - No child elements
--  --|ER
--  --|ER A_Formal_Derived_Type_Definition
--  --|CR Child elements returned by:
--  --|CR    function Subtype_Mark
--
--  --|ER---------------------------------------------------------------------
--  --|ER A_Formal_Discrete_Type_Definition        - 12.5.2 - No child elements
--  --|ER A_Formal_Signed_Integer_Type_Definition  - 12.5.2 - No child elements
--  --|ER A_Formal_Modular_Type_Definition         - 12.5.2 - No child elements
--  --|ER A_Formal_Floating_Point_Definition       - 12.5.2 - No child elements
--  --|ER A_Formal_Ordinary_Fixed_Point_Definition - 12.5.2 - No child elements
--  --|ER A_Formal_Decimal_Fixed_Point_Definition  - 12.5.2 - No child elements
--  --|ER---------------------------------------------------------------------
--  --|ER A_Formal_Unconstrained_Array_Definition  - 12.5.3
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Index_Subtype_Definitions
--  --|CR    function Array_Component_Definition
--  --|ER---------------------------------------------------------------------
--  --|ER A_Formal_Constrained_Array_Definition    - 12.5.3
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Discrete_Subtype_Definitions
--  --|CR    function Array_Component_Definition
--  --|ER---------------------------------------------------------------------
--  --|ER A_Formal_Access_Type_Definition          - 12.5.4
--  --|CR
--  --|CR Child elements returned by:
--  --|CR    function Access_To_Object_Definition
--  --|CR    function Access_To_Subprogram_Parameter_Profile
--  --|CR    function Access_To_Function_Result_Profile
--
------------------------------------------------------------------------------

--  --|ASIS2012 start

--  The stuff here should be reordered when the new language standard is
--  stabilized.

   function Aspect_Mark
     (Aspect_Specification : Asis.Element)
      return                Asis.Element;
------------------------------------------------------------------------------
--  Returns the aspect mark from the argument aspect specification
--  Element.
--
--  Appropriate Definition_Kinds:
--        An_Aspect_Specification
--
--  Returns Expression_Kinds:
--        An_Identifier
--        An_Attribute_Reference

   function Aspect_Definition
     (Aspect_Specification : Asis.Element)
      return                Asis.Element;
------------------------------------------------------------------------------
--  Returns the aspect definition expression from the argument aspect
--  specification
--
--  Appropriate Definition_Kinds:
--
--        An_Aspect_Specification
--
--  Returns Element_Kinds:
--
--        An_Expression

--  --|ASIS2012 end

end Asis.Definitions;