1
------------------------------------------------------------------------------
3
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
5
-- A S I S . S T A T E M E N T S --
9
-- This specification is adapted from the Ada Semantic Interface --
10
-- Specification (ASIS) definition, ISO/IEC 15291, Working Draft. In --
11
-- accordance with the (expected) copyright of the ASIS definition, you can --
12
-- freely copy and modify this specification, provided that if you --
13
-- redistribute a modified version, any changes that you have made are --
14
-- clearly indicated. --
16
------------------------------------------------------------------------------
18
-- The content of this specification is taken "as is" from ASIS 2.0.R.
19
-- The code is reformatted to follow the GNAT coding style rules
21
------------------------------------------------------------------------------
22
-- 18 package Asis.Statements
23
------------------------------------------------------------------------------
24
------------------------------------------------------------------------------
25
package Asis.Statements is
26
------------------------------------------------------------------------------
27
------------------------------------------------------------------------------
28
-- Asis.Statements encapsulates a set of queries that operate on A_Statement,
29
-- A_Path, and An_Exception_Handler elements.
30
------------------------------------------------------------------------------
31
------------------------------------------------------------------------------
32
-- 18.1 function Label_Names
33
------------------------------------------------------------------------------
36
(Statement : in Asis.Statement)
37
return Asis.Defining_Name_List;
39
------------------------------------------------------------------------------
40
-- Statement - Specifies the statement to query
42
-- Returns label_statement_identifier elements (A_Defining_Name elements) that
43
-- define the labels attached to the statement, in their order of appearance.
45
-- Returns a Nil_Element_List if there are no labels attached to the
48
-- The Enclosing_Element of the A_Defining_Name elements is the statement.
50
-- Appropriate Element_Kinds:
53
-- Returns Defining_Name_Kinds:
54
-- A_Defining_Identifier
56
------------------------------------------------------------------------------
57
-- 18.2 function Assignment_Variable_Name
58
------------------------------------------------------------------------------
60
function Assignment_Variable_Name
61
(Statement : in Asis.Statement)
62
return Asis.Expression;
64
------------------------------------------------------------------------------
65
-- Statement - Specifies the assignment statement to query
67
-- Returns the expression that names the left hand side of the assignment.
69
-- Appropriate Element_Kinds:
72
-- Appropriate Statement_Kinds:
73
-- An_Assignment_Statement
75
-- Returns Element_Kinds:
78
------------------------------------------------------------------------------
79
-- 18.3 function Assignment_Expression
80
------------------------------------------------------------------------------
82
function Assignment_Expression
83
(Statement : in Asis.Statement)
84
return Asis.Expression;
86
------------------------------------------------------------------------------
87
-- Statement - Specifies the assignment statement to query
89
-- Returns the expression from the right hand side of the assignment.
91
-- Appropriate Element_Kinds:
95
-- Appropriate Statement_Kinds:
96
-- An_Assignment_Statement
98
-- Returns Element_Kinds:
101
------------------------------------------------------------------------------
102
-- 18.4 function Statement_Paths
103
------------------------------------------------------------------------------
105
function Statement_Paths
106
(Statement : in Asis.Statement;
107
Include_Pragmas : in Boolean := False)
108
return Asis.Path_List;
110
------------------------------------------------------------------------------
111
-- Statement - Specifies the statement to query
112
-- Include_Pragmas - Specifies whether pragmas are to be returned
114
-- Returns a list of the execution paths of the statement, in
115
-- their order of appearance.
117
-- The only pragmas returned are those preceding the first alternative in
120
-- Appropriate Statement_Kinds:
123
-- A_Selective_Accept_Statement
124
-- A_Timed_Entry_Call_Statement
125
-- A_Conditional_Entry_Call_Statement
126
-- An_Asynchronous_Select_Statement
128
-- Returns Element_Kinds:
132
------------------------------------------------------------------------------
133
-- 18.5 function Condition_Expression
134
------------------------------------------------------------------------------
136
function Condition_Expression
137
(Path : in Asis.Path)
138
return Asis.Expression;
140
------------------------------------------------------------------------------
141
-- Path - Specifies the execution path to query
143
-- Returns the condition expression for an IF path or an ELSIF path.
145
-- Appropriate Path_Kinds:
149
-- Returns Element_Kinds:
152
------------------------------------------------------------------------------
153
-- 18.6 function Sequence_Of_Statements
154
------------------------------------------------------------------------------
156
function Sequence_Of_Statements
157
(Path : in Asis.Path;
158
Include_Pragmas : in Boolean := False)
159
return Asis.Statement_List;
161
------------------------------------------------------------------------------
162
-- Path - Specifies the execution path to query
163
-- Include_Pragmas - Specifies whether pragmas are to be returned
165
-- Returns a list of the statements and pragmas from an execution path,
166
-- in their order of appearance.
168
-- Appropriate Element_Kinds:
171
-- Returns Element_Kinds:
175
------------------------------------------------------------------------------
176
-- 18.7 function Case_Expression
177
------------------------------------------------------------------------------
179
function Case_Expression
180
(Statement : in Asis.Statement)
181
return Asis.Expression;
183
------------------------------------------------------------------------------
184
-- Statement - Specifies the case statement to query
186
-- Returns the expression of the case statement that determines which
187
-- execution path is taken.
189
-- Appropriate Element_Kinds:
192
-- Appropriate Statement_Kinds:
195
-- Returns Element_Kinds:
198
------------------------------------------------------------------------------
199
-- 18.8 function Case_Statement_Alternative_Choices
200
------------------------------------------------------------------------------
202
function Case_Statement_Alternative_Choices
203
(Path : in Asis.Path)
204
return Asis.Element_List;
206
------------------------------------------------------------------------------
207
-- Path - Specifies the case_statement_alternative execution path to query
209
-- Returns a list of the 'when <choice> | <choice>' elements, in their
210
-- order of appearance.
212
-- Appropriate Path_Kinds:
215
-- Returns Element_Kinds:
219
-- Returns Definition_Kinds:
223
------------------------------------------------------------------------------
224
-- 18.9 function Statement_Identifier
225
------------------------------------------------------------------------------
227
function Statement_Identifier
228
(Statement : in Asis.Statement)
229
return Asis.Defining_Name;
231
------------------------------------------------------------------------------
232
-- Statement - Specifies the statement to query
234
-- Returns the identifier for the loop_statement or block_statement.
236
-- Returns a Nil_Element if the loop has no identifier.
238
-- The Enclosing_Element of the name is the statement.
240
-- Appropriate Statement_Kinds:
242
-- A_While_Loop_Statement
243
-- A_For_Loop_Statement
246
-- Returns Defining_Name_Kinds:
247
-- Not_A_Defining_Name
248
-- A_Defining_Identifier
250
------------------------------------------------------------------------------
251
-- 18.10 function Is_Name_Repeated
252
------------------------------------------------------------------------------
254
function Is_Name_Repeated (Statement : in Asis.Statement) return Boolean;
256
------------------------------------------------------------------------------
257
-- Statement - Specifies the statement to query
259
-- Returns True if the name of the accept, loop, or block is repeated after
260
-- the end of the statement. Always returns True for loop or block
261
-- statements since the name is required.
263
-- Returns False for any unexpected Element.
265
-- Expected Statement_Kinds:
268
-- An_Accept_Statement
270
------------------------------------------------------------------------------
271
-- 18.11 function While_Condition
272
------------------------------------------------------------------------------
274
function While_Condition
275
(Statement : in Asis.Statement)
276
return Asis.Expression;
278
------------------------------------------------------------------------------
279
-- Statement - Specifies the loop statement to query
281
-- Returns the condition expression associated with the while loop.
283
-- Appropriate Element_Kinds:
286
-- Appropriate Statement_Kinds:
287
-- A_While_Loop_Statement
289
-- Returns Element_Kinds:
292
------------------------------------------------------------------------------
293
-- 18.12 function For_Loop_Parameter_Specification
294
------------------------------------------------------------------------------
296
function For_Loop_Parameter_Specification
297
(Statement : in Asis.Statement)
298
return Asis.Declaration;
300
------------------------------------------------------------------------------
301
-- Statement - Specifies the loop statement to query
303
-- Returns the declaration of the A_Loop_Parameter_Specification.
305
-- Appropriate Statement_Kinds:
306
-- A_For_Loop_Statement
308
-- Returns Declaration_Kinds:
309
-- A_Loop_Parameter_Specification
312
------------------------------------------------------------------------------
313
-- 18.13 function Loop_Statements
314
------------------------------------------------------------------------------
316
function Loop_Statements
317
(Statement : in Asis.Statement;
318
Include_Pragmas : in Boolean := False)
319
return Asis.Statement_List;
321
------------------------------------------------------------------------------
322
-- Statement - Specifies the loop statement to query
323
-- Include_Pragmas - Specifies whether pragmas are to be returned
325
-- Returns the sequence_of_statements and any pragmas from the loop_statement,
326
-- in their order of appearance.
328
-- Appropriate Statement_Kinds:
330
-- A_While_Loop_Statement
331
-- A_For_Loop_Statement
333
-- Returns Element_Kinds:
337
------------------------------------------------------------------------------
338
-- 18.14 function Is_Declare_Block
339
------------------------------------------------------------------------------
341
function Is_Declare_Block (Statement : in Asis.Statement) return Boolean;
343
------------------------------------------------------------------------------
344
-- Statement - Specifies the statement to query
346
-- Returns True if the statement is a block_statement and it was created with
347
-- the use of the "declare" reserved word. The presence or absence of any
348
-- declarative_item elements is not relevant.
350
-- Returns False if the "declare" reserved word does not appear in the
351
-- block_statement, or for any unexpected Element.
353
-- Expected Statement_Kinds:
356
------------------------------------------------------------------------------
357
-- 18.15 function Block_Declarative_Items
358
------------------------------------------------------------------------------
360
function Block_Declarative_Items
361
(Statement : in Asis.Statement;
362
Include_Pragmas : in Boolean := False)
363
return Asis.Declarative_Item_List;
365
------------------------------------------------------------------------------
366
-- Statement - Specifies the block statement to query
367
-- Include_Pragmas - Specifies whether pragmas are to be returned
369
-- Returns a list of the declarations, representation_clause elements,
370
-- pragmas, and use_clause elements in the declarative_part of the
371
-- block_statement, in their order of appearance.
373
-- Returns a Nil_Element_List if there are no declarative items.
375
-- Appropriate Statement_Kinds:
378
-- Returns Element_Kinds:
384
------------------------------------------------------------------------------
385
-- 18.16 function Block_Statements
386
------------------------------------------------------------------------------
388
function Block_Statements
389
(Statement : in Asis.Statement;
390
Include_Pragmas : in Boolean := False)
391
return Asis.Statement_List;
393
------------------------------------------------------------------------------
394
-- Statement - Specifies the block statement to query
395
-- Include_Pragmas - Specifies whether pragmas are to be returned
397
-- Returns a list of the statements and pragmas for the block_statement, in
398
-- their order of appearance.
400
-- Returns a Nil_Element_List if there are no statements or pragmas. This
401
-- can only occur for a block_statement obtained from the obsolescent query
402
-- Body_Block_Statement when its argument is a package_body
403
-- that has no sequence_of_statements.
405
-- Appropriate Statement_Kinds:
408
-- Returns Element_Kinds:
412
------------------------------------------------------------------------------
413
-- 18.17 function Block_Exception_Handlers
414
------------------------------------------------------------------------------
416
function Block_Exception_Handlers
417
(Statement : in Asis.Statement;
418
Include_Pragmas : in Boolean := False)
419
return Asis.Exception_Handler_List;
421
------------------------------------------------------------------------------
422
-- Statement - Specifies the block statement to query
423
-- Include_Pragmas - Specifies whether pragmas are to be returned
425
-- Returns a list of the exception_handler elements of the block_statement,
426
-- in their order of appearance.
428
-- The only pragmas returned are those following the reserved word "exception"
429
-- and preceding the reserved word "when" of first exception handler.
431
-- Returns a Nil_Element_List if there are no exception_handler elements.
433
-- Appropriate Statement_Kinds:
436
-- Returns Element_Kinds:
437
-- An_Exception_Handler
440
------------------------------------------------------------------------------
441
-- 18.18 function Exit_Loop_Name
442
------------------------------------------------------------------------------
444
function Exit_Loop_Name
445
(Statement : in Asis.Statement)
446
return Asis.Expression;
448
------------------------------------------------------------------------------
449
-- Statement - Specifies the exit statement to query
451
-- Returns the name of the exited loop.
453
-- Returns a Nil_Element if no loop name is present.
455
-- Appropriate Statement_Kinds:
459
-- Returns Expression_Kinds:
462
-- A_Selected_Component
464
------------------------------------------------------------------------------
465
-- 18.19 function Exit_Condition
466
------------------------------------------------------------------------------
468
function Exit_Condition
469
(Statement : in Asis.Statement)
470
return Asis.Expression;
472
------------------------------------------------------------------------------
473
-- Statement - Specifies the exit statement to query
475
-- Returns the "when" condition of the exit statement.
477
-- Returns a Nil_Element if no condition is present.
479
-- Appropriate Statement_Kinds:
482
-- Returns Element_Kinds:
486
------------------------------------------------------------------------------
487
-- 18.20 function Corresponding_Loop_Exited
488
------------------------------------------------------------------------------
490
function Corresponding_Loop_Exited
491
(Statement : in Asis.Statement)
492
return Asis.Statement;
494
------------------------------------------------------------------------------
495
-- Statement - Specifies the exit statement to query
497
-- Returns the loop statement exited by the exit statement.
499
-- Appropriate Statement_Kinds:
502
-- Returns Element_Kinds:
504
-- A_While_Loop_Statement
505
-- A_For_Loop_Statement
507
------------------------------------------------------------------------------
508
-- 18.21 function Return_Expression
509
------------------------------------------------------------------------------
510
function Return_Expression
511
(Statement : in Asis.Statement)
512
return Asis.Expression;
514
------------------------------------------------------------------------------
515
-- Statement - Specifies the return statement to query
517
-- Returns the expression in the return statement.
519
-- Returns a Nil_Element if no expression is present.
521
-- Appropriate Statement_Kinds:
522
-- A_Return_Statement
524
-- Returns Element_Kinds:
529
------------------------------------------------------------------------------
530
-- 18.22 function Goto_Label
531
------------------------------------------------------------------------------
534
(Statement : in Asis.Statement)
535
return Asis.Expression;
537
------------------------------------------------------------------------------
538
-- Statement - Specifies the goto statement to query
540
-- Returns the expression reference for the label, as specified by the goto
543
-- Appropriate Statement_Kinds:
546
-- Returns Expression_Kinds:
549
------------------------------------------------------------------------------
550
-- 18.23 function Corresponding_Destination_Statement
551
------------------------------------------------------------------------------
553
function Corresponding_Destination_Statement
554
(Statement : in Asis.Statement)
555
return Asis.Statement;
557
------------------------------------------------------------------------------
558
-- Statement - Specifies the goto statement to query
560
-- Returns the target statement specified by the goto statement.
562
-- Appropriate Statement_Kinds:
565
-- Returns Element_Kinds:
568
-- --|AN Application Note:
570
-- --|AN The Reference Manual allows a pragma between a statement and a label
571
-- --|AN attached to it. If so, when the label is passed as an actual
572
-- --|AN parameter to this query, the query returns the statement, but not
573
-- --|AN the label. The only way for an application to know that there are
574
-- --|AN any pragmas between a statement and its label is to get the spans
575
-- --|AN of these program elements and analyze the orresponding positions in
576
-- --|AN the source text.
578
------------------------------------------------------------------------------
579
-- 18.24 function Called_Name
580
------------------------------------------------------------------------------
583
(Statement : in Asis.Statement)
584
return Asis.Expression;
586
------------------------------------------------------------------------------
587
-- Statement - Specifies the procedure call or entry call statement to query
589
-- Returns the name of the called procedure or entry. The name of an entry
590
-- family takes the form of An_Indexed_Component.
592
-- Appropriate Statement_Kinds:
593
-- An_Entry_Call_Statement
594
-- A_Procedure_Call_Statement
596
-- Returns Element_Kinds:
600
------------------------------------------------------------------------------
601
-- 18.25 function Corresponding_Called_Entity
602
------------------------------------------------------------------------------
604
function Corresponding_Called_Entity
605
(Statement : in Asis.Statement)
606
return Asis.Declaration;
608
------------------------------------------------------------------------------
609
-- Statement - Specifies the procedure_call_statement or
610
-- entry_call_statement to query
612
-- Returns the declaration of the procedure or entry denoted by the call.
614
-- Returns a Nil_Element if the:
616
-- - prefix of the call denotes an access to a procedure implicit
617
-- or explicit dereference,
619
-- - argument is a dispatching call,
621
-- - argument is a call to a dispatching operation of a tagged type which
622
-- is not statically determined.
624
-- If procedure_prefix denotes an attribute_reference, and if
625
-- the corresponding attribute is (re)defined by an attribute definition
626
-- clause, an implementation is encouraged, but not required, to return the
627
-- definition of the corresponding subprogram whose name is used after "use"
628
-- in this attribute definition clause. If an implementation cannot return
629
-- such a subprogram definition, a Nil_Element should be returned. For an
630
-- attribute reference which is not (re)defined by an attribute definition
631
-- clause, a Nil_Element should be returned.
633
-- Appropriate Statement_Kinds:
634
-- An_Entry_Call_Statement
635
-- A_Procedure_Call_Statement
637
-- Returns Declaration_Kinds:
639
-- A_Procedure_Declaration
640
-- A_Procedure_Body_Declaration
641
-- A_Procedure_Body_Stub
642
-- A_Procedure_Renaming_Declaration
643
-- A_Procedure_Instantiation
644
-- A_Formal_Procedure_Declaration
645
-- An_Entry_Declaration
646
-- A_Generic_Procedure_Declaration
648
-- --|IP Implementation Permissions
650
-- --|IP An implementation may choose to return any part of multi-part
651
-- --|IP declarations and definitions. Multi-part declaration/definitions
652
-- --|IP can occur for:
654
-- --|IP - Subprogram specification in package specification, package body,
655
-- --|IP and subunits (is separate);
656
-- --|IP - Entries in package specification, package body, and subunits
657
-- --|IP (is separate);
658
-- --|IP - Private type and full type declarations;
659
-- --|IP - Incomplete type and full type declarations; and
660
-- --|IP - Deferred constant and full constant declarations.
662
-- --|IP No guarantee is made that the element will be the first part or
663
-- --|IP that the determination will be made due to any visibility rules.
664
-- --|IP An application should make its own analysis for each case based
665
-- --|IP on which part is returned.
668
------------------------------------------------------------------------------
669
-- 18.26 function Call_Statement_Parameters
670
------------------------------------------------------------------------------
672
function Call_Statement_Parameters
673
(Statement : in Asis.Statement;
674
Normalized : in Boolean := False)
675
return Asis.Association_List;
677
------------------------------------------------------------------------------
678
-- Statement - Specifies the procedure_call_statement or
679
-- entry_call_statement to query
680
-- Normalized - Specifies whether the normalized form is desired
682
-- Returns a list of parameter_association elements of the call.
684
-- Returns a Nil_Element_List if there are no parameter_association elements.
686
-- An unnormalized list contains only explicit associations ordered as they
687
-- appear in the program text. Each unnormalized association has an optional
688
-- formal_parameter_selector_name and an explicit_actual_parameter component.
690
-- A normalized list contains artificial associations representing all
691
-- explicit and default associations. It has a length equal to the number of
692
-- parameter_specification elements of the formal_part of the
693
-- parameter_and_result_profile. The order of normalized associations matches
694
-- the order of parameter_specification elements.
696
-- Each normalized association represents a one on one mapping of a
697
-- parameter_specification elements to the explicit or default expression.
698
-- A normalized association has one A_Defining_Name component that denotes the
699
-- parameter_specification, and one An_Expression component that is either the
700
-- explicit_actual_parameter or a default_expression.
702
-- If the prefix of the call denotes an access to a procedure implicit or
703
-- explicit deference, normalized associations are constructed on the basis
704
-- of the formal_part of the parameter_profile from the corresponding
705
-- access_to_subprogram definition.
707
-- Returns Nil_Element for normalized associations in the case where
708
-- the called procedure can be determined only dynamically (dispatching
709
-- calls). ASIS cannot produce any meaningful result in this case.
711
-- The exception ASIS_Inappropriate_Element is raised when the procedure
712
-- call is an attribute reference and Is_Normalized is True.
714
-- Appropriate Statement_Kinds:
715
-- An_Entry_Call_Statement
716
-- A_Procedure_Call_Statement
718
-- Returns Element_Kinds:
719
-- A_Parameter_Association
721
-- --|IR Implementation Requirements:
723
-- --|IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit.
724
-- --|IR Normalized associations provided by default are
725
-- --|IR Is_Defaulted_Association. Normalized associations are never
726
-- --|IR Is_Equal to unnormalized associations.
728
-- --|IP Implementation Permissions:
730
-- --|IP An implementation may choose to always include default parameters in
731
-- --|IP its internal representation.
733
-- --|IP An implementation may also choose to normalize its representation
734
-- --|IP to use defining_identifier elements rather than
735
-- --|IP formal_parameter_selector_name elements.
737
-- --|IP In either case, this query will return Is_Normalized associations
738
-- --|IP even if Normalized is False, and the query
739
-- --|IP Call_Statement_Parameters_Normalized will return True.
742
------------------------------------------------------------------------------
743
-- 18.27 function Accept_Entry_Index
744
------------------------------------------------------------------------------
746
function Accept_Entry_Index
747
(Statement : in Asis.Statement)
748
return Asis.Expression;
750
------------------------------------------------------------------------------
751
-- Statement - Specifies the accept statement to query
753
-- Returns the entry index expression in the accept statement.
755
-- Returns a Nil_Element if the statement has no explicit entry index,
757
-- Appropriate Statement_Kinds:
758
-- An_Accept_Statement
760
-- Returns Element_Kinds:
764
------------------------------------------------------------------------------
765
-- 18.28 function Accept_Entry_Direct_Name
766
------------------------------------------------------------------------------
768
function Accept_Entry_Direct_Name
769
(Statement : in Asis.Statement)
772
------------------------------------------------------------------------------
773
-- Statement - Specifies the accept statement to query
775
-- Returns the direct name of the entry. The name follows the reserved word
778
-- Appropriate Statement_Kinds:
779
-- An_Accept_Statement
781
-- Returns Expression_Kinds:
784
------------------------------------------------------------------------------
785
-- 18.29 function Accept_Parameters
786
------------------------------------------------------------------------------
788
function Accept_Parameters
789
(Statement : in Asis.Statement)
790
return Asis.Parameter_Specification_List;
792
------------------------------------------------------------------------------
793
-- Statement - Specifies the accept statement to query
795
-- Returns a list of parameter specifications in the formal part of the accept
796
-- statement, in their order of appearance.
798
-- Returns a Nil_Element_List if the accept_statement has no parameters.
800
-- Results of this query may vary across ASIS implementations. Some
801
-- implementations normalize all multiple name parameter specifications into
802
-- an equivalent sequence of corresponding single name parameter
803
-- specifications. See Reference Manual 3.3.1(7).
805
-- Appropriate Statement_Kinds:
806
-- An_Accept_Statement
808
-- Returns Declaration_Kinds:
809
-- A_Parameter_Specification
812
------------------------------------------------------------------------------
813
-- 18.30 function Accept_Body_Statements
814
------------------------------------------------------------------------------
815
function Accept_Body_Statements
816
(Statement : in Asis.Statement;
817
Include_Pragmas : in Boolean := False)
818
return Asis.Statement_List;
820
------------------------------------------------------------------------------
821
-- Statement - Specifies the accept statement to query
822
-- Include_Pragmas - Specifies whether pragmas are to be returned
824
-- Returns the list of statements and pragmas from the body of the accept
825
-- statement, in their order of appearance.
827
-- Appropriate Statement_Kinds:
828
-- An_Accept_Statement
830
-- Returns Element_Kinds:
834
------------------------------------------------------------------------------
835
-- 18.31 function Accept_Body_Exception_Handlers
836
------------------------------------------------------------------------------
838
function Accept_Body_Exception_Handlers
839
(Statement : in Asis.Statement;
840
Include_Pragmas : in Boolean := False)
841
return Asis.Statement_List;
843
------------------------------------------------------------------------------
844
-- Statement - Specifies the accept statement to query
845
-- Include_Pragmas - Specifies whether pragmas are to be returned
847
-- Returns the list of exception handlers and pragmas from the body of the
848
-- accept statement, in their order of appearance.
850
-- Appropriate Statement_Kinds:
851
-- An_Accept_Statement
853
-- Returns Element_Kinds:
855
-- An_Exception_Handler
857
------------------------------------------------------------------------------
858
-- 18.32 function Corresponding_Entry
859
------------------------------------------------------------------------------
861
function Corresponding_Entry
862
(Statement : in Asis.Statement)
863
return Asis.Declaration;
865
------------------------------------------------------------------------------
866
-- Statement - Specifies the accept statement to query
868
-- Returns the declaration of the entry accepted in this statement.
870
-- Appropriate Statement_Kinds:
871
-- An_Accept_Statement
873
-- Returns Declaration_Kinds:
874
-- An_Entry_Declaration
877
------------------------------------------------------------------------------
878
-- 18.33 function Requeue_Entry_Name
879
------------------------------------------------------------------------------
881
function Requeue_Entry_Name
882
(Statement : in Asis.Statement)
885
------------------------------------------------------------------------------
886
-- Statement - Specifies the requeue statement to query
888
-- Returns the entry name following the reserved word "accept". The name of
889
-- an entry family takes the form of An_Indexed_Component.
891
-- Appropriate Statement_Kinds:
892
-- A_Requeue_Statement
893
-- A_Requeue_Statement_With_Abort
895
-- Returns Element_Kinds:
898
------------------------------------------------------------------------------
899
-- 18.34 function Delay_Expression
900
------------------------------------------------------------------------------
902
function Delay_Expression
903
(Statement : in Asis.Statement)
904
return Asis.Expression;
906
------------------------------------------------------------------------------
907
-- Statement - Specifies the delay statement to query
909
-- Returns the expression for the duration of the delay.
911
-- Appropriate Statement_Kinds:
912
-- A_Delay_Until_Statement
913
-- A_Delay_Relative_Statement
915
-- Returns Element_Kinds:
918
------------------------------------------------------------------------------
919
-- 18.35 function Guard
920
------------------------------------------------------------------------------
922
function Guard (Path : in Asis.Path) return Asis.Expression;
924
------------------------------------------------------------------------------
925
-- Path - Specifies the select statement execution path to query
927
-- Returns the conditional expression guard for the path.
929
-- Returns a Nil_Element if there is no guard, or if the path is from a
930
-- timed_entry_call, a conditional_entry_call, or an asynchronous_select
931
-- statement where a guard is not legal.
933
-- Appropriate Path_Kinds:
937
-- Returns Element_Kinds:
942
------------------------------------------------------------------------------
943
-- 18.36 function Aborted_Tasks
944
------------------------------------------------------------------------------
946
function Aborted_Tasks
947
(Statement : in Asis.Statement)
948
return Asis.Expression_List;
950
------------------------------------------------------------------------------
951
-- Statement - Specifies the abort statement to query
953
-- Returns a list of the task names from the ABORT statement, in their order
956
-- Appropriate Statement_Kinds:
957
-- An_Abort_Statement
959
-- Returns Element_Kinds:
962
------------------------------------------------------------------------------
963
-- 18.37 function Choice_Parameter_Specification
964
------------------------------------------------------------------------------
966
function Choice_Parameter_Specification
967
(Handler : in Asis.Exception_Handler)
968
return Asis.Declaration;
970
------------------------------------------------------------------------------
971
-- Handler - Specifies the exception handler to query
973
-- Returns the choice parameter specification following the reserved word
974
-- "when" in the exception handler.
976
-- Returns a Nil_Element if there is no explicit choice parameter.
978
-- Appropriate Element_Kinds:
979
-- An_Exception_Handler
981
-- Returns Declaration_Kinds:
983
-- A_Choice_Parameter_Specification
985
------------------------------------------------------------------------------
986
-- 18.38 function Exception_Choices
987
------------------------------------------------------------------------------
989
function Exception_Choices
990
(Handler : in Asis.Exception_Handler)
991
return Asis.Element_List;
993
------------------------------------------------------------------------------
994
-- Handler - Specifies the exception handler to query
996
-- Returns a list of the 'when <choice> | <choice>' elements, in their
997
-- order of appearance. Choices are either the exception name expression or
1000
-- Appropriate Element_Kinds:
1001
-- An_Exception_Handler
1003
-- Returns Expression_Kinds:
1005
-- A_Selected_Component
1007
-- Returns Definition_Kinds:
1011
------------------------------------------------------------------------------
1012
-- 18.39 function Handler_Statements
1013
------------------------------------------------------------------------------
1015
function Handler_Statements
1016
(Handler : in Asis.Exception_Handler;
1017
Include_Pragmas : in Boolean := False)
1018
return Asis.Statement_List;
1020
------------------------------------------------------------------------------
1021
-- Handler - Specifies the exception handler to query
1022
-- Include_Pragmas - Specifies whether pragmas are to be returned
1024
-- Returns the list of statements and pragmas from the body of the
1025
-- exception handler, in their order of appearance.
1027
-- Appropriate Element_Kinds:
1028
-- An_Exception_Handler
1030
-- Returns Element_Kinds:
1034
------------------------------------------------------------------------------
1035
-- 18.40 function Raised_Exception
1036
------------------------------------------------------------------------------
1038
function Raised_Exception
1039
(Statement : in Asis.Statement)
1040
return Asis.Expression;
1042
------------------------------------------------------------------------------
1043
-- Statement - Specifies the raise statement to query
1045
-- Returns the expression that names the raised exception.
1047
-- Returns a Nil_Element if there is no explicitly named exception.
1049
-- Appropriate Statement_Kinds:
1050
-- A_Raise_Statement
1052
-- Returns Expression_Kinds:
1053
-- Not_An_Expression
1055
-- A_Selected_Component
1057
------------------------------------------------------------------------------
1058
-- 18.41 function Qualified_Expression
1059
------------------------------------------------------------------------------
1061
function Qualified_Expression
1062
(Statement : in Asis.Statement)
1063
return Asis.Expression;
1065
------------------------------------------------------------------------------
1066
-- Statement - Specifies the code statement to query
1068
-- Returns the qualified aggregate expression representing the code statement.
1070
-- Appropriate Statement_Kinds:
1073
-- Returns Expression_Kinds:
1074
-- A_Qualified_Expression
1077
------------------------------------------------------------------------------
1078
-- 18.42 function Is_Dispatching_Call
1079
------------------------------------------------------------------------------
1081
function Is_Dispatching_Call (Call : in Asis.Element) return Boolean;
1083
------------------------------------------------------------------------------
1084
-- Call - Specifies the element to query.
1086
-- Returns True if the controlling tag of Call is dynamically determined.
1088
-- This function shall always return False when pragma
1089
-- Restrictions (No_Dispatch) applies.
1091
-- Returns False for any unexpected Element.
1093
-- Expected Element_Kinds:
1095
-- A_Procedure_Call_Statement
1097
------------------------------------------------------------------------------
1098
-- 18.43 function Is_Call_On_Dispatching_Operation
1099
------------------------------------------------------------------------------
1101
function Is_Call_On_Dispatching_Operation
1102
(Call : in Asis.Element)
1105
------------------------------------------------------------------------------
1106
-- Call - Specifies the element to query.
1108
-- Returns True if the name or prefix of Call denotes the declaration of a
1109
-- primitive operation of a tagged type.
1111
-- Returns False for any unexpected Element.
1113
-- Expected Element_Kinds:
1115
-- A_Procedure_Call_Statement
1117
------------------------------------------------------------------------------
1119
end Asis.Statements;
b'\\ No newline at end of file'