~ubuntu-branches/ubuntu/karmic/asis/karmic

« back to all changes in this revision

Viewing changes to asis/asis-statements.ads

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Quinot
  • Date: 2002-03-03 19:55:58 UTC
  • Revision ID: james.westby@ubuntu.com-20020303195558-g7dp4vaq1zdkf814
Tags: upstream-3.14p
ImportĀ upstreamĀ versionĀ 3.14p

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
------------------------------------------------------------------------------
 
2
--                                                                          --
 
3
--                 ASIS-for-GNAT IMPLEMENTATION COMPONENTS                  --
 
4
--                                                                          --
 
5
--                        A S I S . S T A T E M E N T S                     --
 
6
--                                                                          --
 
7
--                                 S p e c                                  --
 
8
--                                                                          --
 
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.                                                       --
 
15
--                                                                          --
 
16
------------------------------------------------------------------------------
 
17
 
 
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
 
20
 
 
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
------------------------------------------------------------------------------
 
34
 
 
35
   function Label_Names
 
36
     (Statement : in Asis.Statement)
 
37
      return Asis.Defining_Name_List;
 
38
 
 
39
------------------------------------------------------------------------------
 
40
--  Statement   - Specifies the statement to query
 
41
--
 
42
--  Returns label_statement_identifier elements (A_Defining_Name elements) that
 
43
--  define the labels attached to the statement, in their order of appearance.
 
44
--
 
45
--  Returns a Nil_Element_List if there are no labels attached to the
 
46
--  statement.
 
47
--
 
48
--  The Enclosing_Element of the A_Defining_Name elements is the statement.
 
49
--
 
50
--  Appropriate Element_Kinds:
 
51
--       A_Statement
 
52
--
 
53
--  Returns Defining_Name_Kinds:
 
54
--       A_Defining_Identifier
 
55
--
 
56
------------------------------------------------------------------------------
 
57
--  18.2  function Assignment_Variable_Name
 
58
------------------------------------------------------------------------------
 
59
 
 
60
   function Assignment_Variable_Name
 
61
     (Statement : in Asis.Statement)
 
62
      return Asis.Expression;
 
63
 
 
64
------------------------------------------------------------------------------
 
65
--  Statement   - Specifies the assignment statement to query
 
66
--
 
67
--  Returns the expression that names the left hand side of the assignment.
 
68
--
 
69
--  Appropriate Element_Kinds:
 
70
--       A_Statement
 
71
--
 
72
--  Appropriate Statement_Kinds:
 
73
--       An_Assignment_Statement
 
74
--
 
75
--  Returns Element_Kinds:
 
76
--       An_Expression
 
77
--
 
78
------------------------------------------------------------------------------
 
79
--  18.3  function Assignment_Expression
 
80
------------------------------------------------------------------------------
 
81
 
 
82
   function Assignment_Expression
 
83
     (Statement : in Asis.Statement)
 
84
      return Asis.Expression;
 
85
 
 
86
------------------------------------------------------------------------------
 
87
--  Statement   - Specifies the assignment statement to query
 
88
--
 
89
--  Returns the expression from the right hand side of the assignment.
 
90
--
 
91
--  Appropriate Element_Kinds:
 
92
--       A_Statement
 
93
--
 
94
 
 
95
--  Appropriate Statement_Kinds:
 
96
--       An_Assignment_Statement
 
97
--
 
98
--  Returns Element_Kinds:
 
99
--       An_Expression
 
100
 
 
101
------------------------------------------------------------------------------
 
102
--  18.4  function Statement_Paths
 
103
------------------------------------------------------------------------------
 
104
 
 
105
   function Statement_Paths
 
106
     (Statement : in Asis.Statement;
 
107
      Include_Pragmas : in Boolean := False)
 
108
      return Asis.Path_List;
 
109
 
 
110
------------------------------------------------------------------------------
 
111
--  Statement   - Specifies the statement to query
 
112
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
113
--
 
114
--  Returns a list of the execution paths of the statement, in
 
115
--  their order of appearance.
 
116
--
 
117
--  The only pragmas returned are those preceding the first alternative in
 
118
--  a case statement.
 
119
--
 
120
--  Appropriate Statement_Kinds:
 
121
--       An_If_Statement
 
122
--       A_Case_Statement
 
123
--       A_Selective_Accept_Statement
 
124
--       A_Timed_Entry_Call_Statement
 
125
--       A_Conditional_Entry_Call_Statement
 
126
--       An_Asynchronous_Select_Statement
 
127
--
 
128
--  Returns Element_Kinds:
 
129
--       A_Path
 
130
--       A_Pragma
 
131
--
 
132
------------------------------------------------------------------------------
 
133
--  18.5  function Condition_Expression
 
134
------------------------------------------------------------------------------
 
135
 
 
136
   function Condition_Expression
 
137
     (Path : in Asis.Path)
 
138
      return Asis.Expression;
 
139
 
 
140
------------------------------------------------------------------------------
 
141
--  Path - Specifies the execution path to query
 
142
--
 
143
--  Returns the condition expression for an IF path or an ELSIF path.
 
144
--
 
145
--  Appropriate Path_Kinds:
 
146
--       An_If_Path
 
147
--       An_Elsif_Path
 
148
--
 
149
--  Returns Element_Kinds:
 
150
--       An_Expression
 
151
--
 
152
------------------------------------------------------------------------------
 
153
--  18.6  function Sequence_Of_Statements
 
154
------------------------------------------------------------------------------
 
155
 
 
156
   function Sequence_Of_Statements
 
157
     (Path            : in Asis.Path;
 
158
      Include_Pragmas : in Boolean := False)
 
159
      return Asis.Statement_List;
 
160
 
 
161
------------------------------------------------------------------------------
 
162
--  Path            - Specifies the execution path to query
 
163
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
164
--
 
165
--  Returns a list of the statements and pragmas from an execution path,
 
166
--  in their order of appearance.
 
167
--
 
168
--  Appropriate Element_Kinds:
 
169
--       A_Path
 
170
--
 
171
--  Returns Element_Kinds:
 
172
--       A_Statement
 
173
--       A_Pragma
 
174
--
 
175
------------------------------------------------------------------------------
 
176
--  18.7  function Case_Expression
 
177
------------------------------------------------------------------------------
 
178
 
 
179
   function Case_Expression
 
180
     (Statement : in Asis.Statement)
 
181
      return Asis.Expression;
 
182
 
 
183
------------------------------------------------------------------------------
 
184
--  Statement   - Specifies the case statement to query
 
185
--
 
186
--  Returns the expression of the case statement that determines which
 
187
--  execution path is taken.
 
188
--
 
189
--  Appropriate Element_Kinds:
 
190
--       A_Statement
 
191
--
 
192
--  Appropriate Statement_Kinds:
 
193
--       A_Case_Statement
 
194
--
 
195
--  Returns Element_Kinds:
 
196
--       An_Expression
 
197
--
 
198
------------------------------------------------------------------------------
 
199
--  18.8  function Case_Statement_Alternative_Choices
 
200
------------------------------------------------------------------------------
 
201
 
 
202
   function Case_Statement_Alternative_Choices
 
203
     (Path : in Asis.Path)
 
204
      return Asis.Element_List;
 
205
 
 
206
------------------------------------------------------------------------------
 
207
--  Path - Specifies the case_statement_alternative execution path to query
 
208
--
 
209
--  Returns a list of the 'when <choice> | <choice>' elements, in their
 
210
--  order of appearance.
 
211
--
 
212
--  Appropriate Path_Kinds:
 
213
--       A_Case_Path
 
214
--
 
215
--  Returns Element_Kinds:
 
216
--       An_Expression
 
217
--       A_Definition
 
218
--
 
219
--  Returns Definition_Kinds:
 
220
--       A_Discrete_Range
 
221
--       An_Others_Choice
 
222
--
 
223
------------------------------------------------------------------------------
 
224
--  18.9  function Statement_Identifier
 
225
------------------------------------------------------------------------------
 
226
 
 
227
   function Statement_Identifier
 
228
     (Statement : in Asis.Statement)
 
229
      return Asis.Defining_Name;
 
230
 
 
231
------------------------------------------------------------------------------
 
232
--  Statement   - Specifies the statement to query
 
233
--
 
234
--  Returns the identifier for the loop_statement or block_statement.
 
235
--
 
236
--  Returns a Nil_Element if the loop has no identifier.
 
237
--
 
238
--  The Enclosing_Element of the name is the statement.
 
239
--
 
240
--  Appropriate Statement_Kinds:
 
241
--       A_Loop_Statement
 
242
--       A_While_Loop_Statement
 
243
--       A_For_Loop_Statement
 
244
--       A_Block_Statement
 
245
--
 
246
--  Returns Defining_Name_Kinds:
 
247
--       Not_A_Defining_Name
 
248
--       A_Defining_Identifier
 
249
--
 
250
------------------------------------------------------------------------------
 
251
--  18.10 function Is_Name_Repeated
 
252
------------------------------------------------------------------------------
 
253
 
 
254
   function Is_Name_Repeated (Statement : in Asis.Statement) return Boolean;
 
255
 
 
256
------------------------------------------------------------------------------
 
257
--  Statement   - Specifies the statement to query
 
258
--
 
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.
 
262
--
 
263
--  Returns False for any unexpected Element.
 
264
--
 
265
--  Expected Statement_Kinds:
 
266
--       A_Block_Statement
 
267
--       A_Loop_Statement
 
268
--       An_Accept_Statement
 
269
--
 
270
------------------------------------------------------------------------------
 
271
--  18.11 function While_Condition
 
272
------------------------------------------------------------------------------
 
273
 
 
274
   function While_Condition
 
275
     (Statement : in Asis.Statement)
 
276
      return Asis.Expression;
 
277
 
 
278
------------------------------------------------------------------------------
 
279
--  Statement   - Specifies the loop statement to query
 
280
--
 
281
--  Returns the condition expression associated with the while loop.
 
282
--
 
283
--  Appropriate Element_Kinds:
 
284
--       A_Statement
 
285
--
 
286
--  Appropriate Statement_Kinds:
 
287
--       A_While_Loop_Statement
 
288
--
 
289
--  Returns Element_Kinds:
 
290
--       An_Expression
 
291
--
 
292
------------------------------------------------------------------------------
 
293
--  18.12 function For_Loop_Parameter_Specification
 
294
------------------------------------------------------------------------------
 
295
 
 
296
   function For_Loop_Parameter_Specification
 
297
     (Statement : in Asis.Statement)
 
298
      return Asis.Declaration;
 
299
 
 
300
------------------------------------------------------------------------------
 
301
--  Statement   - Specifies the loop statement to query
 
302
--
 
303
--  Returns the declaration of the A_Loop_Parameter_Specification.
 
304
--
 
305
--  Appropriate Statement_Kinds:
 
306
--       A_For_Loop_Statement
 
307
--
 
308
--  Returns Declaration_Kinds:
 
309
--       A_Loop_Parameter_Specification
 
310
--
 
311
 
 
312
------------------------------------------------------------------------------
 
313
--  18.13 function Loop_Statements
 
314
------------------------------------------------------------------------------
 
315
 
 
316
   function Loop_Statements
 
317
     (Statement       : in Asis.Statement;
 
318
      Include_Pragmas : in Boolean := False)
 
319
      return Asis.Statement_List;
 
320
 
 
321
------------------------------------------------------------------------------
 
322
--  Statement       - Specifies the loop statement to query
 
323
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
324
--
 
325
--  Returns the sequence_of_statements and any pragmas from the loop_statement,
 
326
--  in their order of appearance.
 
327
--
 
328
--  Appropriate Statement_Kinds:
 
329
--       A_Loop_Statement
 
330
--       A_While_Loop_Statement
 
331
--       A_For_Loop_Statement
 
332
--
 
333
--  Returns Element_Kinds:
 
334
--       A_Pragma
 
335
--       A_Statement
 
336
--
 
337
------------------------------------------------------------------------------
 
338
--  18.14 function Is_Declare_Block
 
339
------------------------------------------------------------------------------
 
340
 
 
341
   function Is_Declare_Block (Statement : in Asis.Statement) return Boolean;
 
342
 
 
343
------------------------------------------------------------------------------
 
344
--  Statement   - Specifies the statement to query
 
345
--
 
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.
 
349
--
 
350
--  Returns False if the "declare" reserved word does not appear in the
 
351
--  block_statement, or for any unexpected Element.
 
352
--
 
353
--  Expected Statement_Kinds:
 
354
--       A_Block_Statement
 
355
--
 
356
------------------------------------------------------------------------------
 
357
--  18.15 function Block_Declarative_Items
 
358
------------------------------------------------------------------------------
 
359
 
 
360
   function Block_Declarative_Items
 
361
     (Statement       : in Asis.Statement;
 
362
      Include_Pragmas : in Boolean := False)
 
363
      return Asis.Declarative_Item_List;
 
364
 
 
365
------------------------------------------------------------------------------
 
366
--  Statement       - Specifies the block statement to query
 
367
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
368
--
 
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.
 
372
--
 
373
--  Returns a Nil_Element_List if there are no declarative items.
 
374
--
 
375
--  Appropriate Statement_Kinds:
 
376
--       A_Block_Statement
 
377
--
 
378
--  Returns Element_Kinds:
 
379
--       A_Declaration
 
380
--       A_Pragma
 
381
--       A_Clause
 
382
--
 
383
 
 
384
------------------------------------------------------------------------------
 
385
--  18.16 function Block_Statements
 
386
------------------------------------------------------------------------------
 
387
 
 
388
   function Block_Statements
 
389
     (Statement       : in Asis.Statement;
 
390
      Include_Pragmas : in Boolean := False)
 
391
      return Asis.Statement_List;
 
392
 
 
393
------------------------------------------------------------------------------
 
394
--  Statement       - Specifies the block statement to query
 
395
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
396
--
 
397
--  Returns a list of the statements and pragmas for the block_statement, in
 
398
--  their order of appearance.
 
399
--
 
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.
 
404
--
 
405
--  Appropriate Statement_Kinds:
 
406
--       A_Block_Statement
 
407
--
 
408
--  Returns Element_Kinds:
 
409
--       A_Pragma
 
410
--       A_Statement
 
411
--
 
412
------------------------------------------------------------------------------
 
413
--  18.17 function Block_Exception_Handlers
 
414
------------------------------------------------------------------------------
 
415
 
 
416
   function Block_Exception_Handlers
 
417
     (Statement : in Asis.Statement;
 
418
      Include_Pragmas : in Boolean := False)
 
419
      return Asis.Exception_Handler_List;
 
420
 
 
421
------------------------------------------------------------------------------
 
422
--  Statement       - Specifies the block statement to query
 
423
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
424
--
 
425
--  Returns a list of the exception_handler elements of the block_statement,
 
426
--  in their order of appearance.
 
427
--
 
428
--  The only pragmas returned are those following the reserved word "exception"
 
429
--  and preceding the reserved word "when" of first exception handler.
 
430
--
 
431
--  Returns a Nil_Element_List if there are no exception_handler elements.
 
432
--
 
433
--  Appropriate Statement_Kinds:
 
434
--       A_Block_Statement
 
435
--
 
436
--  Returns Element_Kinds:
 
437
--       An_Exception_Handler
 
438
--       A_Pragma
 
439
--
 
440
------------------------------------------------------------------------------
 
441
--  18.18 function Exit_Loop_Name
 
442
------------------------------------------------------------------------------
 
443
 
 
444
   function Exit_Loop_Name
 
445
     (Statement : in Asis.Statement)
 
446
      return Asis.Expression;
 
447
 
 
448
------------------------------------------------------------------------------
 
449
--  Statement   - Specifies the exit statement to query
 
450
--
 
451
--  Returns the name of the exited loop.
 
452
--
 
453
--  Returns a Nil_Element if no loop name is present.
 
454
--
 
455
--  Appropriate Statement_Kinds:
 
456
--       An_Exit_Statement
 
457
--
 
458
 
 
459
--  Returns Expression_Kinds:
 
460
--       Not_An_Expression
 
461
--       An_Identifier
 
462
--       A_Selected_Component
 
463
--
 
464
------------------------------------------------------------------------------
 
465
--  18.19 function Exit_Condition
 
466
------------------------------------------------------------------------------
 
467
 
 
468
   function Exit_Condition
 
469
     (Statement : in Asis.Statement)
 
470
      return Asis.Expression;
 
471
 
 
472
------------------------------------------------------------------------------
 
473
--  Statement   - Specifies the exit statement to query
 
474
--
 
475
--  Returns the "when" condition of the exit statement.
 
476
--
 
477
--  Returns a Nil_Element if no condition is present.
 
478
--
 
479
--  Appropriate Statement_Kinds:
 
480
--       An_Exit_Statement
 
481
--
 
482
--  Returns Element_Kinds:
 
483
--       Not_An_Element
 
484
--       An_Expression
 
485
--
 
486
------------------------------------------------------------------------------
 
487
--  18.20 function Corresponding_Loop_Exited
 
488
------------------------------------------------------------------------------
 
489
 
 
490
   function Corresponding_Loop_Exited
 
491
     (Statement : in Asis.Statement)
 
492
      return Asis.Statement;
 
493
 
 
494
------------------------------------------------------------------------------
 
495
--  Statement   - Specifies the exit statement to query
 
496
--
 
497
--  Returns the loop statement exited by the exit statement.
 
498
--
 
499
--  Appropriate Statement_Kinds:
 
500
--       An_Exit_Statement
 
501
--
 
502
--  Returns Element_Kinds:
 
503
--       A_Loop_Statement
 
504
--       A_While_Loop_Statement
 
505
--       A_For_Loop_Statement
 
506
--
 
507
------------------------------------------------------------------------------
 
508
--  18.21 function Return_Expression
 
509
------------------------------------------------------------------------------
 
510
   function Return_Expression
 
511
     (Statement : in Asis.Statement)
 
512
      return Asis.Expression;
 
513
 
 
514
------------------------------------------------------------------------------
 
515
--  Statement   - Specifies the return statement to query
 
516
--
 
517
--  Returns the expression in the return statement.
 
518
--
 
519
--  Returns a Nil_Element if no expression is present.
 
520
--
 
521
--  Appropriate Statement_Kinds:
 
522
--       A_Return_Statement
 
523
--
 
524
--  Returns Element_Kinds:
 
525
--       Not_An_Element
 
526
--       An_Expression
 
527
--
 
528
 
 
529
------------------------------------------------------------------------------
 
530
--  18.22 function Goto_Label
 
531
------------------------------------------------------------------------------
 
532
 
 
533
   function Goto_Label
 
534
     (Statement : in Asis.Statement)
 
535
      return Asis.Expression;
 
536
 
 
537
------------------------------------------------------------------------------
 
538
--  Statement   - Specifies the goto statement to query
 
539
--
 
540
--  Returns the expression reference for the label, as specified by the goto
 
541
--  statement.
 
542
--
 
543
--  Appropriate Statement_Kinds:
 
544
--       A_Goto_Statement
 
545
--
 
546
--  Returns Expression_Kinds:
 
547
--       An_Identifier
 
548
--
 
549
------------------------------------------------------------------------------
 
550
--  18.23 function Corresponding_Destination_Statement
 
551
------------------------------------------------------------------------------
 
552
 
 
553
   function Corresponding_Destination_Statement
 
554
     (Statement : in Asis.Statement)
 
555
      return Asis.Statement;
 
556
 
 
557
------------------------------------------------------------------------------
 
558
--  Statement  - Specifies the goto statement to query
 
559
--
 
560
--  Returns the target statement specified by the goto statement.
 
561
--
 
562
--  Appropriate Statement_Kinds:
 
563
--       A_Goto_Statement
 
564
--
 
565
--  Returns Element_Kinds:
 
566
--       A_Statement
 
567
--
 
568
--  --|AN Application Note:
 
569
--  --|AN
 
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.
 
577
--
 
578
------------------------------------------------------------------------------
 
579
--  18.24 function Called_Name
 
580
------------------------------------------------------------------------------
 
581
 
 
582
   function Called_Name
 
583
     (Statement : in Asis.Statement)
 
584
      return Asis.Expression;
 
585
 
 
586
------------------------------------------------------------------------------
 
587
--  Statement   - Specifies the procedure call or entry call statement to query
 
588
--
 
589
--  Returns the name of the called procedure or entry.  The name of an entry
 
590
--  family takes the form of An_Indexed_Component.
 
591
--
 
592
--  Appropriate Statement_Kinds:
 
593
--       An_Entry_Call_Statement
 
594
--       A_Procedure_Call_Statement
 
595
--
 
596
--  Returns Element_Kinds:
 
597
--       An_Expression
 
598
--
 
599
 
 
600
------------------------------------------------------------------------------
 
601
--  18.25 function Corresponding_Called_Entity
 
602
------------------------------------------------------------------------------
 
603
 
 
604
   function Corresponding_Called_Entity
 
605
     (Statement : in Asis.Statement)
 
606
      return Asis.Declaration;
 
607
 
 
608
------------------------------------------------------------------------------
 
609
--  Statement   - Specifies the procedure_call_statement or
 
610
--                entry_call_statement to query
 
611
--
 
612
--  Returns the declaration of the procedure or entry denoted by the call.
 
613
--
 
614
--  Returns a Nil_Element if the:
 
615
--
 
616
--   - prefix of the call denotes an access to a procedure implicit
 
617
--     or explicit dereference,
 
618
--
 
619
--   - argument is a dispatching call,
 
620
--
 
621
--   - argument is a call to a dispatching operation of a tagged type which
 
622
--     is not statically determined.
 
623
--
 
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.
 
632
--
 
633
--  Appropriate Statement_Kinds:
 
634
--       An_Entry_Call_Statement
 
635
--       A_Procedure_Call_Statement
 
636
--
 
637
--  Returns Declaration_Kinds:
 
638
--       Not_A_Declaration
 
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
 
647
--
 
648
--  --|IP Implementation Permissions
 
649
--  --|IP
 
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:
 
653
--  --|IP
 
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.
 
661
--  --|IP
 
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.
 
666
--
 
667
 
 
668
------------------------------------------------------------------------------
 
669
--  18.26 function Call_Statement_Parameters
 
670
------------------------------------------------------------------------------
 
671
 
 
672
   function Call_Statement_Parameters
 
673
     (Statement  : in Asis.Statement;
 
674
      Normalized : in Boolean := False)
 
675
      return Asis.Association_List;
 
676
 
 
677
------------------------------------------------------------------------------
 
678
--  Statement   - Specifies the procedure_call_statement or
 
679
--                entry_call_statement to query
 
680
--  Normalized  - Specifies whether the normalized form is desired
 
681
--
 
682
--  Returns a list of parameter_association elements of the call.
 
683
--
 
684
--  Returns a Nil_Element_List if there are no parameter_association elements.
 
685
--
 
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.
 
689
--
 
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.
 
695
--
 
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.
 
701
--
 
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.
 
706
--
 
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.
 
710
--
 
711
--  The exception ASIS_Inappropriate_Element is raised when the procedure
 
712
--  call is an attribute reference and Is_Normalized is True.
 
713
--
 
714
--  Appropriate Statement_Kinds:
 
715
--       An_Entry_Call_Statement
 
716
--       A_Procedure_Call_Statement
 
717
--
 
718
--  Returns Element_Kinds:
 
719
--       A_Parameter_Association
 
720
--
 
721
--  --|IR Implementation Requirements:
 
722
--  --|IR
 
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.
 
727
--  --|IR
 
728
--  --|IP Implementation Permissions:
 
729
--  --|IP
 
730
--  --|IP An implementation may choose to always include default parameters in
 
731
--  --|IP its internal representation.
 
732
--  --|IP
 
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.
 
736
--  --|IP
 
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.
 
740
--
 
741
 
 
742
------------------------------------------------------------------------------
 
743
--  18.27 function Accept_Entry_Index
 
744
------------------------------------------------------------------------------
 
745
 
 
746
   function Accept_Entry_Index
 
747
     (Statement : in Asis.Statement)
 
748
      return Asis.Expression;
 
749
 
 
750
------------------------------------------------------------------------------
 
751
--  Statement   - Specifies the accept statement to query
 
752
--
 
753
--  Returns the entry index expression in the accept statement.
 
754
--
 
755
--  Returns a Nil_Element if the statement has no explicit entry index,
 
756
--
 
757
--  Appropriate Statement_Kinds:
 
758
--       An_Accept_Statement
 
759
--
 
760
--  Returns Element_Kinds:
 
761
--       Not_An_Element
 
762
--       An_Expression
 
763
--
 
764
------------------------------------------------------------------------------
 
765
--  18.28 function Accept_Entry_Direct_Name
 
766
------------------------------------------------------------------------------
 
767
 
 
768
   function Accept_Entry_Direct_Name
 
769
     (Statement : in Asis.Statement)
 
770
      return Asis.Name;
 
771
 
 
772
------------------------------------------------------------------------------
 
773
--  Statement   - Specifies the accept statement to query
 
774
--
 
775
--  Returns the direct name of the entry. The name follows the reserved word
 
776
--  "accept".
 
777
--
 
778
--  Appropriate Statement_Kinds:
 
779
--       An_Accept_Statement
 
780
--
 
781
--  Returns Expression_Kinds:
 
782
--       An_Identifier
 
783
--
 
784
------------------------------------------------------------------------------
 
785
--  18.29 function Accept_Parameters
 
786
------------------------------------------------------------------------------
 
787
 
 
788
   function Accept_Parameters
 
789
     (Statement : in Asis.Statement)
 
790
      return Asis.Parameter_Specification_List;
 
791
 
 
792
------------------------------------------------------------------------------
 
793
--  Statement   - Specifies the accept statement to query
 
794
--
 
795
--  Returns a list of parameter specifications in the formal part of the accept
 
796
--  statement, in their order of appearance.
 
797
--
 
798
--  Returns a Nil_Element_List if the accept_statement has no parameters.
 
799
--
 
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).
 
804
--
 
805
--  Appropriate Statement_Kinds:
 
806
--       An_Accept_Statement
 
807
--
 
808
--  Returns Declaration_Kinds:
 
809
--       A_Parameter_Specification
 
810
--
 
811
 
 
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;
 
819
 
 
820
------------------------------------------------------------------------------
 
821
--  Statement       - Specifies the accept statement to query
 
822
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
823
--
 
824
--  Returns the list of statements and pragmas from the body of the accept
 
825
--  statement, in their order of appearance.
 
826
--
 
827
--  Appropriate Statement_Kinds:
 
828
--       An_Accept_Statement
 
829
--
 
830
--  Returns Element_Kinds:
 
831
--       A_Pragma
 
832
--       A_Statement
 
833
--
 
834
------------------------------------------------------------------------------
 
835
--  18.31 function Accept_Body_Exception_Handlers
 
836
------------------------------------------------------------------------------
 
837
 
 
838
   function Accept_Body_Exception_Handlers
 
839
     (Statement       : in Asis.Statement;
 
840
      Include_Pragmas : in Boolean := False)
 
841
      return Asis.Statement_List;
 
842
 
 
843
------------------------------------------------------------------------------
 
844
--  Statement       - Specifies the accept statement to query
 
845
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
846
--
 
847
--  Returns the list of exception handlers and pragmas from the body of the
 
848
--  accept statement, in their order of appearance.
 
849
--
 
850
--  Appropriate Statement_Kinds:
 
851
--       An_Accept_Statement
 
852
--
 
853
--  Returns Element_Kinds:
 
854
--       A_Pragma
 
855
--       An_Exception_Handler
 
856
--
 
857
------------------------------------------------------------------------------
 
858
--  18.32 function Corresponding_Entry
 
859
------------------------------------------------------------------------------
 
860
 
 
861
   function Corresponding_Entry
 
862
     (Statement : in Asis.Statement)
 
863
      return Asis.Declaration;
 
864
 
 
865
------------------------------------------------------------------------------
 
866
--  Statement   - Specifies the accept statement to query
 
867
--
 
868
--  Returns the declaration of the entry accepted in this statement.
 
869
--
 
870
--  Appropriate Statement_Kinds:
 
871
--       An_Accept_Statement
 
872
--
 
873
--  Returns Declaration_Kinds:
 
874
--       An_Entry_Declaration
 
875
--
 
876
 
 
877
------------------------------------------------------------------------------
 
878
--  18.33 function Requeue_Entry_Name
 
879
------------------------------------------------------------------------------
 
880
 
 
881
   function Requeue_Entry_Name
 
882
     (Statement : in Asis.Statement)
 
883
      return Asis.Name;
 
884
 
 
885
------------------------------------------------------------------------------
 
886
--  Statement   - Specifies the requeue statement to query
 
887
--
 
888
--  Returns the entry name following the reserved word "accept".  The name of
 
889
--  an entry family takes the form of An_Indexed_Component.
 
890
--
 
891
--  Appropriate Statement_Kinds:
 
892
--       A_Requeue_Statement
 
893
--       A_Requeue_Statement_With_Abort
 
894
--
 
895
--  Returns Element_Kinds:
 
896
--       An_Expression
 
897
--
 
898
------------------------------------------------------------------------------
 
899
--  18.34 function Delay_Expression
 
900
------------------------------------------------------------------------------
 
901
 
 
902
   function Delay_Expression
 
903
     (Statement : in Asis.Statement)
 
904
      return Asis.Expression;
 
905
 
 
906
------------------------------------------------------------------------------
 
907
--  Statement   - Specifies the delay statement to query
 
908
--
 
909
--  Returns the expression for the duration of the delay.
 
910
--
 
911
--  Appropriate Statement_Kinds:
 
912
--       A_Delay_Until_Statement
 
913
--       A_Delay_Relative_Statement
 
914
--
 
915
--  Returns Element_Kinds:
 
916
--       An_Expression
 
917
--
 
918
------------------------------------------------------------------------------
 
919
--  18.35 function Guard
 
920
------------------------------------------------------------------------------
 
921
 
 
922
   function Guard (Path : in Asis.Path) return Asis.Expression;
 
923
 
 
924
------------------------------------------------------------------------------
 
925
--  Path - Specifies the select statement execution path to query
 
926
--
 
927
--  Returns the conditional expression guard for the path.
 
928
--
 
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.
 
932
--
 
933
--  Appropriate Path_Kinds:
 
934
--       A_Select_Path
 
935
--       An_Or_Path
 
936
--
 
937
--  Returns Element_Kinds:
 
938
--       Not_An_Element
 
939
--       An_Expression
 
940
--
 
941
 
 
942
------------------------------------------------------------------------------
 
943
--  18.36 function Aborted_Tasks
 
944
------------------------------------------------------------------------------
 
945
 
 
946
   function Aborted_Tasks
 
947
     (Statement : in Asis.Statement)
 
948
      return Asis.Expression_List;
 
949
 
 
950
------------------------------------------------------------------------------
 
951
--  Statement    - Specifies the abort statement to query
 
952
--
 
953
--  Returns a list of the task names from the ABORT statement, in their order
 
954
--  of appearance.
 
955
--
 
956
--  Appropriate Statement_Kinds:
 
957
--       An_Abort_Statement
 
958
--
 
959
--  Returns Element_Kinds:
 
960
--       An_Expression
 
961
--
 
962
------------------------------------------------------------------------------
 
963
--  18.37 function Choice_Parameter_Specification
 
964
------------------------------------------------------------------------------
 
965
 
 
966
   function Choice_Parameter_Specification
 
967
     (Handler : in Asis.Exception_Handler)
 
968
      return Asis.Declaration;
 
969
 
 
970
------------------------------------------------------------------------------
 
971
--  Handler - Specifies the exception handler to query
 
972
--
 
973
--  Returns the choice parameter specification following the reserved word
 
974
--  "when" in the exception handler.
 
975
--
 
976
--  Returns a Nil_Element if there is no explicit choice parameter.
 
977
--
 
978
--  Appropriate Element_Kinds:
 
979
--     An_Exception_Handler
 
980
--
 
981
--  Returns Declaration_Kinds:
 
982
--       Not_A_Declaration
 
983
--       A_Choice_Parameter_Specification
 
984
--
 
985
------------------------------------------------------------------------------
 
986
--  18.38 function Exception_Choices
 
987
------------------------------------------------------------------------------
 
988
 
 
989
   function Exception_Choices
 
990
     (Handler : in Asis.Exception_Handler)
 
991
      return Asis.Element_List;
 
992
 
 
993
------------------------------------------------------------------------------
 
994
--  Handler - Specifies the exception handler to query
 
995
--
 
996
--  Returns a list of the 'when <choice> | <choice>' elements, in their
 
997
--  order of appearance.  Choices are either the exception name expression or
 
998
--  an others choice.
 
999
--
 
1000
--  Appropriate Element_Kinds:
 
1001
--     An_Exception_Handler
 
1002
--
 
1003
--  Returns Expression_Kinds:
 
1004
--       An_Identifier
 
1005
--       A_Selected_Component
 
1006
--
 
1007
--  Returns Definition_Kinds:
 
1008
--       An_Others_Choice
 
1009
--
 
1010
 
 
1011
------------------------------------------------------------------------------
 
1012
--  18.39 function Handler_Statements
 
1013
------------------------------------------------------------------------------
 
1014
 
 
1015
   function Handler_Statements
 
1016
     (Handler         : in Asis.Exception_Handler;
 
1017
      Include_Pragmas : in Boolean := False)
 
1018
      return Asis.Statement_List;
 
1019
 
 
1020
------------------------------------------------------------------------------
 
1021
--  Handler         - Specifies the exception handler to query
 
1022
--  Include_Pragmas - Specifies whether pragmas are to be returned
 
1023
--
 
1024
--  Returns the list of statements and pragmas from the body of the
 
1025
--  exception handler, in their order of appearance.
 
1026
--
 
1027
--  Appropriate Element_Kinds:
 
1028
--     An_Exception_Handler
 
1029
--
 
1030
--  Returns Element_Kinds:
 
1031
--       A_Pragma
 
1032
--       A_Statement
 
1033
--
 
1034
------------------------------------------------------------------------------
 
1035
--  18.40 function Raised_Exception
 
1036
------------------------------------------------------------------------------
 
1037
 
 
1038
   function Raised_Exception
 
1039
      (Statement : in Asis.Statement)
 
1040
       return Asis.Expression;
 
1041
 
 
1042
------------------------------------------------------------------------------
 
1043
--  Statement - Specifies the raise statement to query
 
1044
--
 
1045
--  Returns the expression that names the raised exception.
 
1046
--
 
1047
--  Returns a Nil_Element if there is no explicitly named exception.
 
1048
--
 
1049
--  Appropriate Statement_Kinds:
 
1050
--       A_Raise_Statement
 
1051
--
 
1052
--  Returns Expression_Kinds:
 
1053
--       Not_An_Expression
 
1054
--       An_Identifier
 
1055
--       A_Selected_Component
 
1056
--
 
1057
------------------------------------------------------------------------------
 
1058
--  18.41 function Qualified_Expression
 
1059
------------------------------------------------------------------------------
 
1060
 
 
1061
   function Qualified_Expression
 
1062
     (Statement : in Asis.Statement)
 
1063
      return Asis.Expression;
 
1064
 
 
1065
------------------------------------------------------------------------------
 
1066
--  Statement  - Specifies the code statement to query
 
1067
--
 
1068
--  Returns the qualified aggregate expression representing the code statement.
 
1069
--
 
1070
--  Appropriate Statement_Kinds:
 
1071
--       A_Code_Statement
 
1072
--
 
1073
--  Returns Expression_Kinds:
 
1074
--       A_Qualified_Expression
 
1075
--
 
1076
 
 
1077
------------------------------------------------------------------------------
 
1078
--  18.42        function Is_Dispatching_Call
 
1079
------------------------------------------------------------------------------
 
1080
 
 
1081
   function Is_Dispatching_Call (Call : in Asis.Element) return Boolean;
 
1082
 
 
1083
------------------------------------------------------------------------------
 
1084
--  Call - Specifies the element to query.
 
1085
--
 
1086
--  Returns True if the controlling tag of Call is dynamically determined.
 
1087
--
 
1088
--  This function shall always return False when pragma
 
1089
--  Restrictions (No_Dispatch) applies.
 
1090
--
 
1091
--  Returns False for any unexpected Element.
 
1092
--
 
1093
--  Expected Element_Kinds:
 
1094
--     A_Function_Call
 
1095
--     A_Procedure_Call_Statement
 
1096
--
 
1097
------------------------------------------------------------------------------
 
1098
--  18.43        function Is_Call_On_Dispatching_Operation
 
1099
------------------------------------------------------------------------------
 
1100
 
 
1101
   function Is_Call_On_Dispatching_Operation
 
1102
     (Call : in Asis.Element)
 
1103
      return Boolean;
 
1104
 
 
1105
------------------------------------------------------------------------------
 
1106
--  Call - Specifies the element to query.
 
1107
--
 
1108
--  Returns True if the name or prefix of Call denotes the declaration of a
 
1109
--  primitive operation of a tagged type.
 
1110
--
 
1111
--  Returns False for any unexpected Element.
 
1112
--
 
1113
--  Expected Element_Kinds:
 
1114
--     A_Function_Call
 
1115
--     A_Procedure_Call_Statement
 
1116
--
 
1117
------------------------------------------------------------------------------
 
1118
 
 
1119
end Asis.Statements;
 
 
b'\\ No newline at end of file'