1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 pragma Style_Checks
(All_Checks
);
28 -- Turn off subprogram order checking, since the routines here are
29 -- generated automatically in order.
32 with Atree
; use Atree
;
33 with Sinfo
; use Sinfo
;
34 with Snames
; use Snames
;
35 with Stand
; use Stand
;
39 function Make_Unused_At_Start
(Sloc
: Source_Ptr
)
42 N
: constant Node_Id
:=
43 New_Node
(N_Unused_At_Start
, Sloc
);
46 end Make_Unused_At_Start
;
48 function Make_Unused_At_End
(Sloc
: Source_Ptr
)
51 N
: constant Node_Id
:=
52 New_Node
(N_Unused_At_End
, Sloc
);
55 end Make_Unused_At_End
;
57 function Make_Identifier
(Sloc
: Source_Ptr
;
61 N
: constant Node_Id
:=
62 New_Node
(N_Identifier
, Sloc
);
68 function Make_Integer_Literal
(Sloc
: Source_Ptr
;
72 N
: constant Node_Id
:=
73 New_Node
(N_Integer_Literal
, Sloc
);
75 Set_Intval
(N
, Intval
);
77 end Make_Integer_Literal
;
79 function Make_Real_Literal
(Sloc
: Source_Ptr
;
83 N
: constant Node_Id
:=
84 New_Node
(N_Real_Literal
, Sloc
);
86 Set_Realval
(N
, Realval
);
88 end Make_Real_Literal
;
90 function Make_Character_Literal
(Sloc
: Source_Ptr
;
92 Char_Literal_Value
: Char_Code
)
95 N
: constant Node_Id
:=
96 New_Node
(N_Character_Literal
, Sloc
);
99 Set_Char_Literal_Value
(N
, Char_Literal_Value
);
101 end Make_Character_Literal
;
103 function Make_String_Literal
(Sloc
: Source_Ptr
;
107 N
: constant Node_Id
:=
108 New_Node
(N_String_Literal
, Sloc
);
110 Set_Strval
(N
, Strval
);
112 end Make_String_Literal
;
114 function Make_Pragma
(Sloc
: Source_Ptr
;
116 Pragma_Argument_Associations
: List_Id
:= No_List
;
117 Debug_Statement
: Node_Id
:= Empty
)
120 N
: constant Node_Id
:=
121 New_Node
(N_Pragma
, Sloc
);
123 Set_Chars
(N
, Chars
);
124 Set_Pragma_Argument_Associations
125 (N
, Pragma_Argument_Associations
);
126 Set_Debug_Statement
(N
, Debug_Statement
);
130 function Make_Pragma_Argument_Association
(Sloc
: Source_Ptr
;
131 Chars
: Name_Id
:= No_Name
;
132 Expression
: Node_Id
)
135 N
: constant Node_Id
:=
136 New_Node
(N_Pragma_Argument_Association
, Sloc
);
138 Set_Chars
(N
, Chars
);
139 Set_Expression
(N
, Expression
);
141 end Make_Pragma_Argument_Association
;
143 function Make_Defining_Identifier
(Sloc
: Source_Ptr
;
147 N
: constant Node_Id
:=
148 New_Entity
(N_Defining_Identifier
, Sloc
);
150 Set_Chars
(N
, Chars
);
152 end Make_Defining_Identifier
;
154 function Make_Full_Type_Declaration
(Sloc
: Source_Ptr
;
155 Defining_Identifier
: Node_Id
;
156 Discriminant_Specifications
: List_Id
:= No_List
;
157 Type_Definition
: Node_Id
)
160 N
: constant Node_Id
:=
161 New_Node
(N_Full_Type_Declaration
, Sloc
);
163 Set_Defining_Identifier
(N
, Defining_Identifier
);
164 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
165 Set_Type_Definition
(N
, Type_Definition
);
167 end Make_Full_Type_Declaration
;
169 function Make_Subtype_Declaration
(Sloc
: Source_Ptr
;
170 Defining_Identifier
: Node_Id
;
171 Subtype_Indication
: Node_Id
)
174 N
: constant Node_Id
:=
175 New_Node
(N_Subtype_Declaration
, Sloc
);
177 Set_Defining_Identifier
(N
, Defining_Identifier
);
178 Set_Subtype_Indication
(N
, Subtype_Indication
);
180 end Make_Subtype_Declaration
;
182 function Make_Subtype_Indication
(Sloc
: Source_Ptr
;
183 Subtype_Mark
: Node_Id
;
184 Constraint
: Node_Id
)
187 N
: constant Node_Id
:=
188 New_Node
(N_Subtype_Indication
, Sloc
);
190 Set_Subtype_Mark
(N
, Subtype_Mark
);
191 Set_Constraint
(N
, Constraint
);
193 end Make_Subtype_Indication
;
195 function Make_Object_Declaration
(Sloc
: Source_Ptr
;
196 Defining_Identifier
: Node_Id
;
197 Aliased_Present
: Boolean := False;
198 Constant_Present
: Boolean := False;
199 Object_Definition
: Node_Id
;
200 Expression
: Node_Id
:= Empty
)
203 N
: constant Node_Id
:=
204 New_Node
(N_Object_Declaration
, Sloc
);
206 Set_Defining_Identifier
(N
, Defining_Identifier
);
207 Set_Aliased_Present
(N
, Aliased_Present
);
208 Set_Constant_Present
(N
, Constant_Present
);
209 Set_Object_Definition
(N
, Object_Definition
);
210 Set_Expression
(N
, Expression
);
212 end Make_Object_Declaration
;
214 function Make_Number_Declaration
(Sloc
: Source_Ptr
;
215 Defining_Identifier
: Node_Id
;
216 Expression
: Node_Id
)
219 N
: constant Node_Id
:=
220 New_Node
(N_Number_Declaration
, Sloc
);
222 Set_Defining_Identifier
(N
, Defining_Identifier
);
223 Set_Expression
(N
, Expression
);
225 end Make_Number_Declaration
;
227 function Make_Derived_Type_Definition
(Sloc
: Source_Ptr
;
228 Abstract_Present
: Boolean := False;
229 Subtype_Indication
: Node_Id
;
230 Record_Extension_Part
: Node_Id
:= Empty
)
233 N
: constant Node_Id
:=
234 New_Node
(N_Derived_Type_Definition
, Sloc
);
236 Set_Abstract_Present
(N
, Abstract_Present
);
237 Set_Subtype_Indication
(N
, Subtype_Indication
);
238 Set_Record_Extension_Part
(N
, Record_Extension_Part
);
240 end Make_Derived_Type_Definition
;
242 function Make_Range_Constraint
(Sloc
: Source_Ptr
;
243 Range_Expression
: Node_Id
)
246 N
: constant Node_Id
:=
247 New_Node
(N_Range_Constraint
, Sloc
);
249 Set_Range_Expression
(N
, Range_Expression
);
251 end Make_Range_Constraint
;
253 function Make_Range
(Sloc
: Source_Ptr
;
255 High_Bound
: Node_Id
;
256 Includes_Infinities
: Boolean := False)
259 N
: constant Node_Id
:=
260 New_Node
(N_Range
, Sloc
);
262 Set_Low_Bound
(N
, Low_Bound
);
263 Set_High_Bound
(N
, High_Bound
);
264 Set_Includes_Infinities
(N
, Includes_Infinities
);
268 function Make_Enumeration_Type_Definition
(Sloc
: Source_Ptr
;
270 End_Label
: Node_Id
:= Empty
)
273 N
: constant Node_Id
:=
274 New_Node
(N_Enumeration_Type_Definition
, Sloc
);
276 Set_Literals
(N
, Literals
);
277 Set_End_Label
(N
, End_Label
);
279 end Make_Enumeration_Type_Definition
;
281 function Make_Defining_Character_Literal
(Sloc
: Source_Ptr
;
285 N
: constant Node_Id
:=
286 New_Entity
(N_Defining_Character_Literal
, Sloc
);
288 Set_Chars
(N
, Chars
);
290 end Make_Defining_Character_Literal
;
292 function Make_Signed_Integer_Type_Definition
(Sloc
: Source_Ptr
;
294 High_Bound
: Node_Id
)
297 N
: constant Node_Id
:=
298 New_Node
(N_Signed_Integer_Type_Definition
, Sloc
);
300 Set_Low_Bound
(N
, Low_Bound
);
301 Set_High_Bound
(N
, High_Bound
);
303 end Make_Signed_Integer_Type_Definition
;
305 function Make_Modular_Type_Definition
(Sloc
: Source_Ptr
;
306 Expression
: Node_Id
)
309 N
: constant Node_Id
:=
310 New_Node
(N_Modular_Type_Definition
, Sloc
);
312 Set_Expression
(N
, Expression
);
314 end Make_Modular_Type_Definition
;
316 function Make_Floating_Point_Definition
(Sloc
: Source_Ptr
;
317 Digits_Expression
: Node_Id
;
318 Real_Range_Specification
: Node_Id
:= Empty
)
321 N
: constant Node_Id
:=
322 New_Node
(N_Floating_Point_Definition
, Sloc
);
324 Set_Digits_Expression
(N
, Digits_Expression
);
325 Set_Real_Range_Specification
(N
, Real_Range_Specification
);
327 end Make_Floating_Point_Definition
;
329 function Make_Real_Range_Specification
(Sloc
: Source_Ptr
;
331 High_Bound
: Node_Id
)
334 N
: constant Node_Id
:=
335 New_Node
(N_Real_Range_Specification
, Sloc
);
337 Set_Low_Bound
(N
, Low_Bound
);
338 Set_High_Bound
(N
, High_Bound
);
340 end Make_Real_Range_Specification
;
342 function Make_Ordinary_Fixed_Point_Definition
(Sloc
: Source_Ptr
;
343 Delta_Expression
: Node_Id
;
344 Real_Range_Specification
: Node_Id
)
347 N
: constant Node_Id
:=
348 New_Node
(N_Ordinary_Fixed_Point_Definition
, Sloc
);
350 Set_Delta_Expression
(N
, Delta_Expression
);
351 Set_Real_Range_Specification
(N
, Real_Range_Specification
);
353 end Make_Ordinary_Fixed_Point_Definition
;
355 function Make_Decimal_Fixed_Point_Definition
(Sloc
: Source_Ptr
;
356 Delta_Expression
: Node_Id
;
357 Digits_Expression
: Node_Id
;
358 Real_Range_Specification
: Node_Id
:= Empty
)
361 N
: constant Node_Id
:=
362 New_Node
(N_Decimal_Fixed_Point_Definition
, Sloc
);
364 Set_Delta_Expression
(N
, Delta_Expression
);
365 Set_Digits_Expression
(N
, Digits_Expression
);
366 Set_Real_Range_Specification
(N
, Real_Range_Specification
);
368 end Make_Decimal_Fixed_Point_Definition
;
370 function Make_Digits_Constraint
(Sloc
: Source_Ptr
;
371 Digits_Expression
: Node_Id
;
372 Range_Constraint
: Node_Id
:= Empty
)
375 N
: constant Node_Id
:=
376 New_Node
(N_Digits_Constraint
, Sloc
);
378 Set_Digits_Expression
(N
, Digits_Expression
);
379 Set_Range_Constraint
(N
, Range_Constraint
);
381 end Make_Digits_Constraint
;
383 function Make_Unconstrained_Array_Definition
(Sloc
: Source_Ptr
;
384 Subtype_Marks
: List_Id
;
385 Aliased_Present
: Boolean := False;
386 Subtype_Indication
: Node_Id
)
389 N
: constant Node_Id
:=
390 New_Node
(N_Unconstrained_Array_Definition
, Sloc
);
392 Set_Subtype_Marks
(N
, Subtype_Marks
);
393 Set_Aliased_Present
(N
, Aliased_Present
);
394 Set_Subtype_Indication
(N
, Subtype_Indication
);
396 end Make_Unconstrained_Array_Definition
;
398 function Make_Constrained_Array_Definition
(Sloc
: Source_Ptr
;
399 Discrete_Subtype_Definitions
: List_Id
;
400 Aliased_Present
: Boolean := False;
401 Subtype_Indication
: Node_Id
)
404 N
: constant Node_Id
:=
405 New_Node
(N_Constrained_Array_Definition
, Sloc
);
407 Set_Discrete_Subtype_Definitions
408 (N
, Discrete_Subtype_Definitions
);
409 Set_Aliased_Present
(N
, Aliased_Present
);
410 Set_Subtype_Indication
(N
, Subtype_Indication
);
412 end Make_Constrained_Array_Definition
;
414 function Make_Discriminant_Specification
(Sloc
: Source_Ptr
;
415 Defining_Identifier
: Node_Id
;
416 Discriminant_Type
: Node_Id
;
417 Expression
: Node_Id
:= Empty
)
420 N
: constant Node_Id
:=
421 New_Node
(N_Discriminant_Specification
, Sloc
);
423 Set_Defining_Identifier
(N
, Defining_Identifier
);
424 Set_Discriminant_Type
(N
, Discriminant_Type
);
425 Set_Expression
(N
, Expression
);
427 end Make_Discriminant_Specification
;
429 function Make_Index_Or_Discriminant_Constraint
(Sloc
: Source_Ptr
;
430 Constraints
: List_Id
)
433 N
: constant Node_Id
:=
434 New_Node
(N_Index_Or_Discriminant_Constraint
, Sloc
);
436 Set_Constraints
(N
, Constraints
);
438 end Make_Index_Or_Discriminant_Constraint
;
440 function Make_Discriminant_Association
(Sloc
: Source_Ptr
;
441 Selector_Names
: List_Id
;
442 Expression
: Node_Id
)
445 N
: constant Node_Id
:=
446 New_Node
(N_Discriminant_Association
, Sloc
);
448 Set_Selector_Names
(N
, Selector_Names
);
449 Set_Expression
(N
, Expression
);
451 end Make_Discriminant_Association
;
453 function Make_Record_Definition
(Sloc
: Source_Ptr
;
454 End_Label
: Node_Id
:= Empty
;
455 Abstract_Present
: Boolean := False;
456 Tagged_Present
: Boolean := False;
457 Limited_Present
: Boolean := False;
458 Component_List
: Node_Id
;
459 Null_Present
: Boolean := False)
462 N
: constant Node_Id
:=
463 New_Node
(N_Record_Definition
, Sloc
);
465 Set_End_Label
(N
, End_Label
);
466 Set_Abstract_Present
(N
, Abstract_Present
);
467 Set_Tagged_Present
(N
, Tagged_Present
);
468 Set_Limited_Present
(N
, Limited_Present
);
469 Set_Component_List
(N
, Component_List
);
470 Set_Null_Present
(N
, Null_Present
);
472 end Make_Record_Definition
;
474 function Make_Component_List
(Sloc
: Source_Ptr
;
475 Component_Items
: List_Id
;
476 Variant_Part
: Node_Id
:= Empty
;
477 Null_Present
: Boolean := False)
480 N
: constant Node_Id
:=
481 New_Node
(N_Component_List
, Sloc
);
483 Set_Component_Items
(N
, Component_Items
);
484 Set_Variant_Part
(N
, Variant_Part
);
485 Set_Null_Present
(N
, Null_Present
);
487 end Make_Component_List
;
489 function Make_Component_Declaration
(Sloc
: Source_Ptr
;
490 Defining_Identifier
: Node_Id
;
491 Aliased_Present
: Boolean := False;
492 Subtype_Indication
: Node_Id
;
493 Expression
: Node_Id
:= Empty
)
496 N
: constant Node_Id
:=
497 New_Node
(N_Component_Declaration
, Sloc
);
499 Set_Defining_Identifier
(N
, Defining_Identifier
);
500 Set_Aliased_Present
(N
, Aliased_Present
);
501 Set_Subtype_Indication
(N
, Subtype_Indication
);
502 Set_Expression
(N
, Expression
);
504 end Make_Component_Declaration
;
506 function Make_Variant_Part
(Sloc
: Source_Ptr
;
511 N
: constant Node_Id
:=
512 New_Node
(N_Variant_Part
, Sloc
);
515 Set_Variants
(N
, Variants
);
517 end Make_Variant_Part
;
519 function Make_Variant
(Sloc
: Source_Ptr
;
520 Discrete_Choices
: List_Id
;
521 Component_List
: Node_Id
)
524 N
: constant Node_Id
:=
525 New_Node
(N_Variant
, Sloc
);
527 Set_Discrete_Choices
(N
, Discrete_Choices
);
528 Set_Component_List
(N
, Component_List
);
532 function Make_Others_Choice
(Sloc
: Source_Ptr
)
535 N
: constant Node_Id
:=
536 New_Node
(N_Others_Choice
, Sloc
);
539 end Make_Others_Choice
;
541 function Make_Access_To_Object_Definition
(Sloc
: Source_Ptr
;
542 All_Present
: Boolean := False;
543 Subtype_Indication
: Node_Id
;
544 Constant_Present
: Boolean := False)
547 N
: constant Node_Id
:=
548 New_Node
(N_Access_To_Object_Definition
, Sloc
);
550 Set_All_Present
(N
, All_Present
);
551 Set_Subtype_Indication
(N
, Subtype_Indication
);
552 Set_Constant_Present
(N
, Constant_Present
);
554 end Make_Access_To_Object_Definition
;
556 function Make_Access_Function_Definition
(Sloc
: Source_Ptr
;
557 Protected_Present
: Boolean := False;
558 Parameter_Specifications
: List_Id
:= No_List
;
559 Subtype_Mark
: Node_Id
)
562 N
: constant Node_Id
:=
563 New_Node
(N_Access_Function_Definition
, Sloc
);
565 Set_Protected_Present
(N
, Protected_Present
);
566 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
567 Set_Subtype_Mark
(N
, Subtype_Mark
);
569 end Make_Access_Function_Definition
;
571 function Make_Access_Procedure_Definition
(Sloc
: Source_Ptr
;
572 Protected_Present
: Boolean := False;
573 Parameter_Specifications
: List_Id
:= No_List
)
576 N
: constant Node_Id
:=
577 New_Node
(N_Access_Procedure_Definition
, Sloc
);
579 Set_Protected_Present
(N
, Protected_Present
);
580 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
582 end Make_Access_Procedure_Definition
;
584 function Make_Access_Definition
(Sloc
: Source_Ptr
;
585 Subtype_Mark
: Node_Id
)
588 N
: constant Node_Id
:=
589 New_Node
(N_Access_Definition
, Sloc
);
591 Set_Subtype_Mark
(N
, Subtype_Mark
);
593 end Make_Access_Definition
;
595 function Make_Incomplete_Type_Declaration
(Sloc
: Source_Ptr
;
596 Defining_Identifier
: Node_Id
;
597 Discriminant_Specifications
: List_Id
:= No_List
;
598 Unknown_Discriminants_Present
: Boolean := False)
601 N
: constant Node_Id
:=
602 New_Node
(N_Incomplete_Type_Declaration
, Sloc
);
604 Set_Defining_Identifier
(N
, Defining_Identifier
);
605 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
606 Set_Unknown_Discriminants_Present
607 (N
, Unknown_Discriminants_Present
);
609 end Make_Incomplete_Type_Declaration
;
611 function Make_Explicit_Dereference
(Sloc
: Source_Ptr
;
615 N
: constant Node_Id
:=
616 New_Node
(N_Explicit_Dereference
, Sloc
);
618 Set_Prefix
(N
, Prefix
);
620 end Make_Explicit_Dereference
;
622 function Make_Indexed_Component
(Sloc
: Source_Ptr
;
624 Expressions
: List_Id
)
627 N
: constant Node_Id
:=
628 New_Node
(N_Indexed_Component
, Sloc
);
630 Set_Prefix
(N
, Prefix
);
631 Set_Expressions
(N
, Expressions
);
633 end Make_Indexed_Component
;
635 function Make_Slice
(Sloc
: Source_Ptr
;
637 Discrete_Range
: Node_Id
)
640 N
: constant Node_Id
:=
641 New_Node
(N_Slice
, Sloc
);
643 Set_Prefix
(N
, Prefix
);
644 Set_Discrete_Range
(N
, Discrete_Range
);
648 function Make_Selected_Component
(Sloc
: Source_Ptr
;
650 Selector_Name
: Node_Id
)
653 N
: constant Node_Id
:=
654 New_Node
(N_Selected_Component
, Sloc
);
656 Set_Prefix
(N
, Prefix
);
657 Set_Selector_Name
(N
, Selector_Name
);
659 end Make_Selected_Component
;
661 function Make_Attribute_Reference
(Sloc
: Source_Ptr
;
663 Attribute_Name
: Name_Id
;
664 Expressions
: List_Id
:= No_List
;
665 Must_Be_Byte_Aligned
: Boolean := False)
668 N
: constant Node_Id
:=
669 New_Node
(N_Attribute_Reference
, Sloc
);
671 Set_Prefix
(N
, Prefix
);
672 Set_Attribute_Name
(N
, Attribute_Name
);
673 Set_Expressions
(N
, Expressions
);
674 Set_Must_Be_Byte_Aligned
(N
, Must_Be_Byte_Aligned
);
676 end Make_Attribute_Reference
;
678 function Make_Aggregate
(Sloc
: Source_Ptr
;
679 Expressions
: List_Id
:= No_List
;
680 Component_Associations
: List_Id
:= No_List
;
681 Null_Record_Present
: Boolean := False)
684 N
: constant Node_Id
:=
685 New_Node
(N_Aggregate
, Sloc
);
687 Set_Expressions
(N
, Expressions
);
688 Set_Component_Associations
(N
, Component_Associations
);
689 Set_Null_Record_Present
(N
, Null_Record_Present
);
693 function Make_Component_Association
(Sloc
: Source_Ptr
;
695 Expression
: Node_Id
;
696 Box_Present
: Boolean := False)
699 N
: constant Node_Id
:=
700 New_Node
(N_Component_Association
, Sloc
);
702 Set_Choices
(N
, Choices
);
703 Set_Expression
(N
, Expression
);
704 Set_Box_Present
(N
, Box_Present
);
706 end Make_Component_Association
;
708 function Make_Extension_Aggregate
(Sloc
: Source_Ptr
;
709 Ancestor_Part
: Node_Id
;
710 Expressions
: List_Id
:= No_List
;
711 Component_Associations
: List_Id
:= No_List
;
712 Null_Record_Present
: Boolean := False)
715 N
: constant Node_Id
:=
716 New_Node
(N_Extension_Aggregate
, Sloc
);
718 Set_Ancestor_Part
(N
, Ancestor_Part
);
719 Set_Expressions
(N
, Expressions
);
720 Set_Component_Associations
(N
, Component_Associations
);
721 Set_Null_Record_Present
(N
, Null_Record_Present
);
723 end Make_Extension_Aggregate
;
725 function Make_Null
(Sloc
: Source_Ptr
)
728 N
: constant Node_Id
:=
729 New_Node
(N_Null
, Sloc
);
734 function Make_And_Then
(Sloc
: Source_Ptr
;
736 Right_Opnd
: Node_Id
)
739 N
: constant Node_Id
:=
740 New_Node
(N_And_Then
, Sloc
);
742 Set_Left_Opnd
(N
, Left_Opnd
);
743 Set_Right_Opnd
(N
, Right_Opnd
);
747 function Make_Or_Else
(Sloc
: Source_Ptr
;
749 Right_Opnd
: Node_Id
)
752 N
: constant Node_Id
:=
753 New_Node
(N_Or_Else
, Sloc
);
755 Set_Left_Opnd
(N
, Left_Opnd
);
756 Set_Right_Opnd
(N
, Right_Opnd
);
760 function Make_In
(Sloc
: Source_Ptr
;
762 Right_Opnd
: Node_Id
)
765 N
: constant Node_Id
:=
766 New_Node
(N_In
, Sloc
);
768 Set_Left_Opnd
(N
, Left_Opnd
);
769 Set_Right_Opnd
(N
, Right_Opnd
);
773 function Make_Not_In
(Sloc
: Source_Ptr
;
775 Right_Opnd
: Node_Id
)
778 N
: constant Node_Id
:=
779 New_Node
(N_Not_In
, Sloc
);
781 Set_Left_Opnd
(N
, Left_Opnd
);
782 Set_Right_Opnd
(N
, Right_Opnd
);
786 function Make_Op_And
(Sloc
: Source_Ptr
;
788 Right_Opnd
: Node_Id
)
791 N
: constant Node_Id
:=
792 New_Node
(N_Op_And
, Sloc
);
794 Set_Left_Opnd
(N
, Left_Opnd
);
795 Set_Right_Opnd
(N
, Right_Opnd
);
796 Set_Chars
(N
, Name_Op_And
);
797 Set_Entity
(N
, Standard_Op_And
);
801 function Make_Op_Or
(Sloc
: Source_Ptr
;
803 Right_Opnd
: Node_Id
)
806 N
: constant Node_Id
:=
807 New_Node
(N_Op_Or
, Sloc
);
809 Set_Left_Opnd
(N
, Left_Opnd
);
810 Set_Right_Opnd
(N
, Right_Opnd
);
811 Set_Chars
(N
, Name_Op_Or
);
812 Set_Entity
(N
, Standard_Op_Or
);
816 function Make_Op_Xor
(Sloc
: Source_Ptr
;
818 Right_Opnd
: Node_Id
)
821 N
: constant Node_Id
:=
822 New_Node
(N_Op_Xor
, Sloc
);
824 Set_Left_Opnd
(N
, Left_Opnd
);
825 Set_Right_Opnd
(N
, Right_Opnd
);
826 Set_Chars
(N
, Name_Op_Xor
);
827 Set_Entity
(N
, Standard_Op_Xor
);
831 function Make_Op_Eq
(Sloc
: Source_Ptr
;
833 Right_Opnd
: Node_Id
)
836 N
: constant Node_Id
:=
837 New_Node
(N_Op_Eq
, Sloc
);
839 Set_Left_Opnd
(N
, Left_Opnd
);
840 Set_Right_Opnd
(N
, Right_Opnd
);
841 Set_Chars
(N
, Name_Op_Eq
);
842 Set_Entity
(N
, Standard_Op_Eq
);
846 function Make_Op_Ne
(Sloc
: Source_Ptr
;
848 Right_Opnd
: Node_Id
)
851 N
: constant Node_Id
:=
852 New_Node
(N_Op_Ne
, Sloc
);
854 Set_Left_Opnd
(N
, Left_Opnd
);
855 Set_Right_Opnd
(N
, Right_Opnd
);
856 Set_Chars
(N
, Name_Op_Ne
);
857 Set_Entity
(N
, Standard_Op_Ne
);
861 function Make_Op_Lt
(Sloc
: Source_Ptr
;
863 Right_Opnd
: Node_Id
)
866 N
: constant Node_Id
:=
867 New_Node
(N_Op_Lt
, Sloc
);
869 Set_Left_Opnd
(N
, Left_Opnd
);
870 Set_Right_Opnd
(N
, Right_Opnd
);
871 Set_Chars
(N
, Name_Op_Lt
);
872 Set_Entity
(N
, Standard_Op_Lt
);
876 function Make_Op_Le
(Sloc
: Source_Ptr
;
878 Right_Opnd
: Node_Id
)
881 N
: constant Node_Id
:=
882 New_Node
(N_Op_Le
, Sloc
);
884 Set_Left_Opnd
(N
, Left_Opnd
);
885 Set_Right_Opnd
(N
, Right_Opnd
);
886 Set_Chars
(N
, Name_Op_Le
);
887 Set_Entity
(N
, Standard_Op_Le
);
891 function Make_Op_Gt
(Sloc
: Source_Ptr
;
893 Right_Opnd
: Node_Id
)
896 N
: constant Node_Id
:=
897 New_Node
(N_Op_Gt
, Sloc
);
899 Set_Left_Opnd
(N
, Left_Opnd
);
900 Set_Right_Opnd
(N
, Right_Opnd
);
901 Set_Chars
(N
, Name_Op_Gt
);
902 Set_Entity
(N
, Standard_Op_Gt
);
906 function Make_Op_Ge
(Sloc
: Source_Ptr
;
908 Right_Opnd
: Node_Id
)
911 N
: constant Node_Id
:=
912 New_Node
(N_Op_Ge
, Sloc
);
914 Set_Left_Opnd
(N
, Left_Opnd
);
915 Set_Right_Opnd
(N
, Right_Opnd
);
916 Set_Chars
(N
, Name_Op_Ge
);
917 Set_Entity
(N
, Standard_Op_Ge
);
921 function Make_Op_Add
(Sloc
: Source_Ptr
;
923 Right_Opnd
: Node_Id
)
926 N
: constant Node_Id
:=
927 New_Node
(N_Op_Add
, Sloc
);
929 Set_Left_Opnd
(N
, Left_Opnd
);
930 Set_Right_Opnd
(N
, Right_Opnd
);
931 Set_Chars
(N
, Name_Op_Add
);
932 Set_Entity
(N
, Standard_Op_Add
);
936 function Make_Op_Subtract
(Sloc
: Source_Ptr
;
938 Right_Opnd
: Node_Id
)
941 N
: constant Node_Id
:=
942 New_Node
(N_Op_Subtract
, Sloc
);
944 Set_Left_Opnd
(N
, Left_Opnd
);
945 Set_Right_Opnd
(N
, Right_Opnd
);
946 Set_Chars
(N
, Name_Op_Subtract
);
947 Set_Entity
(N
, Standard_Op_Subtract
);
949 end Make_Op_Subtract
;
951 function Make_Op_Concat
(Sloc
: Source_Ptr
;
953 Right_Opnd
: Node_Id
)
956 N
: constant Node_Id
:=
957 New_Node
(N_Op_Concat
, Sloc
);
959 Set_Left_Opnd
(N
, Left_Opnd
);
960 Set_Right_Opnd
(N
, Right_Opnd
);
961 Set_Chars
(N
, Name_Op_Concat
);
962 Set_Entity
(N
, Standard_Op_Concat
);
966 function Make_Op_Multiply
(Sloc
: Source_Ptr
;
968 Right_Opnd
: Node_Id
)
971 N
: constant Node_Id
:=
972 New_Node
(N_Op_Multiply
, Sloc
);
974 Set_Left_Opnd
(N
, Left_Opnd
);
975 Set_Right_Opnd
(N
, Right_Opnd
);
976 Set_Chars
(N
, Name_Op_Multiply
);
977 Set_Entity
(N
, Standard_Op_Multiply
);
979 end Make_Op_Multiply
;
981 function Make_Op_Divide
(Sloc
: Source_Ptr
;
983 Right_Opnd
: Node_Id
)
986 N
: constant Node_Id
:=
987 New_Node
(N_Op_Divide
, Sloc
);
989 Set_Left_Opnd
(N
, Left_Opnd
);
990 Set_Right_Opnd
(N
, Right_Opnd
);
991 Set_Chars
(N
, Name_Op_Divide
);
992 Set_Entity
(N
, Standard_Op_Divide
);
996 function Make_Op_Mod
(Sloc
: Source_Ptr
;
998 Right_Opnd
: Node_Id
)
1001 N
: constant Node_Id
:=
1002 New_Node
(N_Op_Mod
, Sloc
);
1004 Set_Left_Opnd
(N
, Left_Opnd
);
1005 Set_Right_Opnd
(N
, Right_Opnd
);
1006 Set_Chars
(N
, Name_Op_Mod
);
1007 Set_Entity
(N
, Standard_Op_Mod
);
1011 function Make_Op_Rem
(Sloc
: Source_Ptr
;
1012 Left_Opnd
: Node_Id
;
1013 Right_Opnd
: Node_Id
)
1016 N
: constant Node_Id
:=
1017 New_Node
(N_Op_Rem
, Sloc
);
1019 Set_Left_Opnd
(N
, Left_Opnd
);
1020 Set_Right_Opnd
(N
, Right_Opnd
);
1021 Set_Chars
(N
, Name_Op_Rem
);
1022 Set_Entity
(N
, Standard_Op_Rem
);
1026 function Make_Op_Expon
(Sloc
: Source_Ptr
;
1027 Left_Opnd
: Node_Id
;
1028 Right_Opnd
: Node_Id
)
1031 N
: constant Node_Id
:=
1032 New_Node
(N_Op_Expon
, Sloc
);
1034 Set_Left_Opnd
(N
, Left_Opnd
);
1035 Set_Right_Opnd
(N
, Right_Opnd
);
1036 Set_Chars
(N
, Name_Op_Expon
);
1037 Set_Entity
(N
, Standard_Op_Expon
);
1041 function Make_Op_Plus
(Sloc
: Source_Ptr
;
1042 Right_Opnd
: Node_Id
)
1045 N
: constant Node_Id
:=
1046 New_Node
(N_Op_Plus
, Sloc
);
1048 Set_Right_Opnd
(N
, Right_Opnd
);
1049 Set_Chars
(N
, Name_Op_Add
);
1050 Set_Entity
(N
, Standard_Op_Plus
);
1054 function Make_Op_Minus
(Sloc
: Source_Ptr
;
1055 Right_Opnd
: Node_Id
)
1058 N
: constant Node_Id
:=
1059 New_Node
(N_Op_Minus
, Sloc
);
1061 Set_Right_Opnd
(N
, Right_Opnd
);
1062 Set_Chars
(N
, Name_Op_Subtract
);
1063 Set_Entity
(N
, Standard_Op_Minus
);
1067 function Make_Op_Abs
(Sloc
: Source_Ptr
;
1068 Right_Opnd
: Node_Id
)
1071 N
: constant Node_Id
:=
1072 New_Node
(N_Op_Abs
, Sloc
);
1074 Set_Right_Opnd
(N
, Right_Opnd
);
1075 Set_Chars
(N
, Name_Op_Abs
);
1076 Set_Entity
(N
, Standard_Op_Abs
);
1080 function Make_Op_Not
(Sloc
: Source_Ptr
;
1081 Right_Opnd
: Node_Id
)
1084 N
: constant Node_Id
:=
1085 New_Node
(N_Op_Not
, Sloc
);
1087 Set_Right_Opnd
(N
, Right_Opnd
);
1088 Set_Chars
(N
, Name_Op_Not
);
1089 Set_Entity
(N
, Standard_Op_Not
);
1093 function Make_Type_Conversion
(Sloc
: Source_Ptr
;
1094 Subtype_Mark
: Node_Id
;
1095 Expression
: Node_Id
)
1098 N
: constant Node_Id
:=
1099 New_Node
(N_Type_Conversion
, Sloc
);
1101 Set_Subtype_Mark
(N
, Subtype_Mark
);
1102 Set_Expression
(N
, Expression
);
1104 end Make_Type_Conversion
;
1106 function Make_Qualified_Expression
(Sloc
: Source_Ptr
;
1107 Subtype_Mark
: Node_Id
;
1108 Expression
: Node_Id
)
1111 N
: constant Node_Id
:=
1112 New_Node
(N_Qualified_Expression
, Sloc
);
1114 Set_Subtype_Mark
(N
, Subtype_Mark
);
1115 Set_Expression
(N
, Expression
);
1117 end Make_Qualified_Expression
;
1119 function Make_Allocator
(Sloc
: Source_Ptr
;
1120 Expression
: Node_Id
)
1123 N
: constant Node_Id
:=
1124 New_Node
(N_Allocator
, Sloc
);
1126 Set_Expression
(N
, Expression
);
1130 function Make_Null_Statement
(Sloc
: Source_Ptr
)
1133 N
: constant Node_Id
:=
1134 New_Node
(N_Null_Statement
, Sloc
);
1137 end Make_Null_Statement
;
1139 function Make_Label
(Sloc
: Source_Ptr
;
1140 Identifier
: Node_Id
)
1143 N
: constant Node_Id
:=
1144 New_Node
(N_Label
, Sloc
);
1146 Set_Identifier
(N
, Identifier
);
1150 function Make_Assignment_Statement
(Sloc
: Source_Ptr
;
1152 Expression
: Node_Id
)
1155 N
: constant Node_Id
:=
1156 New_Node
(N_Assignment_Statement
, Sloc
);
1159 Set_Expression
(N
, Expression
);
1161 end Make_Assignment_Statement
;
1163 function Make_If_Statement
(Sloc
: Source_Ptr
;
1164 Condition
: Node_Id
;
1165 Then_Statements
: List_Id
;
1166 Elsif_Parts
: List_Id
:= No_List
;
1167 Else_Statements
: List_Id
:= No_List
;
1168 End_Span
: Uint
:= No_Uint
)
1171 N
: constant Node_Id
:=
1172 New_Node
(N_If_Statement
, Sloc
);
1174 Set_Condition
(N
, Condition
);
1175 Set_Then_Statements
(N
, Then_Statements
);
1176 Set_Elsif_Parts
(N
, Elsif_Parts
);
1177 Set_Else_Statements
(N
, Else_Statements
);
1178 Set_End_Span
(N
, End_Span
);
1180 end Make_If_Statement
;
1182 function Make_Elsif_Part
(Sloc
: Source_Ptr
;
1183 Condition
: Node_Id
;
1184 Then_Statements
: List_Id
)
1187 N
: constant Node_Id
:=
1188 New_Node
(N_Elsif_Part
, Sloc
);
1190 Set_Condition
(N
, Condition
);
1191 Set_Then_Statements
(N
, Then_Statements
);
1193 end Make_Elsif_Part
;
1195 function Make_Case_Statement
(Sloc
: Source_Ptr
;
1196 Expression
: Node_Id
;
1197 Alternatives
: List_Id
;
1198 End_Span
: Uint
:= No_Uint
)
1201 N
: constant Node_Id
:=
1202 New_Node
(N_Case_Statement
, Sloc
);
1204 Set_Expression
(N
, Expression
);
1205 Set_Alternatives
(N
, Alternatives
);
1206 Set_End_Span
(N
, End_Span
);
1208 end Make_Case_Statement
;
1210 function Make_Case_Statement_Alternative
(Sloc
: Source_Ptr
;
1211 Discrete_Choices
: List_Id
;
1212 Statements
: List_Id
)
1215 N
: constant Node_Id
:=
1216 New_Node
(N_Case_Statement_Alternative
, Sloc
);
1218 Set_Discrete_Choices
(N
, Discrete_Choices
);
1219 Set_Statements
(N
, Statements
);
1221 end Make_Case_Statement_Alternative
;
1223 function Make_Loop_Statement
(Sloc
: Source_Ptr
;
1224 Identifier
: Node_Id
:= Empty
;
1225 Iteration_Scheme
: Node_Id
:= Empty
;
1226 Statements
: List_Id
;
1227 End_Label
: Node_Id
;
1228 Has_Created_Identifier
: Boolean := False;
1229 Is_Null_Loop
: Boolean := False)
1232 N
: constant Node_Id
:=
1233 New_Node
(N_Loop_Statement
, Sloc
);
1235 Set_Identifier
(N
, Identifier
);
1236 Set_Iteration_Scheme
(N
, Iteration_Scheme
);
1237 Set_Statements
(N
, Statements
);
1238 Set_End_Label
(N
, End_Label
);
1239 Set_Has_Created_Identifier
(N
, Has_Created_Identifier
);
1240 Set_Is_Null_Loop
(N
, Is_Null_Loop
);
1242 end Make_Loop_Statement
;
1244 function Make_Iteration_Scheme
(Sloc
: Source_Ptr
;
1245 Condition
: Node_Id
:= Empty
;
1246 Loop_Parameter_Specification
: Node_Id
:= Empty
)
1249 N
: constant Node_Id
:=
1250 New_Node
(N_Iteration_Scheme
, Sloc
);
1252 Set_Condition
(N
, Condition
);
1253 Set_Loop_Parameter_Specification
1254 (N
, Loop_Parameter_Specification
);
1256 end Make_Iteration_Scheme
;
1258 function Make_Loop_Parameter_Specification
(Sloc
: Source_Ptr
;
1259 Defining_Identifier
: Node_Id
;
1260 Reverse_Present
: Boolean := False;
1261 Discrete_Subtype_Definition
: Node_Id
)
1264 N
: constant Node_Id
:=
1265 New_Node
(N_Loop_Parameter_Specification
, Sloc
);
1267 Set_Defining_Identifier
(N
, Defining_Identifier
);
1268 Set_Reverse_Present
(N
, Reverse_Present
);
1269 Set_Discrete_Subtype_Definition
(N
, Discrete_Subtype_Definition
);
1271 end Make_Loop_Parameter_Specification
;
1273 function Make_Block_Statement
(Sloc
: Source_Ptr
;
1274 Identifier
: Node_Id
:= Empty
;
1275 Declarations
: List_Id
:= No_List
;
1276 Handled_Statement_Sequence
: Node_Id
;
1277 Has_Created_Identifier
: Boolean := False;
1278 Is_Task_Allocation_Block
: Boolean := False;
1279 Is_Asynchronous_Call_Block
: Boolean := False)
1282 N
: constant Node_Id
:=
1283 New_Node
(N_Block_Statement
, Sloc
);
1285 Set_Identifier
(N
, Identifier
);
1286 Set_Declarations
(N
, Declarations
);
1287 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1288 Set_Has_Created_Identifier
(N
, Has_Created_Identifier
);
1289 Set_Is_Task_Allocation_Block
(N
, Is_Task_Allocation_Block
);
1290 Set_Is_Asynchronous_Call_Block
(N
, Is_Asynchronous_Call_Block
);
1292 end Make_Block_Statement
;
1294 function Make_Exit_Statement
(Sloc
: Source_Ptr
;
1295 Name
: Node_Id
:= Empty
;
1296 Condition
: Node_Id
:= Empty
)
1299 N
: constant Node_Id
:=
1300 New_Node
(N_Exit_Statement
, Sloc
);
1303 Set_Condition
(N
, Condition
);
1305 end Make_Exit_Statement
;
1307 function Make_Goto_Statement
(Sloc
: Source_Ptr
;
1311 N
: constant Node_Id
:=
1312 New_Node
(N_Goto_Statement
, Sloc
);
1316 end Make_Goto_Statement
;
1318 function Make_Subprogram_Declaration
(Sloc
: Source_Ptr
;
1319 Specification
: Node_Id
)
1322 N
: constant Node_Id
:=
1323 New_Node
(N_Subprogram_Declaration
, Sloc
);
1325 Set_Specification
(N
, Specification
);
1327 end Make_Subprogram_Declaration
;
1329 function Make_Abstract_Subprogram_Declaration
(Sloc
: Source_Ptr
;
1330 Specification
: Node_Id
)
1333 N
: constant Node_Id
:=
1334 New_Node
(N_Abstract_Subprogram_Declaration
, Sloc
);
1336 Set_Specification
(N
, Specification
);
1338 end Make_Abstract_Subprogram_Declaration
;
1340 function Make_Function_Specification
(Sloc
: Source_Ptr
;
1341 Defining_Unit_Name
: Node_Id
;
1342 Parameter_Specifications
: List_Id
:= No_List
;
1343 Subtype_Mark
: Node_Id
)
1346 N
: constant Node_Id
:=
1347 New_Node
(N_Function_Specification
, Sloc
);
1349 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1350 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
1351 Set_Subtype_Mark
(N
, Subtype_Mark
);
1353 end Make_Function_Specification
;
1355 function Make_Procedure_Specification
(Sloc
: Source_Ptr
;
1356 Defining_Unit_Name
: Node_Id
;
1357 Parameter_Specifications
: List_Id
:= No_List
)
1360 N
: constant Node_Id
:=
1361 New_Node
(N_Procedure_Specification
, Sloc
);
1363 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1364 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
1366 end Make_Procedure_Specification
;
1368 function Make_Designator
(Sloc
: Source_Ptr
;
1370 Identifier
: Node_Id
)
1373 N
: constant Node_Id
:=
1374 New_Node
(N_Designator
, Sloc
);
1377 Set_Identifier
(N
, Identifier
);
1379 end Make_Designator
;
1381 function Make_Defining_Program_Unit_Name
(Sloc
: Source_Ptr
;
1383 Defining_Identifier
: Node_Id
)
1386 N
: constant Node_Id
:=
1387 New_Node
(N_Defining_Program_Unit_Name
, Sloc
);
1390 Set_Defining_Identifier
(N
, Defining_Identifier
);
1392 end Make_Defining_Program_Unit_Name
;
1394 function Make_Operator_Symbol
(Sloc
: Source_Ptr
;
1399 N
: constant Node_Id
:=
1400 New_Node
(N_Operator_Symbol
, Sloc
);
1402 Set_Chars
(N
, Chars
);
1403 Set_Strval
(N
, Strval
);
1405 end Make_Operator_Symbol
;
1407 function Make_Defining_Operator_Symbol
(Sloc
: Source_Ptr
;
1411 N
: constant Node_Id
:=
1412 New_Entity
(N_Defining_Operator_Symbol
, Sloc
);
1414 Set_Chars
(N
, Chars
);
1416 end Make_Defining_Operator_Symbol
;
1418 function Make_Parameter_Specification
(Sloc
: Source_Ptr
;
1419 Defining_Identifier
: Node_Id
;
1420 In_Present
: Boolean := False;
1421 Out_Present
: Boolean := False;
1422 Parameter_Type
: Node_Id
;
1423 Expression
: Node_Id
:= Empty
)
1426 N
: constant Node_Id
:=
1427 New_Node
(N_Parameter_Specification
, Sloc
);
1429 Set_Defining_Identifier
(N
, Defining_Identifier
);
1430 Set_In_Present
(N
, In_Present
);
1431 Set_Out_Present
(N
, Out_Present
);
1432 Set_Parameter_Type
(N
, Parameter_Type
);
1433 Set_Expression
(N
, Expression
);
1435 end Make_Parameter_Specification
;
1437 function Make_Subprogram_Body
(Sloc
: Source_Ptr
;
1438 Specification
: Node_Id
;
1439 Declarations
: List_Id
;
1440 Handled_Statement_Sequence
: Node_Id
;
1441 Bad_Is_Detected
: Boolean := False)
1444 N
: constant Node_Id
:=
1445 New_Node
(N_Subprogram_Body
, Sloc
);
1447 Set_Specification
(N
, Specification
);
1448 Set_Declarations
(N
, Declarations
);
1449 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1450 Set_Bad_Is_Detected
(N
, Bad_Is_Detected
);
1452 end Make_Subprogram_Body
;
1454 function Make_Procedure_Call_Statement
(Sloc
: Source_Ptr
;
1456 Parameter_Associations
: List_Id
:= No_List
)
1459 N
: constant Node_Id
:=
1460 New_Node
(N_Procedure_Call_Statement
, Sloc
);
1463 Set_Parameter_Associations
(N
, Parameter_Associations
);
1465 end Make_Procedure_Call_Statement
;
1467 function Make_Function_Call
(Sloc
: Source_Ptr
;
1469 Parameter_Associations
: List_Id
:= No_List
)
1472 N
: constant Node_Id
:=
1473 New_Node
(N_Function_Call
, Sloc
);
1476 Set_Parameter_Associations
(N
, Parameter_Associations
);
1478 end Make_Function_Call
;
1480 function Make_Parameter_Association
(Sloc
: Source_Ptr
;
1481 Selector_Name
: Node_Id
;
1482 Explicit_Actual_Parameter
: Node_Id
)
1485 N
: constant Node_Id
:=
1486 New_Node
(N_Parameter_Association
, Sloc
);
1488 Set_Selector_Name
(N
, Selector_Name
);
1489 Set_Explicit_Actual_Parameter
(N
, Explicit_Actual_Parameter
);
1491 end Make_Parameter_Association
;
1493 function Make_Return_Statement
(Sloc
: Source_Ptr
;
1494 Expression
: Node_Id
:= Empty
)
1497 N
: constant Node_Id
:=
1498 New_Node
(N_Return_Statement
, Sloc
);
1500 Set_Expression
(N
, Expression
);
1502 end Make_Return_Statement
;
1504 function Make_Package_Declaration
(Sloc
: Source_Ptr
;
1505 Specification
: Node_Id
)
1508 N
: constant Node_Id
:=
1509 New_Node
(N_Package_Declaration
, Sloc
);
1511 Set_Specification
(N
, Specification
);
1513 end Make_Package_Declaration
;
1515 function Make_Package_Specification
(Sloc
: Source_Ptr
;
1516 Defining_Unit_Name
: Node_Id
;
1517 Visible_Declarations
: List_Id
;
1518 Private_Declarations
: List_Id
:= No_List
;
1519 End_Label
: Node_Id
)
1522 N
: constant Node_Id
:=
1523 New_Node
(N_Package_Specification
, Sloc
);
1525 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1526 Set_Visible_Declarations
(N
, Visible_Declarations
);
1527 Set_Private_Declarations
(N
, Private_Declarations
);
1528 Set_End_Label
(N
, End_Label
);
1530 end Make_Package_Specification
;
1532 function Make_Package_Body
(Sloc
: Source_Ptr
;
1533 Defining_Unit_Name
: Node_Id
;
1534 Declarations
: List_Id
;
1535 Handled_Statement_Sequence
: Node_Id
:= Empty
)
1538 N
: constant Node_Id
:=
1539 New_Node
(N_Package_Body
, Sloc
);
1541 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1542 Set_Declarations
(N
, Declarations
);
1543 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1545 end Make_Package_Body
;
1547 function Make_Private_Type_Declaration
(Sloc
: Source_Ptr
;
1548 Defining_Identifier
: Node_Id
;
1549 Discriminant_Specifications
: List_Id
:= No_List
;
1550 Unknown_Discriminants_Present
: Boolean := False;
1551 Abstract_Present
: Boolean := False;
1552 Tagged_Present
: Boolean := False;
1553 Limited_Present
: Boolean := False)
1556 N
: constant Node_Id
:=
1557 New_Node
(N_Private_Type_Declaration
, Sloc
);
1559 Set_Defining_Identifier
(N
, Defining_Identifier
);
1560 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
1561 Set_Unknown_Discriminants_Present
1562 (N
, Unknown_Discriminants_Present
);
1563 Set_Abstract_Present
(N
, Abstract_Present
);
1564 Set_Tagged_Present
(N
, Tagged_Present
);
1565 Set_Limited_Present
(N
, Limited_Present
);
1567 end Make_Private_Type_Declaration
;
1569 function Make_Private_Extension_Declaration
(Sloc
: Source_Ptr
;
1570 Defining_Identifier
: Node_Id
;
1571 Discriminant_Specifications
: List_Id
:= No_List
;
1572 Unknown_Discriminants_Present
: Boolean := False;
1573 Abstract_Present
: Boolean := False;
1574 Subtype_Indication
: Node_Id
)
1577 N
: constant Node_Id
:=
1578 New_Node
(N_Private_Extension_Declaration
, Sloc
);
1580 Set_Defining_Identifier
(N
, Defining_Identifier
);
1581 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
1582 Set_Unknown_Discriminants_Present
1583 (N
, Unknown_Discriminants_Present
);
1584 Set_Abstract_Present
(N
, Abstract_Present
);
1585 Set_Subtype_Indication
(N
, Subtype_Indication
);
1587 end Make_Private_Extension_Declaration
;
1589 function Make_Use_Package_Clause
(Sloc
: Source_Ptr
;
1593 N
: constant Node_Id
:=
1594 New_Node
(N_Use_Package_Clause
, Sloc
);
1596 Set_Names
(N
, Names
);
1598 end Make_Use_Package_Clause
;
1600 function Make_Use_Type_Clause
(Sloc
: Source_Ptr
;
1601 Subtype_Marks
: List_Id
)
1604 N
: constant Node_Id
:=
1605 New_Node
(N_Use_Type_Clause
, Sloc
);
1607 Set_Subtype_Marks
(N
, Subtype_Marks
);
1609 end Make_Use_Type_Clause
;
1611 function Make_Object_Renaming_Declaration
(Sloc
: Source_Ptr
;
1612 Defining_Identifier
: Node_Id
;
1613 Subtype_Mark
: Node_Id
;
1617 N
: constant Node_Id
:=
1618 New_Node
(N_Object_Renaming_Declaration
, Sloc
);
1620 Set_Defining_Identifier
(N
, Defining_Identifier
);
1621 Set_Subtype_Mark
(N
, Subtype_Mark
);
1624 end Make_Object_Renaming_Declaration
;
1626 function Make_Exception_Renaming_Declaration
(Sloc
: Source_Ptr
;
1627 Defining_Identifier
: Node_Id
;
1631 N
: constant Node_Id
:=
1632 New_Node
(N_Exception_Renaming_Declaration
, Sloc
);
1634 Set_Defining_Identifier
(N
, Defining_Identifier
);
1637 end Make_Exception_Renaming_Declaration
;
1639 function Make_Package_Renaming_Declaration
(Sloc
: Source_Ptr
;
1640 Defining_Unit_Name
: Node_Id
;
1644 N
: constant Node_Id
:=
1645 New_Node
(N_Package_Renaming_Declaration
, Sloc
);
1647 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1650 end Make_Package_Renaming_Declaration
;
1652 function Make_Subprogram_Renaming_Declaration
(Sloc
: Source_Ptr
;
1653 Specification
: Node_Id
;
1657 N
: constant Node_Id
:=
1658 New_Node
(N_Subprogram_Renaming_Declaration
, Sloc
);
1660 Set_Specification
(N
, Specification
);
1663 end Make_Subprogram_Renaming_Declaration
;
1665 function Make_Generic_Package_Renaming_Declaration
(Sloc
: Source_Ptr
;
1666 Defining_Unit_Name
: Node_Id
;
1670 N
: constant Node_Id
:=
1671 New_Node
(N_Generic_Package_Renaming_Declaration
, Sloc
);
1673 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1676 end Make_Generic_Package_Renaming_Declaration
;
1678 function Make_Generic_Procedure_Renaming_Declaration
(Sloc
: Source_Ptr
;
1679 Defining_Unit_Name
: Node_Id
;
1683 N
: constant Node_Id
:=
1684 New_Node
(N_Generic_Procedure_Renaming_Declaration
, Sloc
);
1686 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1689 end Make_Generic_Procedure_Renaming_Declaration
;
1691 function Make_Generic_Function_Renaming_Declaration
(Sloc
: Source_Ptr
;
1692 Defining_Unit_Name
: Node_Id
;
1696 N
: constant Node_Id
:=
1697 New_Node
(N_Generic_Function_Renaming_Declaration
, Sloc
);
1699 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
1702 end Make_Generic_Function_Renaming_Declaration
;
1704 function Make_Task_Type_Declaration
(Sloc
: Source_Ptr
;
1705 Defining_Identifier
: Node_Id
;
1706 Discriminant_Specifications
: List_Id
:= No_List
;
1707 Task_Definition
: Node_Id
:= Empty
)
1710 N
: constant Node_Id
:=
1711 New_Node
(N_Task_Type_Declaration
, Sloc
);
1713 Set_Defining_Identifier
(N
, Defining_Identifier
);
1714 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
1715 Set_Task_Definition
(N
, Task_Definition
);
1717 end Make_Task_Type_Declaration
;
1719 function Make_Single_Task_Declaration
(Sloc
: Source_Ptr
;
1720 Defining_Identifier
: Node_Id
;
1721 Task_Definition
: Node_Id
:= Empty
)
1724 N
: constant Node_Id
:=
1725 New_Node
(N_Single_Task_Declaration
, Sloc
);
1727 Set_Defining_Identifier
(N
, Defining_Identifier
);
1728 Set_Task_Definition
(N
, Task_Definition
);
1730 end Make_Single_Task_Declaration
;
1732 function Make_Task_Definition
(Sloc
: Source_Ptr
;
1733 Visible_Declarations
: List_Id
;
1734 Private_Declarations
: List_Id
:= No_List
;
1735 End_Label
: Node_Id
)
1738 N
: constant Node_Id
:=
1739 New_Node
(N_Task_Definition
, Sloc
);
1741 Set_Visible_Declarations
(N
, Visible_Declarations
);
1742 Set_Private_Declarations
(N
, Private_Declarations
);
1743 Set_End_Label
(N
, End_Label
);
1745 end Make_Task_Definition
;
1747 function Make_Task_Body
(Sloc
: Source_Ptr
;
1748 Defining_Identifier
: Node_Id
;
1749 Declarations
: List_Id
;
1750 Handled_Statement_Sequence
: Node_Id
)
1753 N
: constant Node_Id
:=
1754 New_Node
(N_Task_Body
, Sloc
);
1756 Set_Defining_Identifier
(N
, Defining_Identifier
);
1757 Set_Declarations
(N
, Declarations
);
1758 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1762 function Make_Protected_Type_Declaration
(Sloc
: Source_Ptr
;
1763 Defining_Identifier
: Node_Id
;
1764 Discriminant_Specifications
: List_Id
:= No_List
;
1765 Protected_Definition
: Node_Id
)
1768 N
: constant Node_Id
:=
1769 New_Node
(N_Protected_Type_Declaration
, Sloc
);
1771 Set_Defining_Identifier
(N
, Defining_Identifier
);
1772 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
1773 Set_Protected_Definition
(N
, Protected_Definition
);
1775 end Make_Protected_Type_Declaration
;
1777 function Make_Single_Protected_Declaration
(Sloc
: Source_Ptr
;
1778 Defining_Identifier
: Node_Id
;
1779 Protected_Definition
: Node_Id
)
1782 N
: constant Node_Id
:=
1783 New_Node
(N_Single_Protected_Declaration
, Sloc
);
1785 Set_Defining_Identifier
(N
, Defining_Identifier
);
1786 Set_Protected_Definition
(N
, Protected_Definition
);
1788 end Make_Single_Protected_Declaration
;
1790 function Make_Protected_Definition
(Sloc
: Source_Ptr
;
1791 Visible_Declarations
: List_Id
;
1792 Private_Declarations
: List_Id
:= No_List
;
1793 End_Label
: Node_Id
)
1796 N
: constant Node_Id
:=
1797 New_Node
(N_Protected_Definition
, Sloc
);
1799 Set_Visible_Declarations
(N
, Visible_Declarations
);
1800 Set_Private_Declarations
(N
, Private_Declarations
);
1801 Set_End_Label
(N
, End_Label
);
1803 end Make_Protected_Definition
;
1805 function Make_Protected_Body
(Sloc
: Source_Ptr
;
1806 Defining_Identifier
: Node_Id
;
1807 Declarations
: List_Id
;
1808 End_Label
: Node_Id
)
1811 N
: constant Node_Id
:=
1812 New_Node
(N_Protected_Body
, Sloc
);
1814 Set_Defining_Identifier
(N
, Defining_Identifier
);
1815 Set_Declarations
(N
, Declarations
);
1816 Set_End_Label
(N
, End_Label
);
1818 end Make_Protected_Body
;
1820 function Make_Entry_Declaration
(Sloc
: Source_Ptr
;
1821 Defining_Identifier
: Node_Id
;
1822 Discrete_Subtype_Definition
: Node_Id
:= Empty
;
1823 Parameter_Specifications
: List_Id
:= No_List
)
1826 N
: constant Node_Id
:=
1827 New_Node
(N_Entry_Declaration
, Sloc
);
1829 Set_Defining_Identifier
(N
, Defining_Identifier
);
1830 Set_Discrete_Subtype_Definition
(N
, Discrete_Subtype_Definition
);
1831 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
1833 end Make_Entry_Declaration
;
1835 function Make_Accept_Statement
(Sloc
: Source_Ptr
;
1836 Entry_Direct_Name
: Node_Id
;
1837 Entry_Index
: Node_Id
:= Empty
;
1838 Parameter_Specifications
: List_Id
:= No_List
;
1839 Handled_Statement_Sequence
: Node_Id
;
1840 Declarations
: List_Id
:= No_List
)
1843 N
: constant Node_Id
:=
1844 New_Node
(N_Accept_Statement
, Sloc
);
1846 Set_Entry_Direct_Name
(N
, Entry_Direct_Name
);
1847 Set_Entry_Index
(N
, Entry_Index
);
1848 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
1849 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1850 Set_Declarations
(N
, Declarations
);
1852 end Make_Accept_Statement
;
1854 function Make_Entry_Body
(Sloc
: Source_Ptr
;
1855 Defining_Identifier
: Node_Id
;
1856 Entry_Body_Formal_Part
: Node_Id
;
1857 Declarations
: List_Id
;
1858 Handled_Statement_Sequence
: Node_Id
)
1861 N
: constant Node_Id
:=
1862 New_Node
(N_Entry_Body
, Sloc
);
1864 Set_Defining_Identifier
(N
, Defining_Identifier
);
1865 Set_Entry_Body_Formal_Part
(N
, Entry_Body_Formal_Part
);
1866 Set_Declarations
(N
, Declarations
);
1867 Set_Handled_Statement_Sequence
(N
, Handled_Statement_Sequence
);
1869 end Make_Entry_Body
;
1871 function Make_Entry_Body_Formal_Part
(Sloc
: Source_Ptr
;
1872 Entry_Index_Specification
: Node_Id
:= Empty
;
1873 Parameter_Specifications
: List_Id
:= No_List
;
1874 Condition
: Node_Id
)
1877 N
: constant Node_Id
:=
1878 New_Node
(N_Entry_Body_Formal_Part
, Sloc
);
1880 Set_Entry_Index_Specification
(N
, Entry_Index_Specification
);
1881 Set_Parameter_Specifications
(N
, Parameter_Specifications
);
1882 Set_Condition
(N
, Condition
);
1884 end Make_Entry_Body_Formal_Part
;
1886 function Make_Entry_Index_Specification
(Sloc
: Source_Ptr
;
1887 Defining_Identifier
: Node_Id
;
1888 Discrete_Subtype_Definition
: Node_Id
)
1891 N
: constant Node_Id
:=
1892 New_Node
(N_Entry_Index_Specification
, Sloc
);
1894 Set_Defining_Identifier
(N
, Defining_Identifier
);
1895 Set_Discrete_Subtype_Definition
(N
, Discrete_Subtype_Definition
);
1897 end Make_Entry_Index_Specification
;
1899 function Make_Entry_Call_Statement
(Sloc
: Source_Ptr
;
1901 Parameter_Associations
: List_Id
:= No_List
)
1904 N
: constant Node_Id
:=
1905 New_Node
(N_Entry_Call_Statement
, Sloc
);
1908 Set_Parameter_Associations
(N
, Parameter_Associations
);
1910 end Make_Entry_Call_Statement
;
1912 function Make_Requeue_Statement
(Sloc
: Source_Ptr
;
1914 Abort_Present
: Boolean := False)
1917 N
: constant Node_Id
:=
1918 New_Node
(N_Requeue_Statement
, Sloc
);
1921 Set_Abort_Present
(N
, Abort_Present
);
1923 end Make_Requeue_Statement
;
1925 function Make_Delay_Until_Statement
(Sloc
: Source_Ptr
;
1926 Expression
: Node_Id
)
1929 N
: constant Node_Id
:=
1930 New_Node
(N_Delay_Until_Statement
, Sloc
);
1932 Set_Expression
(N
, Expression
);
1934 end Make_Delay_Until_Statement
;
1936 function Make_Delay_Relative_Statement
(Sloc
: Source_Ptr
;
1937 Expression
: Node_Id
)
1940 N
: constant Node_Id
:=
1941 New_Node
(N_Delay_Relative_Statement
, Sloc
);
1943 Set_Expression
(N
, Expression
);
1945 end Make_Delay_Relative_Statement
;
1947 function Make_Selective_Accept
(Sloc
: Source_Ptr
;
1948 Select_Alternatives
: List_Id
;
1949 Else_Statements
: List_Id
:= No_List
)
1952 N
: constant Node_Id
:=
1953 New_Node
(N_Selective_Accept
, Sloc
);
1955 Set_Select_Alternatives
(N
, Select_Alternatives
);
1956 Set_Else_Statements
(N
, Else_Statements
);
1958 end Make_Selective_Accept
;
1960 function Make_Accept_Alternative
(Sloc
: Source_Ptr
;
1961 Accept_Statement
: Node_Id
;
1962 Condition
: Node_Id
:= Empty
;
1963 Statements
: List_Id
:= Empty_List
;
1964 Pragmas_Before
: List_Id
:= No_List
)
1967 N
: constant Node_Id
:=
1968 New_Node
(N_Accept_Alternative
, Sloc
);
1970 Set_Accept_Statement
(N
, Accept_Statement
);
1971 Set_Condition
(N
, Condition
);
1972 Set_Statements
(N
, Statements
);
1973 Set_Pragmas_Before
(N
, Pragmas_Before
);
1975 end Make_Accept_Alternative
;
1977 function Make_Delay_Alternative
(Sloc
: Source_Ptr
;
1978 Delay_Statement
: Node_Id
;
1979 Condition
: Node_Id
:= Empty
;
1980 Statements
: List_Id
:= Empty_List
;
1981 Pragmas_Before
: List_Id
:= No_List
)
1984 N
: constant Node_Id
:=
1985 New_Node
(N_Delay_Alternative
, Sloc
);
1987 Set_Delay_Statement
(N
, Delay_Statement
);
1988 Set_Condition
(N
, Condition
);
1989 Set_Statements
(N
, Statements
);
1990 Set_Pragmas_Before
(N
, Pragmas_Before
);
1992 end Make_Delay_Alternative
;
1994 function Make_Terminate_Alternative
(Sloc
: Source_Ptr
;
1995 Condition
: Node_Id
:= Empty
;
1996 Pragmas_Before
: List_Id
:= No_List
;
1997 Pragmas_After
: List_Id
:= No_List
)
2000 N
: constant Node_Id
:=
2001 New_Node
(N_Terminate_Alternative
, Sloc
);
2003 Set_Condition
(N
, Condition
);
2004 Set_Pragmas_Before
(N
, Pragmas_Before
);
2005 Set_Pragmas_After
(N
, Pragmas_After
);
2007 end Make_Terminate_Alternative
;
2009 function Make_Timed_Entry_Call
(Sloc
: Source_Ptr
;
2010 Entry_Call_Alternative
: Node_Id
;
2011 Delay_Alternative
: Node_Id
)
2014 N
: constant Node_Id
:=
2015 New_Node
(N_Timed_Entry_Call
, Sloc
);
2017 Set_Entry_Call_Alternative
(N
, Entry_Call_Alternative
);
2018 Set_Delay_Alternative
(N
, Delay_Alternative
);
2020 end Make_Timed_Entry_Call
;
2022 function Make_Entry_Call_Alternative
(Sloc
: Source_Ptr
;
2023 Entry_Call_Statement
: Node_Id
;
2024 Statements
: List_Id
:= Empty_List
;
2025 Pragmas_Before
: List_Id
:= No_List
)
2028 N
: constant Node_Id
:=
2029 New_Node
(N_Entry_Call_Alternative
, Sloc
);
2031 Set_Entry_Call_Statement
(N
, Entry_Call_Statement
);
2032 Set_Statements
(N
, Statements
);
2033 Set_Pragmas_Before
(N
, Pragmas_Before
);
2035 end Make_Entry_Call_Alternative
;
2037 function Make_Conditional_Entry_Call
(Sloc
: Source_Ptr
;
2038 Entry_Call_Alternative
: Node_Id
;
2039 Else_Statements
: List_Id
)
2042 N
: constant Node_Id
:=
2043 New_Node
(N_Conditional_Entry_Call
, Sloc
);
2045 Set_Entry_Call_Alternative
(N
, Entry_Call_Alternative
);
2046 Set_Else_Statements
(N
, Else_Statements
);
2048 end Make_Conditional_Entry_Call
;
2050 function Make_Asynchronous_Select
(Sloc
: Source_Ptr
;
2051 Triggering_Alternative
: Node_Id
;
2052 Abortable_Part
: Node_Id
)
2055 N
: constant Node_Id
:=
2056 New_Node
(N_Asynchronous_Select
, Sloc
);
2058 Set_Triggering_Alternative
(N
, Triggering_Alternative
);
2059 Set_Abortable_Part
(N
, Abortable_Part
);
2061 end Make_Asynchronous_Select
;
2063 function Make_Triggering_Alternative
(Sloc
: Source_Ptr
;
2064 Triggering_Statement
: Node_Id
;
2065 Statements
: List_Id
:= Empty_List
;
2066 Pragmas_Before
: List_Id
:= No_List
)
2069 N
: constant Node_Id
:=
2070 New_Node
(N_Triggering_Alternative
, Sloc
);
2072 Set_Triggering_Statement
(N
, Triggering_Statement
);
2073 Set_Statements
(N
, Statements
);
2074 Set_Pragmas_Before
(N
, Pragmas_Before
);
2076 end Make_Triggering_Alternative
;
2078 function Make_Abortable_Part
(Sloc
: Source_Ptr
;
2079 Statements
: List_Id
)
2082 N
: constant Node_Id
:=
2083 New_Node
(N_Abortable_Part
, Sloc
);
2085 Set_Statements
(N
, Statements
);
2087 end Make_Abortable_Part
;
2089 function Make_Abort_Statement
(Sloc
: Source_Ptr
;
2093 N
: constant Node_Id
:=
2094 New_Node
(N_Abort_Statement
, Sloc
);
2096 Set_Names
(N
, Names
);
2098 end Make_Abort_Statement
;
2100 function Make_Compilation_Unit
(Sloc
: Source_Ptr
;
2101 Context_Items
: List_Id
;
2102 Private_Present
: Boolean := False;
2104 Aux_Decls_Node
: Node_Id
)
2107 N
: constant Node_Id
:=
2108 New_Node
(N_Compilation_Unit
, Sloc
);
2110 Set_Context_Items
(N
, Context_Items
);
2111 Set_Private_Present
(N
, Private_Present
);
2113 Set_Aux_Decls_Node
(N
, Aux_Decls_Node
);
2115 end Make_Compilation_Unit
;
2117 function Make_Compilation_Unit_Aux
(Sloc
: Source_Ptr
;
2118 Declarations
: List_Id
:= No_List
;
2119 Actions
: List_Id
:= No_List
;
2120 Pragmas_After
: List_Id
:= No_List
;
2121 Config_Pragmas
: List_Id
:= Empty_List
)
2124 N
: constant Node_Id
:=
2125 New_Node
(N_Compilation_Unit_Aux
, Sloc
);
2127 Set_Declarations
(N
, Declarations
);
2128 Set_Actions
(N
, Actions
);
2129 Set_Pragmas_After
(N
, Pragmas_After
);
2130 Set_Config_Pragmas
(N
, Config_Pragmas
);
2132 end Make_Compilation_Unit_Aux
;
2134 function Make_With_Clause
(Sloc
: Source_Ptr
;
2136 First_Name
: Boolean := True;
2137 Last_Name
: Boolean := True;
2138 Limited_Present
: Boolean := False)
2141 N
: constant Node_Id
:=
2142 New_Node
(N_With_Clause
, Sloc
);
2145 Set_First_Name
(N
, First_Name
);
2146 Set_Last_Name
(N
, Last_Name
);
2147 Set_Limited_Present
(N
, Limited_Present
);
2149 end Make_With_Clause
;
2151 function Make_With_Type_Clause
(Sloc
: Source_Ptr
;
2153 Tagged_Present
: Boolean := False)
2156 N
: constant Node_Id
:=
2157 New_Node
(N_With_Type_Clause
, Sloc
);
2160 Set_Tagged_Present
(N
, Tagged_Present
);
2162 end Make_With_Type_Clause
;
2164 function Make_Subprogram_Body_Stub
(Sloc
: Source_Ptr
;
2165 Specification
: Node_Id
)
2168 N
: constant Node_Id
:=
2169 New_Node
(N_Subprogram_Body_Stub
, Sloc
);
2171 Set_Specification
(N
, Specification
);
2173 end Make_Subprogram_Body_Stub
;
2175 function Make_Package_Body_Stub
(Sloc
: Source_Ptr
;
2176 Defining_Identifier
: Node_Id
)
2179 N
: constant Node_Id
:=
2180 New_Node
(N_Package_Body_Stub
, Sloc
);
2182 Set_Defining_Identifier
(N
, Defining_Identifier
);
2184 end Make_Package_Body_Stub
;
2186 function Make_Task_Body_Stub
(Sloc
: Source_Ptr
;
2187 Defining_Identifier
: Node_Id
)
2190 N
: constant Node_Id
:=
2191 New_Node
(N_Task_Body_Stub
, Sloc
);
2193 Set_Defining_Identifier
(N
, Defining_Identifier
);
2195 end Make_Task_Body_Stub
;
2197 function Make_Protected_Body_Stub
(Sloc
: Source_Ptr
;
2198 Defining_Identifier
: Node_Id
)
2201 N
: constant Node_Id
:=
2202 New_Node
(N_Protected_Body_Stub
, Sloc
);
2204 Set_Defining_Identifier
(N
, Defining_Identifier
);
2206 end Make_Protected_Body_Stub
;
2208 function Make_Subunit
(Sloc
: Source_Ptr
;
2210 Proper_Body
: Node_Id
)
2213 N
: constant Node_Id
:=
2214 New_Node
(N_Subunit
, Sloc
);
2217 Set_Proper_Body
(N
, Proper_Body
);
2221 function Make_Exception_Declaration
(Sloc
: Source_Ptr
;
2222 Defining_Identifier
: Node_Id
)
2225 N
: constant Node_Id
:=
2226 New_Node
(N_Exception_Declaration
, Sloc
);
2228 Set_Defining_Identifier
(N
, Defining_Identifier
);
2230 end Make_Exception_Declaration
;
2232 function Make_Handled_Sequence_Of_Statements
(Sloc
: Source_Ptr
;
2233 Statements
: List_Id
;
2234 End_Label
: Node_Id
:= Empty
;
2235 Exception_Handlers
: List_Id
:= No_List
;
2236 At_End_Proc
: Node_Id
:= Empty
)
2239 N
: constant Node_Id
:=
2240 New_Node
(N_Handled_Sequence_Of_Statements
, Sloc
);
2242 Set_Statements
(N
, Statements
);
2243 Set_End_Label
(N
, End_Label
);
2244 Set_Exception_Handlers
(N
, Exception_Handlers
);
2245 Set_At_End_Proc
(N
, At_End_Proc
);
2247 end Make_Handled_Sequence_Of_Statements
;
2249 function Make_Exception_Handler
(Sloc
: Source_Ptr
;
2250 Choice_Parameter
: Node_Id
:= Empty
;
2251 Exception_Choices
: List_Id
;
2252 Statements
: List_Id
)
2255 N
: constant Node_Id
:=
2256 New_Node
(N_Exception_Handler
, Sloc
);
2258 Set_Choice_Parameter
(N
, Choice_Parameter
);
2259 Set_Exception_Choices
(N
, Exception_Choices
);
2260 Set_Statements
(N
, Statements
);
2262 end Make_Exception_Handler
;
2264 function Make_Raise_Statement
(Sloc
: Source_Ptr
;
2265 Name
: Node_Id
:= Empty
)
2268 N
: constant Node_Id
:=
2269 New_Node
(N_Raise_Statement
, Sloc
);
2273 end Make_Raise_Statement
;
2275 function Make_Generic_Subprogram_Declaration
(Sloc
: Source_Ptr
;
2276 Specification
: Node_Id
;
2277 Generic_Formal_Declarations
: List_Id
)
2280 N
: constant Node_Id
:=
2281 New_Node
(N_Generic_Subprogram_Declaration
, Sloc
);
2283 Set_Specification
(N
, Specification
);
2284 Set_Generic_Formal_Declarations
(N
, Generic_Formal_Declarations
);
2286 end Make_Generic_Subprogram_Declaration
;
2288 function Make_Generic_Package_Declaration
(Sloc
: Source_Ptr
;
2289 Specification
: Node_Id
;
2290 Generic_Formal_Declarations
: List_Id
)
2293 N
: constant Node_Id
:=
2294 New_Node
(N_Generic_Package_Declaration
, Sloc
);
2296 Set_Specification
(N
, Specification
);
2297 Set_Generic_Formal_Declarations
(N
, Generic_Formal_Declarations
);
2299 end Make_Generic_Package_Declaration
;
2301 function Make_Package_Instantiation
(Sloc
: Source_Ptr
;
2302 Defining_Unit_Name
: Node_Id
;
2304 Generic_Associations
: List_Id
:= No_List
)
2307 N
: constant Node_Id
:=
2308 New_Node
(N_Package_Instantiation
, Sloc
);
2310 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
2312 Set_Generic_Associations
(N
, Generic_Associations
);
2314 end Make_Package_Instantiation
;
2316 function Make_Procedure_Instantiation
(Sloc
: Source_Ptr
;
2317 Defining_Unit_Name
: Node_Id
;
2319 Generic_Associations
: List_Id
:= No_List
)
2322 N
: constant Node_Id
:=
2323 New_Node
(N_Procedure_Instantiation
, Sloc
);
2325 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
2327 Set_Generic_Associations
(N
, Generic_Associations
);
2329 end Make_Procedure_Instantiation
;
2331 function Make_Function_Instantiation
(Sloc
: Source_Ptr
;
2332 Defining_Unit_Name
: Node_Id
;
2334 Generic_Associations
: List_Id
:= No_List
)
2337 N
: constant Node_Id
:=
2338 New_Node
(N_Function_Instantiation
, Sloc
);
2340 Set_Defining_Unit_Name
(N
, Defining_Unit_Name
);
2342 Set_Generic_Associations
(N
, Generic_Associations
);
2344 end Make_Function_Instantiation
;
2346 function Make_Generic_Association
(Sloc
: Source_Ptr
;
2347 Selector_Name
: Node_Id
:= Empty
;
2348 Explicit_Generic_Actual_Parameter
: Node_Id
)
2351 N
: constant Node_Id
:=
2352 New_Node
(N_Generic_Association
, Sloc
);
2354 Set_Selector_Name
(N
, Selector_Name
);
2355 Set_Explicit_Generic_Actual_Parameter
2356 (N
, Explicit_Generic_Actual_Parameter
);
2358 end Make_Generic_Association
;
2360 function Make_Formal_Object_Declaration
(Sloc
: Source_Ptr
;
2361 Defining_Identifier
: Node_Id
;
2362 In_Present
: Boolean := False;
2363 Out_Present
: Boolean := False;
2364 Subtype_Mark
: Node_Id
;
2365 Expression
: Node_Id
:= Empty
)
2368 N
: constant Node_Id
:=
2369 New_Node
(N_Formal_Object_Declaration
, Sloc
);
2371 Set_Defining_Identifier
(N
, Defining_Identifier
);
2372 Set_In_Present
(N
, In_Present
);
2373 Set_Out_Present
(N
, Out_Present
);
2374 Set_Subtype_Mark
(N
, Subtype_Mark
);
2375 Set_Expression
(N
, Expression
);
2377 end Make_Formal_Object_Declaration
;
2379 function Make_Formal_Type_Declaration
(Sloc
: Source_Ptr
;
2380 Defining_Identifier
: Node_Id
;
2381 Formal_Type_Definition
: Node_Id
;
2382 Discriminant_Specifications
: List_Id
:= No_List
;
2383 Unknown_Discriminants_Present
: Boolean := False)
2386 N
: constant Node_Id
:=
2387 New_Node
(N_Formal_Type_Declaration
, Sloc
);
2389 Set_Defining_Identifier
(N
, Defining_Identifier
);
2390 Set_Formal_Type_Definition
(N
, Formal_Type_Definition
);
2391 Set_Discriminant_Specifications
(N
, Discriminant_Specifications
);
2392 Set_Unknown_Discriminants_Present
2393 (N
, Unknown_Discriminants_Present
);
2395 end Make_Formal_Type_Declaration
;
2397 function Make_Formal_Private_Type_Definition
(Sloc
: Source_Ptr
;
2398 Abstract_Present
: Boolean := False;
2399 Tagged_Present
: Boolean := False;
2400 Limited_Present
: Boolean := False)
2403 N
: constant Node_Id
:=
2404 New_Node
(N_Formal_Private_Type_Definition
, Sloc
);
2406 Set_Abstract_Present
(N
, Abstract_Present
);
2407 Set_Tagged_Present
(N
, Tagged_Present
);
2408 Set_Limited_Present
(N
, Limited_Present
);
2410 end Make_Formal_Private_Type_Definition
;
2412 function Make_Formal_Derived_Type_Definition
(Sloc
: Source_Ptr
;
2413 Subtype_Mark
: Node_Id
;
2414 Private_Present
: Boolean := False;
2415 Abstract_Present
: Boolean := False)
2418 N
: constant Node_Id
:=
2419 New_Node
(N_Formal_Derived_Type_Definition
, Sloc
);
2421 Set_Subtype_Mark
(N
, Subtype_Mark
);
2422 Set_Private_Present
(N
, Private_Present
);
2423 Set_Abstract_Present
(N
, Abstract_Present
);
2425 end Make_Formal_Derived_Type_Definition
;
2427 function Make_Formal_Discrete_Type_Definition
(Sloc
: Source_Ptr
)
2430 N
: constant Node_Id
:=
2431 New_Node
(N_Formal_Discrete_Type_Definition
, Sloc
);
2434 end Make_Formal_Discrete_Type_Definition
;
2436 function Make_Formal_Signed_Integer_Type_Definition
(Sloc
: Source_Ptr
)
2439 N
: constant Node_Id
:=
2440 New_Node
(N_Formal_Signed_Integer_Type_Definition
, Sloc
);
2443 end Make_Formal_Signed_Integer_Type_Definition
;
2445 function Make_Formal_Modular_Type_Definition
(Sloc
: Source_Ptr
)
2448 N
: constant Node_Id
:=
2449 New_Node
(N_Formal_Modular_Type_Definition
, Sloc
);
2452 end Make_Formal_Modular_Type_Definition
;
2454 function Make_Formal_Floating_Point_Definition
(Sloc
: Source_Ptr
)
2457 N
: constant Node_Id
:=
2458 New_Node
(N_Formal_Floating_Point_Definition
, Sloc
);
2461 end Make_Formal_Floating_Point_Definition
;
2463 function Make_Formal_Ordinary_Fixed_Point_Definition
(Sloc
: Source_Ptr
)
2466 N
: constant Node_Id
:=
2467 New_Node
(N_Formal_Ordinary_Fixed_Point_Definition
, Sloc
);
2470 end Make_Formal_Ordinary_Fixed_Point_Definition
;
2472 function Make_Formal_Decimal_Fixed_Point_Definition
(Sloc
: Source_Ptr
)
2475 N
: constant Node_Id
:=
2476 New_Node
(N_Formal_Decimal_Fixed_Point_Definition
, Sloc
);
2479 end Make_Formal_Decimal_Fixed_Point_Definition
;
2481 function Make_Formal_Subprogram_Declaration
(Sloc
: Source_Ptr
;
2482 Specification
: Node_Id
;
2483 Default_Name
: Node_Id
:= Empty
;
2484 Box_Present
: Boolean := False)
2487 N
: constant Node_Id
:=
2488 New_Node
(N_Formal_Subprogram_Declaration
, Sloc
);
2490 Set_Specification
(N
, Specification
);
2491 Set_Default_Name
(N
, Default_Name
);
2492 Set_Box_Present
(N
, Box_Present
);
2494 end Make_Formal_Subprogram_Declaration
;
2496 function Make_Formal_Package_Declaration
(Sloc
: Source_Ptr
;
2497 Defining_Identifier
: Node_Id
;
2499 Generic_Associations
: List_Id
:= No_List
;
2500 Box_Present
: Boolean := False)
2503 N
: constant Node_Id
:=
2504 New_Node
(N_Formal_Package_Declaration
, Sloc
);
2506 Set_Defining_Identifier
(N
, Defining_Identifier
);
2508 Set_Generic_Associations
(N
, Generic_Associations
);
2509 Set_Box_Present
(N
, Box_Present
);
2511 end Make_Formal_Package_Declaration
;
2513 function Make_Attribute_Definition_Clause
(Sloc
: Source_Ptr
;
2516 Expression
: Node_Id
)
2519 N
: constant Node_Id
:=
2520 New_Node
(N_Attribute_Definition_Clause
, Sloc
);
2523 Set_Chars
(N
, Chars
);
2524 Set_Expression
(N
, Expression
);
2526 end Make_Attribute_Definition_Clause
;
2528 function Make_Enumeration_Representation_Clause
(Sloc
: Source_Ptr
;
2529 Identifier
: Node_Id
;
2530 Array_Aggregate
: Node_Id
)
2533 N
: constant Node_Id
:=
2534 New_Node
(N_Enumeration_Representation_Clause
, Sloc
);
2536 Set_Identifier
(N
, Identifier
);
2537 Set_Array_Aggregate
(N
, Array_Aggregate
);
2539 end Make_Enumeration_Representation_Clause
;
2541 function Make_Record_Representation_Clause
(Sloc
: Source_Ptr
;
2542 Identifier
: Node_Id
;
2543 Mod_Clause
: Node_Id
:= Empty
;
2544 Component_Clauses
: List_Id
)
2547 N
: constant Node_Id
:=
2548 New_Node
(N_Record_Representation_Clause
, Sloc
);
2550 Set_Identifier
(N
, Identifier
);
2551 Set_Mod_Clause
(N
, Mod_Clause
);
2552 Set_Component_Clauses
(N
, Component_Clauses
);
2554 end Make_Record_Representation_Clause
;
2556 function Make_Component_Clause
(Sloc
: Source_Ptr
;
2557 Component_Name
: Node_Id
;
2559 First_Bit
: Node_Id
;
2563 N
: constant Node_Id
:=
2564 New_Node
(N_Component_Clause
, Sloc
);
2566 Set_Component_Name
(N
, Component_Name
);
2567 Set_Position
(N
, Position
);
2568 Set_First_Bit
(N
, First_Bit
);
2569 Set_Last_Bit
(N
, Last_Bit
);
2571 end Make_Component_Clause
;
2573 function Make_Code_Statement
(Sloc
: Source_Ptr
;
2574 Expression
: Node_Id
)
2577 N
: constant Node_Id
:=
2578 New_Node
(N_Code_Statement
, Sloc
);
2580 Set_Expression
(N
, Expression
);
2582 end Make_Code_Statement
;
2584 function Make_Op_Rotate_Left
(Sloc
: Source_Ptr
;
2585 Left_Opnd
: Node_Id
;
2586 Right_Opnd
: Node_Id
)
2589 N
: constant Node_Id
:=
2590 New_Node
(N_Op_Rotate_Left
, Sloc
);
2592 Set_Left_Opnd
(N
, Left_Opnd
);
2593 Set_Right_Opnd
(N
, Right_Opnd
);
2594 Set_Chars
(N
, Name_Rotate_Left
);
2595 Set_Entity
(N
, Standard_Op_Rotate_Left
);
2597 end Make_Op_Rotate_Left
;
2599 function Make_Op_Rotate_Right
(Sloc
: Source_Ptr
;
2600 Left_Opnd
: Node_Id
;
2601 Right_Opnd
: Node_Id
)
2604 N
: constant Node_Id
:=
2605 New_Node
(N_Op_Rotate_Right
, Sloc
);
2607 Set_Left_Opnd
(N
, Left_Opnd
);
2608 Set_Right_Opnd
(N
, Right_Opnd
);
2609 Set_Chars
(N
, Name_Rotate_Right
);
2610 Set_Entity
(N
, Standard_Op_Rotate_Right
);
2612 end Make_Op_Rotate_Right
;
2614 function Make_Op_Shift_Left
(Sloc
: Source_Ptr
;
2615 Left_Opnd
: Node_Id
;
2616 Right_Opnd
: Node_Id
)
2619 N
: constant Node_Id
:=
2620 New_Node
(N_Op_Shift_Left
, Sloc
);
2622 Set_Left_Opnd
(N
, Left_Opnd
);
2623 Set_Right_Opnd
(N
, Right_Opnd
);
2624 Set_Chars
(N
, Name_Shift_Left
);
2625 Set_Entity
(N
, Standard_Op_Shift_Left
);
2627 end Make_Op_Shift_Left
;
2629 function Make_Op_Shift_Right_Arithmetic
(Sloc
: Source_Ptr
;
2630 Left_Opnd
: Node_Id
;
2631 Right_Opnd
: Node_Id
)
2634 N
: constant Node_Id
:=
2635 New_Node
(N_Op_Shift_Right_Arithmetic
, Sloc
);
2637 Set_Left_Opnd
(N
, Left_Opnd
);
2638 Set_Right_Opnd
(N
, Right_Opnd
);
2639 Set_Chars
(N
, Name_Shift_Right_Arithmetic
);
2640 Set_Entity
(N
, Standard_Op_Shift_Right_Arithmetic
);
2642 end Make_Op_Shift_Right_Arithmetic
;
2644 function Make_Op_Shift_Right
(Sloc
: Source_Ptr
;
2645 Left_Opnd
: Node_Id
;
2646 Right_Opnd
: Node_Id
)
2649 N
: constant Node_Id
:=
2650 New_Node
(N_Op_Shift_Right
, Sloc
);
2652 Set_Left_Opnd
(N
, Left_Opnd
);
2653 Set_Right_Opnd
(N
, Right_Opnd
);
2654 Set_Chars
(N
, Name_Shift_Right
);
2655 Set_Entity
(N
, Standard_Op_Shift_Right
);
2657 end Make_Op_Shift_Right
;
2659 function Make_Delta_Constraint
(Sloc
: Source_Ptr
;
2660 Delta_Expression
: Node_Id
;
2661 Range_Constraint
: Node_Id
:= Empty
)
2664 N
: constant Node_Id
:=
2665 New_Node
(N_Delta_Constraint
, Sloc
);
2667 Set_Delta_Expression
(N
, Delta_Expression
);
2668 Set_Range_Constraint
(N
, Range_Constraint
);
2670 end Make_Delta_Constraint
;
2672 function Make_At_Clause
(Sloc
: Source_Ptr
;
2673 Identifier
: Node_Id
;
2674 Expression
: Node_Id
)
2677 N
: constant Node_Id
:=
2678 New_Node
(N_At_Clause
, Sloc
);
2680 Set_Identifier
(N
, Identifier
);
2681 Set_Expression
(N
, Expression
);
2685 function Make_Mod_Clause
(Sloc
: Source_Ptr
;
2686 Expression
: Node_Id
;
2687 Pragmas_Before
: List_Id
)
2690 N
: constant Node_Id
:=
2691 New_Node
(N_Mod_Clause
, Sloc
);
2693 Set_Expression
(N
, Expression
);
2694 Set_Pragmas_Before
(N
, Pragmas_Before
);
2696 end Make_Mod_Clause
;
2698 function Make_Conditional_Expression
(Sloc
: Source_Ptr
;
2699 Expressions
: List_Id
)
2702 N
: constant Node_Id
:=
2703 New_Node
(N_Conditional_Expression
, Sloc
);
2705 Set_Expressions
(N
, Expressions
);
2707 end Make_Conditional_Expression
;
2709 function Make_Expanded_Name
(Sloc
: Source_Ptr
;
2712 Selector_Name
: Node_Id
)
2715 N
: constant Node_Id
:=
2716 New_Node
(N_Expanded_Name
, Sloc
);
2718 Set_Chars
(N
, Chars
);
2719 Set_Prefix
(N
, Prefix
);
2720 Set_Selector_Name
(N
, Selector_Name
);
2722 end Make_Expanded_Name
;
2724 function Make_Free_Statement
(Sloc
: Source_Ptr
;
2725 Expression
: Node_Id
)
2728 N
: constant Node_Id
:=
2729 New_Node
(N_Free_Statement
, Sloc
);
2731 Set_Expression
(N
, Expression
);
2733 end Make_Free_Statement
;
2735 function Make_Freeze_Entity
(Sloc
: Source_Ptr
;
2736 Actions
: List_Id
:= No_List
)
2739 N
: constant Node_Id
:=
2740 New_Node
(N_Freeze_Entity
, Sloc
);
2742 Set_Actions
(N
, Actions
);
2744 end Make_Freeze_Entity
;
2746 function Make_Implicit_Label_Declaration
(Sloc
: Source_Ptr
;
2747 Defining_Identifier
: Node_Id
)
2750 N
: constant Node_Id
:=
2751 New_Node
(N_Implicit_Label_Declaration
, Sloc
);
2753 Set_Defining_Identifier
(N
, Defining_Identifier
);
2755 end Make_Implicit_Label_Declaration
;
2757 function Make_Itype_Reference
(Sloc
: Source_Ptr
)
2760 N
: constant Node_Id
:=
2761 New_Node
(N_Itype_Reference
, Sloc
);
2764 end Make_Itype_Reference
;
2766 function Make_Raise_Constraint_Error
(Sloc
: Source_Ptr
;
2767 Condition
: Node_Id
:= Empty
;
2771 N
: constant Node_Id
:=
2772 New_Node
(N_Raise_Constraint_Error
, Sloc
);
2774 Set_Condition
(N
, Condition
);
2775 Set_Reason
(N
, Reason
);
2777 end Make_Raise_Constraint_Error
;
2779 function Make_Raise_Program_Error
(Sloc
: Source_Ptr
;
2780 Condition
: Node_Id
:= Empty
;
2784 N
: constant Node_Id
:=
2785 New_Node
(N_Raise_Program_Error
, Sloc
);
2787 Set_Condition
(N
, Condition
);
2788 Set_Reason
(N
, Reason
);
2790 end Make_Raise_Program_Error
;
2792 function Make_Raise_Storage_Error
(Sloc
: Source_Ptr
;
2793 Condition
: Node_Id
:= Empty
;
2797 N
: constant Node_Id
:=
2798 New_Node
(N_Raise_Storage_Error
, Sloc
);
2800 Set_Condition
(N
, Condition
);
2801 Set_Reason
(N
, Reason
);
2803 end Make_Raise_Storage_Error
;
2805 function Make_Reference
(Sloc
: Source_Ptr
;
2809 N
: constant Node_Id
:=
2810 New_Node
(N_Reference
, Sloc
);
2812 Set_Prefix
(N
, Prefix
);
2816 function Make_Subprogram_Info
(Sloc
: Source_Ptr
;
2817 Identifier
: Node_Id
)
2820 N
: constant Node_Id
:=
2821 New_Node
(N_Subprogram_Info
, Sloc
);
2823 Set_Identifier
(N
, Identifier
);
2825 end Make_Subprogram_Info
;
2827 function Make_Unchecked_Expression
(Sloc
: Source_Ptr
;
2828 Expression
: Node_Id
)
2831 N
: constant Node_Id
:=
2832 New_Node
(N_Unchecked_Expression
, Sloc
);
2834 Set_Expression
(N
, Expression
);
2836 end Make_Unchecked_Expression
;
2838 function Make_Unchecked_Type_Conversion
(Sloc
: Source_Ptr
;
2839 Subtype_Mark
: Node_Id
;
2840 Expression
: Node_Id
)
2843 N
: constant Node_Id
:=
2844 New_Node
(N_Unchecked_Type_Conversion
, Sloc
);
2846 Set_Subtype_Mark
(N
, Subtype_Mark
);
2847 Set_Expression
(N
, Expression
);
2849 end Make_Unchecked_Type_Conversion
;
2851 function Make_Validate_Unchecked_Conversion
(Sloc
: Source_Ptr
)
2854 N
: constant Node_Id
:=
2855 New_Node
(N_Validate_Unchecked_Conversion
, Sloc
);
2858 end Make_Validate_Unchecked_Conversion
;