1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
33 ------------------------------------------------------------------------------
35 -- This package defines the structure of the abstract syntax tree. The Tree
36 -- package provides a basic tree structure. Sinfo describes how this
37 -- structure is used to represent the syntax of an Ada program.
39 -- Note: the grammar used here is taken from Version 5.95 of the RM, dated
40 -- November 1994. The grammar in the RM is followed very closely in the tree
41 -- design, and is repeated as part of this source file.
43 -- The tree contains not only the full syntactic representation of the
44 -- program, but also the results of semantic analysis. In particular, the
45 -- nodes for defining identifiers, defining character literals and defining
46 -- operator symbols, collectively referred to as entities, represent what
47 -- would normally be regarded as the symbol table information. In addition
48 -- a number of the tree nodes contain semantic information.
50 -- WARNING: There is a C version of this package. Any changes to this
51 -- source file must be properly reflected in this C header file sinfo.h
52 -- which is created automatically from sinfo.ads using xsinfo.spt.
54 with Types
; use Types
;
55 with Uintp
; use Uintp
;
56 with Urealp
; use Urealp
;
60 ---------------------------------
61 -- Making Changes to This File --
62 ---------------------------------
64 -- If changes are made to this file, a number of related steps must be
65 -- carried out to ensure consistency. First, if a field access function
66 -- is added, it appears in seven places:
68 -- The documentation associated with the node
69 -- The spec of the access function in sinfo.ads
70 -- The body of the access function in sinfo.adb
71 -- The pragma Inline at the end of sinfo.ads for the access function
72 -- The spec of the set procedure in sinfo.ads
73 -- The body of the set procedure in sinfo.adb
74 -- The pragma Inline at the end of sinfo.ads for the set procedure
76 -- The field chosen must be consistent in all places, and, for a node
77 -- that is a subexpression, must not overlap any of the standard
78 -- expression fields. In the body, the calls to the Dcheck_Node debug
79 -- procedure will need cross-references adding in alphabetical order.
81 -- In addition, if any of the standard expression fields is changed, then
82 -- the utiliy program which creates the Treeprs spec (in file treeprs.ads)
83 -- must be updated appropriately, since it special cases expression fields.
85 -- If a new tree node is added, then the following changes are made
87 -- Add it to the documentation in the appropriate place
88 -- Add its fields to this documentation section
89 -- Define it in the appropriate classification in Node_Kind
90 -- In the body (sinfo), add entries to the Dcheck calls for all
91 -- its fields (except standard expression fields) to include
92 -- the new node in the debug cross-reference list
93 -- Add an appropriate section to the case statement in sprint.adb
94 -- Add an appropriate section to the case statement in sem.adb
95 -- Add an appropraite section to the case statement in exp_util.adb
96 -- (Insert_Actions procedure)
97 -- For a subexpression, add an appropriate sections to the case
98 -- statement in sem_eval.adb
99 -- For a subexpression, add an appropriate sections to the case
100 -- statement in sem_res.adb
102 -- Finally, four utility programs must be run:
104 -- Run CSinfo to check that you have made the changes consistently.
105 -- It checks most of the rules given above, with clear error messages.
106 -- This utility reads sinfo.ads and sinfo.adb and generates a report
107 -- to standard output.
109 -- Run XSinfo to create a-sinfo.h, the corresponding C header. This
110 -- utility reads sinfo.ads and generates a-sinfo.h. Note that it
111 -- does not need to read sinfo.adb, since the contents of the body
112 -- are algorithmically determinable from the spec.
114 -- Run XTreeprs to create treeprs.ads, an updated version of
115 -- the module that is used to drive the tree print routine. This
116 -- utility reads (but does not modify) treeprs.adt, the template
117 -- that provides the basic structure of the file, and then fills
118 -- in the data from the comments in sinfo.ads.
120 -- Run XNmake to create nmake.ads and nmake.adb, the package body
121 -- and spec of the Nmake package which contains functions for
122 -- constructing nodes.
124 -- Note: sometime we could write a utility that actually generated the
125 -- body of sinfo from the spec instead of simply checking it, since, as
126 -- noted above, the contents of the body can be determined from the spec.
128 --------------------------------
129 -- Implicit Nodes in the Tree --
130 --------------------------------
132 -- Generally the structure of the tree very closely follows the grammar
133 -- as defined in the RM. However, certain nodes are omitted to save
134 -- space and simplify semantic processing. Two general classes of such
135 -- omitted nodes are as follows:
137 -- If the only possibilities for a non-terminal are one or more other
138 -- non terminals (i.e. the rule is a "skinny" rule), then usually the
139 -- corresponding node is omitted from the tree, and the target construct
140 -- appears directly. For example, a real type definition is either a
141 -- floating point definition or a fixed point definition. No explicit
142 -- node appears for real type definition. Instead either the floating
143 -- point definition or fixed point definition appears directly.
145 -- If a non-terminal corresponds to a list of some other non-terminal
146 -- (possibly with separating punctuation), then usually it is omitted
147 -- from the tree, and a list of components appears instead. For
148 -- example, sequence of statements does not appear explicitly in the
149 -- tree. Instead a list of statements appears directly.
151 -- Some additional cases of omitted nodes occur and are documented
152 -- individually. In particular, many nodes are omitted in the tree
153 -- generated for an expression.
155 -------------------------------------------
156 -- Handling of Defining Identifier Lists --
157 -------------------------------------------
159 -- In several declarative forms in the syntax, lists of defining
160 -- identifiers appear (object declarations, component declarations,
161 -- number declarations etc.)
163 -- The semantics of such statements are equivalent to a series of
164 -- identical declarations of single defining identifiers (except that
165 -- conformance checks require the same grouping of identifiers in the
168 -- To simplify semantic processing, the parser breaks down such multiple
169 -- declaration cases into sequences of single declarations, duplicating
170 -- type and initialization information as required. The flags More_Ids
171 -- and Prev_Ids are used to record the original form of the source in
172 -- the case where the original source used a list of names, More_Ids
173 -- being set on all but the last name and Prev_Ids being set on all
174 -- but the first name. These flags are used to reconstruct the original
175 -- source (e.g. in the Sprint package), and also are included in the
176 -- conformance checks, but otherwise have no semantic significance.
178 -- Note: the reason that we use More_Ids and Prev_Ids rather than
179 -- First_Name and Last_Name flags is so that the flags are off in the
180 -- normal one identifier case, which minimizes tree print output.
182 -----------------------
183 -- Use of Node Lists --
184 -----------------------
186 -- With a few exceptions, if a construction of the form {non-terminal}
187 -- appears in the tree, lists are used in the corresponding tree node
188 -- (see package Nlists for handling of node lists). In this case a field
189 -- of the parent node points to a list of nodes for the non-terminal. The
190 -- field name for such fields has a plural name which always ends in "s".
191 -- For example, a case statement has a field Alternatives pointing to a
192 -- list of case statement alternative nodes.
194 -- Only fields pointing to lists have names ending in "s", so generally
195 -- the structure is strongly typed, fields not ending in s point to
196 -- single nodes, and fields ending in s point to lists.
198 -- The following example shows how a traversal of a list is written. We
199 -- suppose here that Stmt points to a N_Case_Statement node which has
200 -- a list field called Alternatives:
202 -- Alt := First (Alternatives (Stmt));
203 -- while Present (Alt) loop
205 -- -- processing for case statement alternative Alt
207 -- Alt := Next (Alt);
210 -- The Present function tests for Empty, which in this case signals the
211 -- end of the list. First returns Empty immediately if the list is empty.
212 -- Present is defined in Atree, First and Next are defined in Nlists.
214 -- The exceptions to this rule occur with {DEFINING_IDENTIFIERS} in all
215 -- contexts, which is handled as described in the previous section, and
216 -- with {,library_unit_NAME} in the N_With_Clause mode, which is handled
217 -- using the First_Name and Last_Name flags, as further detailed in the
218 -- description of the N_With_Clause node.
224 -- Pragmas can appear in many different context, but are not included
225 -- in the grammar. Still they must appear in the tree, so they can be
226 -- properly processed.
228 -- Two approaches are used. In some cases, an extra field is defined
229 -- in an appropriate node that contains a list of pragmas appearing
230 -- in the expected context. For example pragmas can appear before an
231 -- Accept_Alternative in a Selective_Accept_Statement, and these pragmas
232 -- appear in the Pragmas_Before field of the N_Accept_Alternative node.
234 -- The other approach is to simply allow pragmas to appear in syntactic
235 -- lists where the grammar (of course) does not include the possibility.
236 -- For example, the Variants field of an N_Variant_Part node points to
237 -- a list that can contain both N_Pragma and N_Variant nodes.
239 -- To make processing easier in the latter case, the Nlists package
240 -- provides a set of routines (First_Non_Pragma, Last_Non_Pragma,
241 -- Next_Non_Pragma, Prev_Non_Pragma) that allow such lists to be
242 -- handled ignoring all pragmas.
244 -- In the case of the variants list, we can either write:
246 -- Variant := First (Variants (N));
247 -- while Present (Variant) loop
249 -- Alt := Next (Alt);
254 -- Variant := First_Non_Pragma (Variants (N));
255 -- while Present (Variant) loop
257 -- Alt := Next_Non_Pragma (Alt);
260 -- In the first form of the loop, Variant can either be an N_Pragma or
261 -- an N_Variant node. In the second form, Variant can only be N_Variant
262 -- since all pragmas are skipped.
264 ---------------------
265 -- Optional Fields --
266 ---------------------
268 -- Fields which correspond to a section of the syntax enclosed in square
269 -- brackets are generally omitted (and the corresponding field set to
270 -- Empty for a node, or No_List for a list). The documentation of such
271 -- fields notes these cases. One exception to this rule occurs in the
272 -- case of possibly empty statement sequences (such as the sequence of
273 -- statements in an entry call alternative). Such cases appear in the
274 -- syntax rules as [SEQUENCE_OF_STATEMENTS] and the fields corresponding
275 -- to such optional statement sequences always contain an empty list (not
276 -- No_List) if no statements are present.
278 -- Note: the utility program that constructs the body and spec of the
279 -- Nmake package relies on the format of the comments to determine if
280 -- a field should have a default value in the corresponding make routine.
281 -- The rule is that if the first line of the description of the field
282 -- contains the string "(set to xxx if", then a default value of xxx is
283 -- provided for this field in the corresponding Make_yyy routine.
285 -----------------------------------
286 -- Note on Body/Spec Terminology --
287 -----------------------------------
289 -- In informal discussions about Ada, it is customary to refer to package
290 -- and subprogram specs and bodies. However, this is not technically
291 -- correct, what is normally referred to as a spec or specification is in
292 -- fact a package declaration or subprogram declaration. We are careful
293 -- in GNAT to use the correct terminology and in particular, the full
294 -- word specification is never used as an incorrect substitute for
295 -- declaration. The structure and terminology used in the tree also
296 -- reflects the grammar and thus uses declaration and specification in
297 -- the technically correct manner.
299 -- However, there are contexts in which the informal terminology is
300 -- useful. We have the word "body" to refer to the Interp_Etype declared by
301 -- the declaration of a unit body, and in some contexts we need a
302 -- similar term to refer to the entity declared by the package or
303 -- subprogram declaration, and simply using declaration can be confusing
304 -- since the body also has a declaration.
306 -- An example of such a context is the link between the package body
307 -- and its declaration. With_Declaration is confusing, since
308 -- the package body itself is a declaration.
310 -- To deal with this problem, we reserve the informal term Spec, i.e.
311 -- the popular abbreviation used in this context, to refer to the entity
312 -- declared by the package or subprogram declaration. So in the above
313 -- example case, the field in the body is called With_Spec.
315 -- Another important context for the use of the word Spec is in error
316 -- messages, where a hyper-correct use of declaration would be confusing
317 -- to a typical Ada programmer, and even for an expert programmer can
318 -- cause confusion since the body has a declaration as well.
322 -- Declaration always refers to the syntactic entity that is called
323 -- a declaration. In particular, subprogram declaration
324 -- and package declaration are used to describe the
325 -- syntactic entity that includes the semicolon.
327 -- Specification always refers to the syntactic entity that is called
328 -- a specification. In particular, the terms procedure
329 -- specification, function specification, package
330 -- specification, subprogram specification always refer
331 -- to the syntactic entity that has no semicolon.
333 -- Spec is an informal term, used to refer to the entity
334 -- that is declared by a task declaration, protected
335 -- declaration, generic declaration, subprogram
336 -- declaration or package declaration.
338 -- This convention is followed throughout the GNAT documentation
339 -- both internal and external, and in all error message text.
341 ------------------------
342 -- Internal Use Nodes --
343 ------------------------
345 -- These are Node_Kind settings used in the internal implementation
346 -- which are not logically part of the specification.
349 -- Completely unused entry at the start of the enumeration type. This
350 -- is inserted so that no legitimate value is zero, which helps to get
351 -- better debugging behavior, since zero is a likely uninitialized value).
354 -- Completely unused entry at the end of the enumeration type. This is
355 -- handy so that arrays with Node_Kind as the index type have an extra
356 -- entry at the end (see for example the use of the Pchar_Pos_Array in
357 -- Treepr, where the extra entry provides the limit value when dealing
358 -- with the last used entry in the array).
360 -----------------------------------------
361 -- Note on the settings of Sloc fields --
362 -----------------------------------------
364 -- The Sloc field of nodes that come from the source is set by the
365 -- parser. For internal nodes, and nodes generated during expansion
366 -- the Sloc is usually set in the call to the constructor for the node.
367 -- In general the Sloc value chosen for an internal node is the Sloc of
368 -- the source node whose processing is responsible for the expansion. For
369 -- example, the Sloc of an inherited primitive operation is the Sloc of
370 -- the corresponding derived type declaration.
372 -- For the nodes of a generic instantiation, the Sloc value is encoded
373 -- to represent both the original Sloc in the generic unit, and the Sloc
374 -- of the instantiation itself. See Sinput.ads for details.
376 -- Subprogram instances create two callable entities: one is the visible
377 -- subprogram instance, and the other is an anonymous subprogram nested
378 -- within a wrapper package that contains the renamings for the actuals.
379 -- Both of these entities have the Sloc of the defining entity in the
380 -- instantiation node. This simplifies some ASIS queries.
382 -----------------------
383 -- Field Definitions --
384 -----------------------
386 -- In the following node definitions, all fields, both syntactic and
387 -- semantic, are documented. The one exception is in the case of entities
388 -- (defining indentifiers, character literals and operator symbols),
389 -- where the usage of the fields depends on the entity kind. Entity
390 -- fields are fully documented in the separate package Einfo.
392 -- In the node definitions, three common sets of fields are abbreviated
393 -- to save both space in the documentation, and also space in the string
394 -- (defined in Tree_Print_Strings) used to print trees. The following
395 -- abbreviations are used:
397 -- Note: the utility program that creates the Treeprs spec (in the file
398 -- treeprs.ads) knows about the special fields here, so it must be
399 -- modified if any change is made to these fields.
401 -- "plus fields for binary operator"
402 -- Chars (Name1) Name_Id for the operator
403 -- Left_Opnd (Node2) left operand expression
404 -- Right_Opnd (Node3) right operand expression
405 -- Entity (Node4-Sem) defining entity for operator
406 -- Associated_Node (Node4-Sem) for generic processing
407 -- Do_Overflow_Check (Flag17-Sem) set if overflow check needed
408 -- Has_Private_View (Flag11-Sem) set in generic units.
410 -- "plus fields for unary operator"
411 -- Chars (Name1) Name_Id for the operator
412 -- Right_Opnd (Node3) right operand expression
413 -- Entity (Node4-Sem) defining entity for operator
414 -- Associated_Node (Node4-Sem) for generic processing
415 -- Do_Overflow_Check (Flag17-Sem) set if overflow check needed
416 -- Has_Private_View (Flag11-Sem) set in generic units.
418 -- "plus fields for expression"
419 -- Paren_Count number of parentheses levels
420 -- Etype (Node5-Sem) type of the expression
421 -- Is_Overloaded (Flag5-Sem) >1 type interpretation exists
422 -- Is_Static_Expression (Flag6-Sem) set for static expression
423 -- Raises_Constraint_Error (Flag7-Sem) evaluation raises CE
424 -- Must_Not_Freeze (Flag8-Sem) set if must not freeze
425 -- Do_Range_Check (Flag9-Sem) set if a range check needed
426 -- Assignment_OK (Flag15-Sem) set if modification is OK
427 -- Is_Controlling_Actual (Flag16-Sem) set for controlling argument
429 -- Note: see under (EXPRESSION) for further details on the use of
430 -- the Paren_Count field to record the number of parentheses levels.
432 -- Node_Kind is the type used in the Nkind field to indicate the node
433 -- kind. The actual definition of this type is given later (the reason
434 -- for this is that we want the descriptions ordered by logical chapter
435 -- in the RM, but the type definition is reordered to facilitate the
436 -- definition of some subtype ranges. The individual descriptions of
437 -- the nodes show how the various fields are used in each node kind,
438 -- as well as providing logical names for the fields. Functions and
439 -- procedures are provided for accessing and setting these fields
440 -- using these logical names.
442 -----------------------
443 -- Gigi Restrictions --
444 -----------------------
446 -- The tree passed to Gigi is more restricted than the general tree form.
447 -- For example, as a result of expansion, most of the tasking nodes can
448 -- never appear. For each node to which either a complete or partial
449 -- restriction applies, a note entitled "Gigi restriction" appears which
450 -- documents the restriction.
452 -- Note that most of these restrictions apply only to trees generated when
453 -- code is being generated, since they involved expander actions that
456 ------------------------
457 -- Common Flag Fields --
458 ------------------------
460 -- The following flag fields appear in all nodes
463 -- This flag is used to indicate that a node (and all its children
464 -- have been analyzed. It is used to avoid reanalysis of a node that
465 -- has already been analyzed, both for efficiency and functional
466 -- correctness reasons.
469 -- This flag is used to avoid multiple error messages being posted
470 -- on or referring to the same node. This flag is set if an error
471 -- message refers to a node or is posted on its source location,
472 -- and has the effect of inhibiting further messages involving
476 -- This flag is on for any nodes built by the scanner or parser from
477 -- the source program, and off for any nodes built by the analyzer or
478 -- expander. It indicates that a node comes from the original source.
479 -- This flag is defined in Atree.
481 -- Has_Dynamic_Length_Check and Has_Dynamic_Range_Check also appear on
482 -- all nodes. They are fully described in the next section.
484 ------------------------------------
485 -- Description of Semantic Fields --
486 ------------------------------------
488 -- The meaning of the syntactic fields is generally clear from their
489 -- names without any further description, since the names are chosen
490 -- to correspond very closely to the syntax in the reference manual.
491 -- This section describes the usage of the semantic fields, which are
492 -- used to contain additional information determined during semantic
495 -- ABE_Is_Certain (Flag18-Sem)
496 -- This flag is set in an instantiation node or a call node is
497 -- determined to be sure to raise an ABE. This is used to trigger
498 -- special handling of such cases, particularly in the instantiation
499 -- case where we avoid instantiating the body if this flag is set.
500 -- This flag is also present in an N_Formal_Package_Declaration_Node
501 -- since formal package declarations are treated like instantiations,
502 -- but it is always set to False in this context.
504 -- Accept_Handler_Records (List5-Sem)
505 -- This field is present only in an N_Accept_Alternative node. It is
506 -- used to temporarily hold the exception handler records from an
507 -- accept statement in a selective accept. These exception handlers
508 -- will eventually be placed in the Handler_Records list of the
509 -- procedure built for this accept (see Expand_N_Selective_Accept
510 -- procedure in Exp_Ch9 for further details).
512 -- Access_Types_To_Process (Elist2-Sem)
513 -- Present in N_Freeze_Entity nodes for Incomplete or private types.
514 -- Contains the list of access types which may require specific
515 -- treatment when the nature of the type completion is completely
516 -- known. An example of such treatement is the generation of the
517 -- associated_final_chain.
519 -- Actions (List1-Sem)
520 -- This field contains a sequence of actions that are associated
521 -- with the node holding the field. See the individual node types
522 -- for details of how this field is used, as well as the description
523 -- of the specific use for a particular node type.
525 -- Activation_Chain_Entity (Node3-Sem)
526 -- This is used in tree nodes representing task activators (blocks,
527 -- subprogram bodies, package declarations, and task bodies). It is
528 -- initially Empty, and then gets set to point to the entity for the
529 -- declared Activation_Chain variable when the first task is declared.
530 -- When tasks are declared in the corresponding declarative region
531 -- this entity is located by name (its name is always _Chain) and
532 -- the declared tasks are added to the chain.
534 -- Acts_As_Spec (Flag4-Sem)
535 -- A flag set in the N_Subprogram_Body node for a subprogram body
536 -- which is acting as its own spec. This flag also appears in the
537 -- compilation unit node at the library level for such a subprogram
538 -- (see further description in spec of Lib package).
540 -- Aggregate_Bounds (Node3-Sem)
541 -- Present in array N_Aggregate nodes. If the aggregate contains
542 -- component associations this field points to an N_Range node whose
543 -- bounds give the lowest and highest discrete choice values. If the
544 -- named aggregate contains a dynamic or null choice this field is
545 -- empty. If the aggregate contains positional elements this field
546 -- points to an N_Integer_Literal node giving the number of positional
547 -- elements. Note that if the aggregate contains positional elements
548 -- and an other choice the N_Integer_Literal only accounts for the
549 -- number of positional elements.
551 -- All_Others (Flag11-Sem)
552 -- Present in an N_Others_Choice node. This flag is set in the case
553 -- of an others exception where all exceptions are to be caught, even
554 -- those that are not normally handled (in particular the tasking abort
555 -- signal). This is used for translation of the at end handler into
556 -- a normal exception handler.
558 -- Assignment_OK (Flag15-Sem)
559 -- This flag is set in a subexpression node for an object, indicating
560 -- that the associated object can be modified, even if this would not
561 -- normally be permissible (either by direct assignment, or by being
562 -- passed as an out or in-out parameter). This is used by the expander
563 -- for a number of purposes, including initialzation of constants and
564 -- limited type objects (such as tasks), setting discriminant fields,
565 -- setting tag values, etc. N_Object_Declaration nodes also have this
566 -- flag defined. Here it is used to indicate that an initialization
567 -- expression is valid, even where it would normally not be allowed
568 -- (e.g. where the type involved is limited).
570 -- Associated_Node (Node4-Sem)
571 -- Present in nodes that can denote an entity: identifiers, character
572 -- literals, operator symbols, expanded names, operator nodes and
573 -- attribute reference nodes (all these nodes have an Entity field).
574 -- This field is also present in N_Aggregate, N_Selected_Component,
575 -- and N_Extension_Aggregate nodes. This field is used during generic
576 -- processing to relate nodes in the original template to nodes in the
577 -- generic copy. It overlaps the Entity field, and is used to capture
578 -- global references in the analyzed copy and place them in the template.
579 -- See description in Sem_Ch12 for further details on this usage.
581 -- At_End_Proc (Node1)
582 -- This field is present in an N_Handled_Sequence_Of_Statements node.
583 -- It contains an identifier reference for the cleanup procedure to
584 -- be called. See description of this node for further details.
586 -- Backwards_OK (Flag6-Sem)
587 -- A flag present in the N_Assignment_Statement node. It is used only
588 -- if the type being assigned is an array type, and is set if analysis
589 -- determines that it is definitely safe to do the copy backwards, i.e.
590 -- starting at the highest addressed element. Note that if neither of
591 -- the flags Forwards_OK or Backwards_OK is set, it means that the
592 -- front end could not determine that either direction is definitely
593 -- safe, and a runtime check is required.
595 -- Body_To_Inline (Node3-Sem)
596 -- present in subprogram declarations. Denotes analyzed but unexpanded
597 -- body of subprogram, to be used when inlining calls. Present when the
598 -- subprogram has an Inline pragma and inlining is enabled. If the
599 -- declaration is completed by a renaming_as_body, and the renamed en-
600 -- tity is a subprogram, the Body_To_Inline is the name of that entity,
601 -- which is used directly in later calls to the original subprogram.
603 -- Body_Required (Flag13-Sem)
604 -- A flag that appears in the N_Compilation_Unit node indicating that
605 -- the corresponding unit requires a body. For the package case, this
606 -- indicates that a completion is required. In Ada 95, if the flag
607 -- is not set for the package case, then a body may not be present.
608 -- In Ada 83, if the flag is not set for the package case, then a
609 -- body is optional. For a subprogram declaration, the flag is set
610 -- except in the case where a pragma Import or Interface applies,
611 -- in which case no body is permitted (in Ada 83 or Ada 95).
613 -- By_Ref (Flag5-Sem)
614 -- A flag present in the N_Return_Statement_Node. It is set when the
615 -- returned expression is already allocated on the secondary stack
616 -- and thus the result is passed by reference rather than copied
619 -- Compile_Time_Known_Aggregate (Flag18-Sem)
620 -- Present in N_Aggregate nodes. Set for aggregates which can be
621 -- fully evaluated at compile time without raising constraint error.
622 -- Such aggregates can be passed as is to Gigi without any expansion.
623 -- See Sem_Aggr for the specific conditions under which an aggregate
624 -- has this flag set. See also the flag Static_Processing_OK.
626 -- Condition_Actions (List3-Sem)
627 -- This field appears in else-if nodes and in the iteration scheme
628 -- node for while loops. This field is only used during semantic
629 -- processing to temporarily hold actions inserted into the tree.
630 -- In the tree passed to gigi, the condition actions field is always
631 -- set to No_List. For details on how this field is used, see the
632 -- routine Insert_Actions in package Exp_Util, and also the expansion
633 -- routines for the relevant nodes.
635 -- Controlling_Argument (Node1-Sem)
636 -- This field is set in procedure and function call nodes if the call
637 -- is a dispatching call (it is Empty for a non-dispatching call).
638 -- It indicates the source of the controlling tag for the call. For
639 -- Procedure calls, the Controlling_Argument is one of the actuals.
640 -- For a function that has a dispatching result, it is an entity in
641 -- the context of the call that can provide a tag, or else it is the
642 -- tag of the root type of the class.
644 -- Conversion_OK (Flag14-Sem)
645 -- A flag set on type conversion nodes to indicate that the conversion
646 -- is to be considered as being valid, even though it is the case that
647 -- the conversion is not valid Ada. This is used for the Enum_Rep,
648 -- Fixed_Value and Integer_Value attributes, for internal conversions
649 -- done for fixed-point operations, and for certain conversions for
650 -- calls to initialization procedures. If Conversion_OK is set, then
651 -- Etype must be set (the analyzer assumes that Etype has been set).
652 -- For the case of fixed-point operands, it also indicates that the
653 -- conversion is to be a direct conversion of the underlying integer
654 -- result, with no regard to the small operand.
656 -- Corresponding_Body (Node5-Sem)
657 -- This field is set in subprogram declarations, where it is needed
658 -- if a pragma Inline is present and the subprogram is called, in
659 -- generic declarations if the generic is instantiated, and also in
660 -- package declarations that contain inlined subprograms that are
661 -- called, or generic declarations that are instantiated. It points
662 -- to the defining entity for the corresponding body.
664 -- Corresponding_Generic_Association (Node5-Sem)
665 -- This field is defined for object declarations and object renaming
666 -- declarations. It is set for the declarations within an instance that
667 -- map generic formals to their actuals. If set, the field points to
668 -- a generic_association which is the original parent of the expression
669 -- or name appearing in the declaration. This simplifies ASIS queries.
671 -- Corresponding_Integer_Value (Uint4-Sem)
672 -- This field is set in real literals of fixed-point types (it is not
673 -- used for floating-point types). It contains the integer value used
674 -- to represent the fixed-point value. It is also set on the universal
675 -- real literals used to represent bounds of fixed-point base types
676 -- and their first named subtypes.
678 -- Corresponding_Spec (Node5-Sem)
679 -- This field is set in subprogram, package, task, and protected body
680 -- nodes, where it points to the defining entity in the corresponding
681 -- spec. The attribute is also set in N_With_Clause nodes, where
682 -- it points to the defining entity for the with'ed spec, and in
683 -- a subprogram renaming declaration when it is a Renaming_As_Body.
684 -- The field is Empty if there is no corresponding spec, as in the
685 -- case of a subprogram body that serves as its own spec.
687 -- Corresponding_Stub (Node3-Sem)
688 -- This field is present in an N_Subunit node. It holds the node in
689 -- the parent unit that is the stub declaration for the subunit. it is
690 -- set when analysis of the stub forces loading of the proper body. If
691 -- expansion of the proper body creates new declarative nodes, they are
692 -- inserted at the point of the corresponding_stub.
694 -- Dcheck_Function (Node5-Sem)
695 -- This field is present in an N_Variant node, It references the entity
696 -- for the discriminant checking function for the variant.
698 -- Debug_Statement (Node3)
699 -- This field is present in an N_Pragma node. It is used only for
700 -- a Debug pragma or pragma Assert with a second parameter. The
701 -- parameter is of the form of an expression, as required by the
702 -- pragma syntax, but is actually a procedure call. To simplify
703 -- semantic processing, the parser creates a copy of the argument
704 -- rearranged into a procedure call statement and places it in the
705 -- Debug_Statement field. Note that this field is considered a
706 -- syntactic field, since it is created by the parser.
708 -- Default_Expression (Node5-Sem)
709 -- This field is Empty if there is no default expression. If there
710 -- is a simple default expression (one with no side effects), then
711 -- this field simply contains a copy of the Expression field (both
712 -- point to the tree for the default expression). Default_Expression
713 -- is used for conformance checking.
715 -- Delay_Finalize_Attach (Flag14-Sem)
716 -- This flag is present in an N_Object_Declaration node. If it is set,
717 -- then in the case of a controlled type being declared and initialized,
718 -- the normal code for attaching the result to the appropriate local
719 -- finalization list is suppressed. This is used for functions that
720 -- return controlled types without using the secondary stack, where
721 -- it is the caller who must do the attachment.
723 -- Discr_Check_Funcs_Built (Flag11-Sem)
724 -- This flag is present in N_Full_Type_Declaration nodes. It is set when
725 -- discriminant checking functions are constructed. The purpose is to
726 -- avoid attempting to set these functions more than once.
728 -- Do_Access_Check (Flag11-Sem)
729 -- This flag is set on nodes with a Prefix field that can be an object
730 -- of an access type. If the flag is set, it indicates that a check is
731 -- required to ensure that the value of the referenced object is not
732 -- null. The actual check (which may be explicit or implicit by means
733 -- of some trap), is generated by Gigi (all the front end does is to
734 -- set this flag to request the trap).
736 -- Do_Accessibility_Check (Flag13-Sem)
737 -- This flag is set on N_Parameter_Specification nodes to indicate
738 -- that an accessibility check is required for the parameter. It is
739 -- not yet decided who takes care of this check (TBD ???).
741 -- Do_Discriminant_Check (Flag13-Sem)
742 -- This flag is set on N_Selected_Component nodes to indicate that a
743 -- discriminant check is required using the discriminant check routine
744 -- associated with the selector. The actual check is dealt with by
745 -- Gigi (all the front end does is to set the flag).
747 -- Do_Division_Check (Flag13-Sem)
748 -- This flag is set on a division operator (/ mod rem) to indicate
749 -- that a zero divide check is required. The actual check is dealt
750 -- with by the backend (all the front end does is to set the flag).
752 -- Do_Length_Check (Flag4-Sem)
753 -- This flag is set in an N_Assignment_Statement, N_Op_And, N_Op_Or,
754 -- N_Op_Xor, or N_Type_Conversion node to indicate that a length check
755 -- is required. It is not determined who deals with this flag (???).
757 -- Do_Overflow_Check (Flag17-Sem)
758 -- This flag is set on an operator where an overflow check is required
759 -- on the operation. The actual check is dealt with by the backend
760 -- (all the front end does is to set the flag). The other cases where
761 -- this flag is used is on a Type_Conversion node and for attribute
762 -- reference nodes. For a type conversion, it means that the conversion
763 -- is from one base type to another, and the value may not fit in the
764 -- target base type. See also the description of Do_Range_Check for
765 -- this case. The only attribute references which use this flag are
766 -- Pred and Succ, where it means that the result should be checked
767 -- for going outside the base range.
769 -- Do_Range_Check (Flag9-Sem)
770 -- This flag is set on an expression which appears in a context where
771 -- a range check is required. The target type is clear from the
772 -- context. The contexts in which this flag can appear are limited to
775 -- Right side of an assignment. In this case the target type is
776 -- taken from the left side of the assignment, which is referenced
777 -- by the Name of the N_Assignment_Statement node.
779 -- Subscript expressions in an indexed component. In this case the
780 -- target type is determined from the type of the array, which is
781 -- referenced by the Prefix of the N_Indexed_Component node.
783 -- Argument expression for a parameter, appearing either directly
784 -- in the Parameter_Associations list of a call or as the Expression
785 -- of an N_Parameter_Association node that appears in this list. In
786 -- either case, the check is against the type of the formal. Note
787 -- that the flag is relevant only in IN and IN OUT parameters, and
788 -- will be ignored for OUT parameters, where no check is required
789 -- in the call, and if a check is required on the return, it is
790 -- generated explicitly with a type conversion.
792 -- Initialization expression for the initial value in an object
793 -- declaration. In this case the Do_Range_Check flag is set on
794 -- the initialization expression, and the check is against the
795 -- range of the type of the object being declared.
797 -- The expression of a type conversion. In this case the range check
798 -- is against the target type of the conversion. See also the use of
799 -- Do_Overflow_Check on a type conversion. The distinction is that
800 -- the ovrflow check protects against a value that is outside the
801 -- range of the target base type, whereas a range check checks that
802 -- the resulting value (which is a value of the base type of the
803 -- target type), satisfies the range constraint of the target type.
805 -- Note: when a range check is required in contexts other than those
806 -- listed above (e.g. in a return statement), an additional type
807 -- conversion node is introduced to represent the required check.
809 -- Do_Storage_Check (Flag17-Sem)
810 -- This flag is set in an N_Allocator node to indicate that a storage
811 -- check is required for the allocation, or in an N_Subprogram_Body
812 -- node to indicate that a stack check is required in the subprogram
813 -- prolog. The N_Allocator case is handled by the routine that expands
814 -- the call to the runtime routine. The N_Subprogram_Body case is
815 -- handled by the backend, and all the semantics does is set the flag.
817 -- Do_Tag_Check (Flag13-Sem)
818 -- This flag is set on an N_Assignment_Statement, N_Function_Call,
819 -- N_Procedure_Call_Statement, N_Type_Conversion or N_Return_Statememt
820 -- node to indicate that the tag check can be suppressed. It is not
821 -- yet decided how this flag is used (TBD ???).
823 -- Elaborate_Present (Flag4-Sem)
824 -- This flag is set in the N_With_Clause node to indicate that a
825 -- pragma Elaborate pragma appears for the with'ed units.
827 -- Elaborate_All_Present (Flag15-Sem)
828 -- This flag is set in the N_With_Clause node to indicate that a
829 -- pragma Elaborate_All pragma appears for the with'ed units.
831 -- Elaboration_Boolean (Node2-Sem)
832 -- This field is present in function and procedure specification
833 -- nodes. If set, it points to the entity for a Boolean flag that
834 -- must be tested for certain calls to check for access before
835 -- elaboration. See body of Sem_Elab for further details. This
836 -- field is Empty if no elaboration boolean is required.
838 -- Else_Actions (List3-Sem)
839 -- This field is present in conditional expression nodes. During code
840 -- expansion we use the Insert_Actions procedure (in Exp_Util) to insert
841 -- actions at an appropriate place in the tree to get elaborated at the
842 -- right time. For conditional expressions, we have to be sure that the
843 -- actions for the Else branch are only elaborated if the condition is
844 -- False. The Else_Actions field is used as a temporary parking place
845 -- for these actions. The final tree is always rewritten to eliminate
846 -- the need for this field, so in the tree passed to Gigi, this field
847 -- is always set to No_List.
849 -- Enclosing_Variant (Node2-Sem)
850 -- This field is present in the N_Variant node and identifies the
851 -- Node_Id corresponding to the immediately enclosing variant when
852 -- the variant is nested, and N_Empty otherwise. Set during semantic
853 -- processing of the variant part of a record type.
855 -- Entity (Node4-Sem)
856 -- Appears in all direct names (identifier, character literal,
857 -- operator symbol), as well as expanded names, and attributes that
858 -- denote entities, such as 'Class. Points to the entity for the
859 -- corresponding defining occurrence. Set after name resolution.
860 -- In the case of identifiers in a WITH list, the corresponding
861 -- defining occurrence is in a separately compiled file, and this
862 -- pointer must be set using the library Load procedure. Note that
863 -- during name resolution, the value in Entity may be temporarily
864 -- incorrect (e.g. during overload resolution, Entity is initially
865 -- set to the first possible correct interpretation, and then later
866 -- modified if necessary to contain the correct value after resolution).
867 -- Note that Associated_Node overlays this field during the processing
868 -- of generics. See Sem_Ch12 for further details.
871 -- Appears in all expression nodes, all direct names, and all
872 -- entities. Points to the entity for the related type. Set after
873 -- type resolution. Normally this is the actual subtype of the
874 -- expression. However, in certain contexts such as the right side
875 -- of an assignment, subscripts, arguments to calls, returned value
876 -- in a function, initial value etc. it is the desired target type.
877 -- In the event that this is different from the actual type, the
878 -- Do_Range_Check flag will be set if a range check is required.
879 -- Note: if the Is_Overloaded flag is set, then Etype points to
880 -- an essentially arbitrary choice from the possible set of types.
882 -- Exception_Junk (Flag11-Sem)
883 -- This flag is set in a various nodes appearing in a statement
884 -- sequence to indicate that the corresponding node is an artifact
885 -- of the generated code for exception handling, and should be
886 -- ignored when analyzing the control flow of the relevant sequence
887 -- of statements (e.g. to check that it does not end with a bad
888 -- return statement).
890 -- Expansion_Delayed (Flag11-Sem)
891 -- Set on aggregates and extension aggregates that need a top-down
892 -- rather than bottom up expansion. Typically aggregate expansion
893 -- happens bottom up. For nested aggregates the expansion is delayed
894 -- until the enclosing aggregate itself is expanded, e.g. in the context
895 -- of a declaration. To delay it we set this flag. This is done to
896 -- avoid creating a temporary for each level of a nested aggregates,
897 -- and also to prevent the premature generation of constraint checks.
898 -- This is also a requirement if we want to generate the proper
899 -- attachment to the internal finalization lists (for record with
900 -- controlled components). Top down expansion of aggregates is also
901 -- used for in-place array aggregate assignment or initialization.
902 -- When the full context is known, the target of the assignment or
903 -- initialization is used to generate the left-hand side of individual
904 -- assignment to each sub-component.
906 -- First_Inlined_Subprogram (Node3-Sem)
907 -- Present in the N_Compilation_Unit node for the main program. Points
908 -- to a chain of entities for subprograms that are to be inlined. The
909 -- Next_Inlined_Subprogram field of these entities is used as a link
910 -- pointer with Empty marking the end of the list. This field is Empty
911 -- if there are no inlined subprograms or inlining is not active.
913 -- First_Named_Actual (Node4-Sem)
914 -- Present in procedure call statement and function call nodes, and
915 -- also in Intrinsic nodes. Set during semantic analysis to point to
916 -- the first named parameter where parameters are ordered by declaration
917 -- order (as opposed to the actual order in the call which may be
918 -- different due to named associations). Note: this field points to the
919 -- explicit actual parameter itself, not the N_Parameter_Association
920 -- node (its parent).
922 -- First_Real_Statement (Node2-Sem)
923 -- Present in N_Handled_Sequence_Of_Statements node. Normally set to
924 -- Empty. Used only when declarations are moved into the statement
925 -- part of a construct as a result of wrapping an AT END handler that
926 -- is required to cover the declarations. In this case, this field is
927 -- used to remember the location in the statements list of the first
928 -- real statement, i.e. the statement that used to be first in the
929 -- statement list before the declarations were prepended.
931 -- First_Subtype_Link (Node5-Sem)
932 -- Present in N_Freeze_Entity node for an anonymous base type that
933 -- is implicitly created by the declaration of a first subtype. It
934 -- points to the entity for the first subtype.
936 -- Float_Truncate (Flag11-Sem)
937 -- A flag present in type conversion nodes. This is used for float
938 -- to integer conversions where truncation is required rather than
939 -- rounding. Note that Gigi does not handle type conversions from real
940 -- to integer with rounding (see Expand_N_Type_Conversion).
942 -- Forwards_OK (Flag5-Sem)
943 -- A flag present in the N_Assignment_Statement node. It is used only
944 -- if the type being assigned is an array type, and is set if analysis
945 -- determines that it is definitely safe to do the copy forwards, i.e.
946 -- starting at the lowest addressed element. Note that if neither of
947 -- the flags Forwards_OK or Backwards_OK is set, it means that the
948 -- front end could not determine that either direction is definitely
949 -- safe, and a runtime check is required.
951 -- From_At_Mod (Flag4-Sem)
952 -- This flag is set on the attribute definition clause node that is
953 -- generated by a transformation of an at mod phrase in a record
954 -- representation clause. This is used to give slightly different
955 -- (Ada 83 compatible) semantics to such a clause, namely it is
956 -- used to specify a minimum acceptable alignment for the base type
957 -- and all subtypes. In Ada 95 terms, the actual alignment of the
958 -- base type and all subtypes must be a multiple of the given value,
959 -- and the representation clause is considered to be type specific
960 -- instead of subtype specific.
962 -- Generic_Parent (Node5-Sem)
963 -- Generic_parent is defined on declaration nodes that are instances.
964 -- The value of Generic_Parent is the generic entity from which the
965 -- instance is obtained. Generic_Parent is also defined for the renaming
966 -- declarations and object declarations created for the actuals in an
967 -- instantiation. The generic parent of such a declaration is the
968 -- corresponding generic association in the Instantiation node.
970 -- Generic_Parent_Type (Node4-Sem)
971 -- Generic_Parent_Type is defined on Subtype_Declaration nodes for
972 -- the actuals of formal private and derived types. Within the instance,
973 -- the operations on the actual are those inherited from the parent.
974 -- For a formal private type, the parent type is the generic type
975 -- itself. The Generic_Parent_Type is also used in an instance to
976 -- determine whether a private operation overrides an inherited one.
978 -- Handler_List_Entry (Node2-Sem)
979 -- This field is present in N_Object_Declaration nodes. It is set only
980 -- for the Handler_Record entry generated for an exception in zero cost
981 -- exception handling mode. It references the corresponding item in the
982 -- handler list, and is used to delete this entry if the corresponding
983 -- handler is deleted during optimization. For further details on why
984 -- this is required, see Exp_Ch11.Remove_Handler_Entries.
986 -- Has_Dynamic_Length_Check (Flag10-Sem)
987 -- This flag is present on all nodes. It is set to indicate that one
988 -- of the routines in unit Checks has generated a length check action
989 -- which has been inserted at the flagged node. This is used to avoid
990 -- the generation of duplicate checks.
992 -- Has_Dynamic_Range_Check (Flag12-Sem)
993 -- This flag is present on all nodes. It is set to indicate that one
994 -- of the routines in unit Checks has generated a range check action
995 -- which has been inserted at the flagged node. This is used to avoid
996 -- the generation of duplicate checks.
998 -- Has_No_Elaboration_Code (Flag17-Sem)
999 -- A flag that appears in the N_Compilation_Unit node to indicate
1000 -- whether or not elaboration code is present for this unit. It is
1001 -- initially set true for subprogram specs and bodies and for all
1002 -- generic units and false for non-generic package specs and bodies.
1003 -- Gigi may set the flag in the non-generic package case if it
1004 -- determines that no elaboration code is generated. Note that this
1005 -- flag is not related to the Is_Preelaborated status, there can be
1006 -- preelaborated packages that generate elaboration code, and non-
1007 -- preelaborated packages which do not generate elaboration code.
1009 -- Has_Priority_Pragma (Flag6-Sem)
1010 -- A flag present in N_Subprogram_Body, N_Task_Definition and
1011 -- N_Protected_Definition nodes to flag the presence of either
1012 -- a Priority or Interrupt_Priority pragma in the declaration
1013 -- sequence (public or private in the task and protected cases)
1015 -- Has_Private_View (Flag11-Sem)
1016 -- A flag present in generic nodes that have an entity, to indicate
1017 -- that the node has a private type. Used to exchange private
1018 -- and full declarations if the visibility at instantiation is
1019 -- different from the visibility at generic definition.
1021 -- Has_Storage_Size_Pragma (Flag5-Sem)
1022 -- A flag present in an N_Task_Definition node to flag the presence
1023 -- of a Storage_Size pragma
1025 -- Has_Task_Info_Pragma (Flag7-Sem)
1026 -- A flag present in an N_Task_Definition node to flag the presence
1027 -- of a Task_Info pragma. Used to detect duplicate pragmas.
1029 -- Has_Task_Name_Pragma (Flag8-Sem)
1030 -- A flag present in N_Task_Definition nodes to flag the presence
1031 -- of a Task_Name pragma in the declaration sequence for the task.
1033 -- Has_Wide_Character (Flag11-Sem)
1034 -- Present in string literals, set if any wide character (i.e. a
1035 -- character code outside the Character range) appears in the string.
1037 -- Hidden_By_Use_Clause (Elist4-Sem)
1038 -- An entity list present in use clauses that appear within
1039 -- instantiations. For the resolution of local entities, entities
1040 -- introduced by these use clauses have priority over global ones,
1041 -- and outer entities must be explicitly hidden/restored on exit.
1043 -- Implicit_With (Flag17-Sem)
1044 -- This flag is set in the N_With_Clause node that is implicitly
1045 -- generated for runtime units that are loaded by the expander, and
1046 -- also for package System, if it is loaded implicitly by a use of
1047 -- the 'Address or 'Tag attribute
1049 -- Includes_Infinities (Flag11-Sem)
1050 -- This flag is present in N_Range nodes. It is set for the range
1051 -- of unconstrained float types defined in Standard, which include
1052 -- not only the given range of values, but also legtitimately can
1053 -- include infinite values. This flag is false for any float type
1054 -- for which an explicit range is given by the programmer, even if
1055 -- that range is identical to the range for float.
1057 -- Instance_Spec (Node5-Sem)
1058 -- This field is present in generic instantiation nodes, and also in
1059 -- formal package declaration nodes (formal package declarations are
1060 -- treated in a manner very similar to package instantiations). It
1061 -- points to the node for the spec of the instance, inserted as part
1062 -- of the semantic processing for instantiations in Sem_Ch12.
1064 -- Is_Asynchronous_Call_Block (Flag7-Sem)
1065 -- A flag set in a Block_Statement node to indicate that it is the
1066 -- expansion of an asynchronous entry call. Such a block needs a
1067 -- cleanup handler to assure that the call is cancelled.
1069 -- Is_Component_Left_Opnd (Flag13-Sem)
1070 -- Is_Component_Right_Opnd (Flag14-Sem)
1071 -- Present in concatenation nodes, to indicate that the corresponding
1072 -- operand is of the component type of the result. Used in resolving
1073 -- concatenation nodes in instances.
1075 -- Is_Controlling_Actual (Flag16-Sem)
1076 -- This flag is set on in an expression that is a controlling argument
1077 -- in a dispatching call. It is off in all other cases. See Sem_Disp
1078 -- for details of its use.
1080 -- Is_Machine_Number (Flag11-Sem)
1081 -- This flag is set in an N_Real_Literal node to indicate that the
1082 -- value is a machine number. This avoids some unnecessary cases
1083 -- of converting real literals to machine numbers.
1085 -- Is_Power_Of_2_For_Shift (Flag13-Sem)
1086 -- A flag present only in N_Op_Expon nodes. It is set when the
1087 -- exponentiation is of the forma 2 ** N, where the type of N is
1088 -- an unsigned integral subtype whose size does not exceed the size
1089 -- of Standard_Integer (i.e. a type that can be safely converted to
1090 -- Natural), and the exponentiation appears as the right operand of
1091 -- an integer multiplication or an integer division where the dividend
1092 -- is unsigned. It is also required that overflow checking is off for
1093 -- both the exponentiation and the multiply/divide node. If this set
1094 -- of conditions holds, and the flag is set, then the division or
1095 -- multiplication can be (and is) converted to a shift.
1097 -- Is_Overloaded (Flag5-Sem)
1098 -- A flag present in all expression nodes. Used temporarily during
1099 -- overloading determination. The setting of this flag is not
1100 -- relevant once overloading analysis is complete.
1102 -- Is_Protected_Subprogram_Body (Flag7-Sem)
1103 -- A flag set in a Subprogram_Body block to indicate that it is the
1104 -- implemenation of a protected subprogram. Such a body needs a
1105 -- cleanup handler to make sure that the associated protected object
1106 -- is unlocked when the subprogram completes.
1108 -- Is_Static_Expression (Flag6-Sem)
1109 -- Indicates that an expression is a static expression (RM 4.9). See
1110 -- spec of package Sem_Eval for full details on the use of this flag.
1112 -- Is_Subprogram_Descriptor (Flag16-Sem)
1113 -- Present in N_Object_Declaration, and set only for the object
1114 -- declaration generated for a subprogram descriptor in fast exception
1115 -- mode. See Exp_Ch11 for details of use.
1117 -- Is_Task_Allocation_Block (Flag6-Sem)
1118 -- A flag set in a Block_Statement node to indicate that it is the
1119 -- expansion of a task allocator, or the allocator of an object
1120 -- containing tasks. Such a block requires a cleanup handler to call
1121 -- Expunge_Unactivted_Tasks to complete any tasks that have been
1122 -- allocated but not activated when the allocator completes abnormally.
1124 -- Is_Task_Master (Flag5-Sem)
1125 -- A flag set in a Subprogram_Body, Block_Statement or Task_Body node
1126 -- to indicate that the construct is a task master (i.e. has declared
1127 -- tasks or declares an access to a task type).
1129 -- Itype (Node1-Sem)
1130 -- Used in N_Itype_Reference node to reference an itype for which it
1131 -- is important to ensure that it is defined. See description of this
1132 -- node for further details.
1134 -- Kill_Range_Check (Flag11-Sem)
1135 -- Used in an N_Unchecked_Type_Conversion node to indicate that the
1136 -- result should not be subjected to range checks. This is used for
1137 -- the implementation of Normalize_Scalars.
1139 -- Label_Construct (Node2-Sem)
1140 -- Used in an N_Implicit_Label_Declaration node. Refers to an N_Label,
1141 -- N_Block_Statement or N_Loop_Statement node to which the label
1142 -- declaration applies. This is not currently used in the compiler
1143 -- itself, but it is useful in the implementation of ASIS queries.
1145 -- Library_Unit (Node4-Sem)
1146 -- In a stub node, the Library_Unit field points to the compilation unit
1147 -- node of the corresponding subunit.
1149 -- In a with clause node, the Library_Unit field points to the spec
1150 -- of the with'ed unit.
1152 -- In a compilation unit node, the use of this field depends on
1155 -- For a subprogram body, the Library_Unit field points to the
1156 -- compilation unit node of the corresponding spec, unless
1157 -- Acts_As_Spec is set, in which case it points to itself.
1159 -- For a package body, the Library_Unit field points to the
1160 -- compilation unit node of the corresponding spec.
1162 -- For a subprogram spec to which pragma Inline applies, the
1163 -- Library_Unit field points to the compilation unit node of
1164 -- the corresponding body, if inlining is active.
1166 -- For a generic declaration, the Library_Unit field points
1167 -- to the compilation unit node of the corresponding generic body.
1169 -- For a subunit, the Library_Unit field points to the compilation
1170 -- unit node of the parent body.
1172 -- Note that this field is not used to hold the parent pointer for a
1173 -- child unit (which might in any case need to use it for some other
1174 -- purpose as described above). Instead for a child unit, implicit
1175 -- with's are generated for all parents.
1177 -- Loop_Actions (List2-Sem)
1178 -- A list present in Component_Association nodes in array aggregates.
1179 -- Used to collect actions that must be executed within the loop because
1180 -- they may need to be evaluated anew each time through.
1182 -- Must_Be_Byte_Aligned (Flag14-Sem)
1183 -- This flag is present in N_Attribute_Reference nodes. It can be set
1184 -- only for the Address and Unrestricted_Access attributes. If set it
1185 -- means that the object for which the address/access is given must be
1186 -- on a byte (more accurately a storage unit) boundary. If necessary,
1187 -- a copy of the object is to be made before taking the address (this
1188 -- copy is in the current scope on the stack frame). This is used for
1189 -- certainly cases of code generated by the expander that passes
1190 -- parameters by address.
1192 -- Must_Not_Freeze (Flag8-Sem)
1193 -- A flag present in all expression nodes. Normally expressions cause
1194 -- freezing as described in the RM. If this flag is set, then this
1195 -- is inhibited. This is used by the analyzer and expander to label
1196 -- nodes that are created by semantic analysis or expansion and which
1197 -- must not cause freezing even though they normally would. This flag
1198 -- is also present in an N_Subtype_Indication node, since we also use
1199 -- these in calls to Freeze_Expression.
1201 -- Next_Entity (Node2-Sem)
1202 -- Present in defining identifiers, defining character literals and
1203 -- defining operator symbols (i.e. in all entities). The entities of
1204 -- a scope are chained, and this field is used as the forward pointer
1205 -- for this list. See Einfo for further details.
1207 -- Next_Named_Actual (Node4-Sem)
1208 -- Present in parameter association node. Set during semantic
1209 -- analysis to point to the next named parameter, where parameters
1210 -- are ordered by declaration order (as opposed to the actual order
1211 -- in the call, which may be different due to named associations).
1212 -- Not that this field points to the explicit actual parameter itself,
1213 -- not to the N_Parameter_Association node (its parent).
1215 -- Next_Rep_Item (Node4-Sem)
1216 -- Present in pragma nodes and attribute definition nodes. Used to
1217 -- link representation items that apply to an entity. See description
1218 -- of First_Rep_Item field in Einfo for full details.
1220 -- Next_Use_Clause (Node3-Sem)
1221 -- While use clauses are active during semantic processing, they
1222 -- are chained from the scope stack entry, using Next_Use_Clause
1223 -- as a link pointer, with Empty marking the end of the list. The
1224 -- head pointer is in the scope stack entry (First_Use_Clause). At
1225 -- the end of semantic processing (i.e. when Gigi sees the tree,
1226 -- the contents of this field is undefined and should not be read).
1228 -- No_Ctrl_Actions (Flag7-Sem)
1229 -- Present in N_Assignment_Statement to indicate that no finalize nor
1230 -- nor adjust should take place on this assignment eventhough the rhs
1231 -- is controlled. This is used in init_procs and aggregate expansions
1232 -- where the generated assignments are more initialisations than real
1235 -- No_Entities_Ref_In_Spec (Flag8-Sem)
1236 -- Present in N_With_Clause nodes. Set if the with clause is on the
1237 -- package or subprogram spec where the main unit is the corresponding
1238 -- body, and no entities of the with'ed unit are referenced by the spec
1239 -- (an entity may still be referenced in the body, so this flag is used
1240 -- to generate the proper message (see Sem_Util.Check_Unused_Withs for
1243 -- No_Initialization (Flag13-Sem)
1244 -- Present in N_Object_Declaration & N_Allocator to indicate
1245 -- that the object must not be initialized (by Initialize or a
1246 -- call to _init_proc). This is needed for controlled aggregates.
1247 -- When the Object declaration has an expression, this flag means
1248 -- that this expression should not be taken into account (needed
1249 -- for in place initialization with aggregates)
1251 -- OK_For_Stream (Flag4-Sem)
1252 -- Present in N_Attribute_Definition clauses for stream attributes. If
1253 -- set, indicates that the attribute is permitted even though the type
1254 -- involved is a limited type. In the case of a protected type, the
1255 -- result is to stream all components (including discriminants) in
1256 -- lexical order. For other limited types, the effect is simply to
1257 -- use the corresponding stream routine for the full type. This flag
1258 -- is used for internally generated code, where the streaming of these
1259 -- types is required, even though not normally allowed by the language.
1261 -- Original_Discriminant (Node2-Sem)
1262 -- Present in identifiers. Used in references to discriminants that
1263 -- appear in generic units. Because the names of the discriminants
1264 -- may be different in an instance, we use this field to recover the
1265 -- position of the discriminant in the original type, and replace it
1266 -- with the discriminant at the same position in the instantiated type.
1268 -- Others_Discrete_Choices (List1-Sem)
1269 -- When a case statement or variant is analyzed, the semantic checks
1270 -- determine the actual list of choices that correspond to an others
1271 -- choice. This list is materialized for later use by the expander
1272 -- and the Others_Discrete_Choices field of an N_Others_Choice node
1273 -- points to this materialized list of choices, which is in standard
1274 -- format for a list of discrete choices, except that of course it
1275 -- cannot contain an N_Others_Choice entry.
1277 -- Parameter_List_Truncated (Flag17-Sem)
1278 -- Present in N_Function_Call and N_Procedure_Call_Statement nodes.
1279 -- Set (for OpenVMS ports of GNAT only) if the parameter list is
1280 -- truncated as a result of a First_Optional_Parameter specification
1281 -- in an Import_Function, Import_Procedure, or Import_Valued_Procedure
1282 -- pragma. The truncation is done by the expander by removing trailing
1283 -- parameters from the argument list, in accordance with the set of
1284 -- rules allowing such parameter removal. In particular, parameters
1285 -- can be removed working from the end of the parameter list backwards
1286 -- up to and including the entry designated by First_Optional_Parameter
1287 -- in the Import pragma. Parameters can be removed if they are implicit
1288 -- and the default value is a known-at-compile-time value, including
1289 -- the use of the Null_Parameter attribute, or if explicit parameter
1290 -- values are present that match the corresponding defaults.
1292 -- Parent_Spec (Node4-Sem)
1293 -- For a library unit that is a child unit spec (package or subprogram
1294 -- declaration, generic declaration or instantiation, or library level
1295 -- rename, this field points to the compilation unit node for the parent
1296 -- package specification. This field is Empty for library bodies (the
1297 -- parent spec in this case can be found from the corresponding spec).
1299 -- Present_Expr (Uint3-Sem)
1300 -- Present in an N_Variant node. This has a meaningful value only after
1301 -- Gigi has back annotated the tree with representation information.
1302 -- At this point, it contains a reference to a gcc expression that
1303 -- depends on the values of one or more discriminants. Give a set of
1304 -- discriminant values, this expression evaluates to False (zero) if
1305 -- variant is not present, and True (non-zero) if it is present. See
1306 -- unit Repinfo for further details on gigi back annotation. This
1307 -- field is used during ASIS processing (data decomposition annex)
1308 -- to determine if a field is present or not.
1310 -- Print_In_Hex (Flag13-Sem)
1311 -- Set on an N_Integer_Literal node to indicate that the value should
1312 -- be printed in hexadecimal in the sprint listing. Has no effect on
1313 -- legality or semantics of program, only on the displayed output.
1314 -- This is used to clarify output from the packed array cases.
1316 -- Procedure_To_Call (Node4-Sem)
1317 -- Present in N_Allocator. N_Free_Statement, and N_Return_Statement
1318 -- nodes. References the entity for the declaration of the procedure
1319 -- to be called to accomplish the required operation (i.e. for the
1320 -- Allocate procedure in the case of N_Allocator and N_Return_Statement
1321 -- (for allocating the return value), and for the Deallocate procedure
1322 -- in the case of N_Free_Statement.
1324 -- Raises_Constraint_Error (Flag7-Sem)
1325 -- Set on an expression whose evaluation will definitely fail a
1326 -- constraint error check. In the case of static expressions, this
1327 -- flag must be set accurately (and if it is set, the expression is
1328 -- typically illegal unless it appears as a non-elaborated branch of
1329 -- a short-circuit form). For a non-static expression, this flag may
1330 -- be set whenever an expression (e.g. an aggregate) is known to raise
1331 -- constraint error. If set, the expression definitely will raise CE
1332 -- if elaborated at runtime. If not set, the expression may or may
1333 -- not raise CE. In other words, on static expressions, the flag is
1334 -- set accurately, on non-static expressions it is set conservatively.
1336 -- Redundant_Use (Flag13-Sem)
1337 -- A flag present in nodes that can appear as an operand in a use
1338 -- clause or use type clause (identifiers, expanded names, attribute
1339 -- references). Set to indicate that a use is redundant (and therefore
1340 -- need not be undone on scope exit).
1342 -- Return_Type (Node2-Sem)
1343 -- Present in N_Return_Statement node. For a procedure, this is set
1344 -- to Standard_Void_Type. For a function it references the entity
1345 -- for the returned type.
1347 -- Rounded_Result (Flag18-Sem)
1348 -- Present in N_Type_Conversion, N_Op_Divide and N_Op_Multiply nodes.
1349 -- Used in the fixed-point cases to indicate that the result must be
1350 -- rounded as a result of the use of the 'Round attribute. Also used
1351 -- for integer N_Op_Divide nodes to indicate that the result should
1352 -- be rounded to the nearest integer (breaking ties away from zero),
1353 -- rather than truncated towards zero as usual. These rounded integer
1354 -- operations are the result of expansion of rounded fixed-point
1355 -- divide, conersion and multiplication operations.
1357 -- Scope (Node3-Sem)
1358 -- Present in defining identifiers, defining character literals and
1359 -- defining operator symbols (i.e. in all entities). The entities of
1360 -- a scope all use this field to reference the corresponding scope
1361 -- entity. See Einfo for further details.
1363 -- Shift_Count_OK (Flag4-Sem)
1364 -- A flag present in shift nodes to indicate that the shift count is
1365 -- known to be in range, i.e. is in the range from zero to word length
1366 -- minus one. If this flag is not set, then the shift count may be
1367 -- outside this range, i.e. larger than the word length, and the code
1368 -- must ensure that such shift counts give the appropriate result.
1370 -- Source_Type (Node1-Sem)
1371 -- Used in an N_Validate_Unchecked_Conversion node to point to the
1372 -- source type entity for the unchecked conversion instantiation
1373 -- which gigi must do size validation for.
1375 -- Static_Processing_OK (Flag4-Sem)
1376 -- Present in N_Aggregate nodes. When the Compile_Time_Known_Aggregate
1377 -- flag is set, the full value of the aggregate can be determined at
1378 -- compile time and the aggregate can be passed as is to the back-end.
1379 -- In this event it is irrelevant whether this flag is set or not.
1380 -- However, if the Compile_Time_Known_Aggregate flag is not set but
1381 -- Static_Processing_OK is set, the aggregate can (but need not) be
1382 -- converted into a compile time known aggregate by the expander.
1383 -- See Sem_Aggr for the specific conditions under which an aggregate
1384 -- has its Static_Processing_OK flag set.
1386 -- Storage_Pool (Node1-Sem)
1387 -- Present in N_Allocator, N_Free_Statement and N_Return_Statement
1388 -- nodes. References the entity for the storage pool to be used for
1389 -- the allocate or free call or for the allocation of the returned
1390 -- value from a function. Empty indicates that the global default
1391 -- default pool is to be used. Note that in the case of a return
1392 -- statement, this field is set only if the function returns a
1393 -- value of a type whose size is not known at compile time on the
1394 -- secondary stack. It is never set on targets for which the target
1395 -- parameter Targparm.Functions_Return_By_DSP_On_Target is True.
1397 -- Target_Type (Node2-Sem)
1398 -- Used in an N_Validate_Unchecked_Conversion node to point to the
1399 -- target type entity for the unchecked conversion instantiation
1400 -- which gigi must do size validation for.
1402 -- Task_Body_Procedure (Node2-Sem)
1403 -- Present in task type declaration nodes. Points to the entity for
1404 -- the task body procedure (as further described in Exp_Ch9, task
1405 -- bodies are expanded into procedures). A convenient function to
1406 -- retrieve this field is Sem_Util.Get_Task_Body_Procedure.
1408 -- Then_Actions (List3-Sem)
1409 -- This field is present in conditional expression nodes. During code
1410 -- expansion we use the Insert_Actions procedure (in Exp_Util) to insert
1411 -- actions at an appropriate place in the tree to get elaborated at the
1412 -- right time. For conditional expressions, we have to be sure that the
1413 -- actions for the Then branch are only elaborated if the condition is
1414 -- True. The Then_Actions field is used as a temporary parking place
1415 -- for these actions. The final tree is always rewritten to eliminate
1416 -- the need for this field, so in the tree passed to Gigi, this field
1417 -- is always set to No_List.
1419 -- Treat_Fixed_As_Integer (Flag14-Sem)
1420 -- This flag appears in operator nodes for divide, multiply, mod and
1421 -- rem on fixed-point operands. It indicates that the operands are
1422 -- to be treated as integer values, ignoring small values. This flag
1423 -- is only set as a result of expansion of fixed-point operations.
1424 -- Typically a fixed-point multplication in the source generates
1425 -- subsidiary multiplication and division operations that work with
1426 -- the underlying integer values and have this flag set. Note that
1427 -- this flag is not needed on other arithmetic operations (add, neg,
1428 -- subtract etc) since in these cases it is always the case that fixed
1429 -- is treated as integer. The Etype field MUST be set if this flag
1430 -- is set. The analyzer knows to leave such nodes alone, and whoever
1431 -- makes them must set the correct Etype value.
1433 -- TSS_Elist (Elist3-Sem)
1434 -- Present in N_Freeze_Entity nodes. Holds an element list containing
1435 -- entries for each TSS (type support subprogram) associated with the
1436 -- frozen type. The elements of the list are the entities for the
1437 -- subprograms (see package Exp_TSS for further details). Set to
1438 -- No_Elist if there are no type support subprograms for the type
1439 -- or if the freeze node is not for a type.
1441 -- Unreferenced_In_Spec (Flag7-Sem)
1442 -- Present in N_With_Clause nodes. Set if the with clause is on the
1443 -- package or subprogram spec where the main unit is the corresponding
1444 -- body, and is not referenced by the spec (it may still be referenced
1445 -- by the body, so this flag is used to generate the proper message
1446 -- (see Sem_Util.Check_Unused_Withs for details)
1448 -- Was_Originally_Stub (Flag13-Sem)
1449 -- This flag is set in the node for a proper body that replaces a
1450 -- stub. During the analysis procedure, stubs in some situations
1451 -- get rewritten by the corresponding bodies, and we set this flag
1452 -- to remember that this happened. Note that it is not good enough
1453 -- to rely on the use of Original_Tree here because of the case of
1454 -- nested instantiations where the substituted node can be copied.
1456 -- Zero_Cost_Handling (Flag5-Sem)
1457 -- This flag is set in all handled sequence of statement and exception
1458 -- handler nodes if eceptions are to be handled using the zero-cost
1459 -- mechanism (see Ada.Exceptions and System.Exceptions in files
1460 -- a-except.ads/adb and s-except.ads for full details). What gigi
1461 -- needs to do for such a handler is simply to put the code in the
1462 -- handler somewhere. The front end has generated all necessary labels.
1464 --------------------------------------------------
1465 -- Note on Use of End_Label and End_Span Fields --
1466 --------------------------------------------------
1468 -- Several constructs have end lines:
1470 -- Loop Statement end loop [loop_IDENTIFIER];
1471 -- Package Specification end [[PARENT_UNIT_NAME .] IDENTIFIER]
1472 -- Task Definition end [task_IDENTIFIER]
1473 -- Protected Definition end [protected_IDENTIFIER]
1474 -- Protected Body end [protected_IDENTIFIER]
1476 -- Block Statement end [block_IDENTIFIER];
1477 -- Subprogram Body end [DESIGNATOR];
1478 -- Package Body end [[PARENT_UNIT_NAME .] IDENTIFIER];
1479 -- Task Body end [task_IDENTIFIER];
1480 -- Accept Statement end [entry_IDENTIFIER]];
1481 -- Entry Body end [entry_IDENTIFIER];
1483 -- If Statement end if;
1484 -- Case Statement end case;
1486 -- Record Definition end record;
1487 -- Enumeration Definition );
1489 -- The End_Label and End_Span fields are used to mark the locations
1490 -- of these lines, and also keep track of the label in the case where
1491 -- a label is present.
1493 -- For the first group above, the End_Label field of the corresponding
1494 -- node is used to point to the label identifier. In the case where
1495 -- there is no label in the source, the parser supplies a dummy
1496 -- identifier (with Comes_From_Source set to False), and the Sloc
1497 -- of this dummy identifier marks the location of the token following
1500 -- For the second group, the use of End_Label is similar, but the
1501 -- End_Label is found in the N_Handled_Sequence_Of_Statements node.
1502 -- This is done simply because in some cases there is no room in
1505 -- For the third group, there is never any label, and instead of
1506 -- using End_Label, we use the End_Span field which gives the
1507 -- location of the token following END, relative to the starting
1508 -- Sloc of the construct, i.e. add Sloc (Node) + End_Span (Node)
1509 -- to get the Sloc of the IF or CASE following the End_Label.
1511 -- The record definition case is handled specially, we treat it
1512 -- as though it required an optional label which is never present,
1513 -- and so the parser always builds a dummy identifier with Comes
1514 -- From Source set False. The reason we do this, rather than using
1515 -- End_Span in this case, is that we want to generate a cross-ref
1516 -- entry for the end of a record, since it represents a scope for
1517 -- name declaration purposes.
1519 -- The enumeration definition case is handled in an exactly similar
1520 -- manner, building a dummy identifier to get a cross-reference.
1522 -- Note: the reason we store the difference as a Uint, instead of
1523 -- storing the Source_Ptr value directly, is that Source_Ptr values
1524 -- cannot be distinguished from other types of values, and we count
1525 -- on all general use fields being self describing. To make things
1526 -- easier for clients, note that we provide function End_Location,
1527 -- and procedure Set_End_Location to allow access to the logical
1528 -- value (which is the Source_Ptr value for the end token).
1530 ---------------------
1531 -- Syntactic Nodes --
1532 ---------------------
1534 ---------------------
1535 -- 2.3 Identifier --
1536 ---------------------
1538 -- IDENTIFIER ::= IDENTIFIER_LETTER {[UNDERLINE] LETTER_OR_DIGIT}
1539 -- LETTER_OR_DIGIT ::= IDENTIFIER_LETTER | DIGIT
1541 -- An IDENTIFIER shall not be a reserved word
1543 -- In the Ada grammar identifiers are the bottom level tokens which
1544 -- have very few semantics. Actual program identifiers are direct
1545 -- names. If we were being 100% honest with the grammar, then we would
1546 -- have a node called N_Direct_Name which would point to an identifier.
1547 -- However, that's too many extra nodes, so we just use the N_Identifier
1548 -- node directly as a direct name, and it contains the expression fields
1549 -- and Entity field that correspond to its use as a direct name. In
1550 -- those few cases where identifiers appear in contexts where they are
1551 -- not direct names (pragmas, pragma argument associations, attribute
1552 -- references and attribute definition clauses), the Chars field of the
1553 -- node contains the Name_Id for the identifier name.
1555 -- Note: in GNAT, a reserved word can be treated as an identifier
1556 -- in two cases. First, an incorrect use of a reserved word as an
1557 -- identifier is diagnosed and then treated as a normal identifier.
1558 -- Second, an attribute designator of the form of a reserved word
1559 -- (access, delta, digits, range) is treated as an identifier.
1561 -- Note: The set of letters that is permitted in an identifier depends
1562 -- on the character set in use. See package Csets for full details.
1565 -- Sloc points to identifier
1566 -- Chars (Name1) contains the Name_Id for the identifier
1567 -- Entity (Node4-Sem)
1568 -- Associated_Node (Node4-Sem)
1569 -- Original_Discriminant (Node2-Sem)
1570 -- Redundant_Use (Flag13-Sem)
1571 -- Has_Private_View (Flag11-Sem) (set in generic units)
1572 -- plus fields for expression
1574 --------------------------
1575 -- 2.4 Numeric Literal --
1576 --------------------------
1578 -- NUMERIC_LITERAL ::= DECIMAL_LITERAL | BASED_LITERAL
1580 ----------------------------
1581 -- 2.4.1 Decimal Literal --
1582 ----------------------------
1584 -- DECIMAL_LITERAL ::= NUMERAL [.NUMERAL] [EXPONENT]
1586 -- NUMERAL ::= DIGIT {[UNDERLINE] DIGIT}
1588 -- EXPONENT ::= E [+] NUMERAL | E - NUMERAL
1590 -- Decimal literals appear in the tree as either integer literal nodes
1591 -- or real literal nodes, depending on whether a period is present.
1593 -- Note: literal nodes appear as a result of direct use of literals
1594 -- in the source program, and also as the result of evaluating
1595 -- expressions at compile time. In the latter case, it is possible
1596 -- to construct real literals that have no syntactic representation
1597 -- using the standard literal format. Such literals are listed by
1598 -- Sprint using the notation [numerator / denominator].
1600 -- N_Integer_Literal
1601 -- Sloc points to literal
1602 -- Intval (Uint3) contains integer value of literal
1603 -- plus fields for expression
1604 -- Print_In_Hex (Flag13-Sem)
1607 -- Sloc points to literal
1608 -- Realval (Ureal3) contains real value of literal
1609 -- Corresponding_Integer_Value (Uint4-Sem)
1610 -- Is_Machine_Number (Flag11-Sem)
1611 -- plus fields for expression
1613 --------------------------
1614 -- 2.4.2 Based Literal --
1615 --------------------------
1617 -- BASED_LITERAL ::=
1618 -- BASE # BASED_NUMERAL [.BASED_NUMERAL] # [EXPONENT]
1622 -- BASED_NUMERAL ::=
1623 -- EXTENDED_DIGIT {[UNDERLINE] EXTENDED_DIGIT}
1625 -- EXTENDED_DIGIT ::= DIGIT | A | B | C | D | E | F
1627 -- Based literals appear in the tree as either integer literal nodes
1628 -- or real literal nodes, depending on whether a period is present.
1630 ----------------------------
1631 -- 2.5 Character Literal --
1632 ----------------------------
1634 -- CHARACTER_LITERAL ::= ' GRAPHIC_CHARACTER '
1636 -- N_Character_Literal
1637 -- Sloc points to literal
1638 -- Chars (Name1) contains the Name_Id for the identifier
1639 -- Char_Literal_Value (Char_Code2) contains the literal value
1640 -- Entity (Node4-Sem)
1641 -- Associated_Node (Node4-Sem)
1642 -- Has_Private_View (Flag11-Sem) set in generic units.
1643 -- plus fields for expression
1645 -- Note: the Entity field will be missing (and set to Empty) for
1646 -- character literals whose type is Standard.Wide_Character or
1647 -- Standard.Character or a type derived from one of these two.
1648 -- In this case the character literal stands for its own coding.
1649 -- The reason we take this irregular short cut is to avoid the
1650 -- need to build lots of junk defining character literal nodes.
1652 -------------------------
1653 -- 2.6 String Literal --
1654 -------------------------
1656 -- STRING LITERAL ::= "{STRING_ELEMENT}"
1658 -- A STRING_ELEMENT is either a pair of quotation marks ("), or a
1659 -- single GRAPHIC_CHARACTER other than a quotation mark.
1662 -- Sloc points to literal
1663 -- Strval (Str3) contains Id of string value
1664 -- Has_Wide_Character (Flag11-Sem)
1665 -- plus fields for expression
1671 -- A COMMENT starts with two adjacent hyphens and extends up to the
1672 -- end of the line. A COMMENT may appear on any line of a program.
1674 -- Comments are skipped by the scanner and do not appear in the tree.
1675 -- It is possible to reconstruct the position of comments with respect
1676 -- to the elements of the tree by using the source position (Sloc)
1677 -- pointers that appear in every tree node.
1683 -- PRAGMA ::= pragma IDENTIFIER
1684 -- [(PRAGMA_ARGUMENT_ASSOCIATION {, PRAGMA_ARGUMENT_ASSOCIATION})];
1686 -- Note that a pragma may appear in the tree anywhere a declaration
1687 -- or a statement may appear, as well as in some other situations
1688 -- which are explicitly documented.
1691 -- Sloc points to PRAGMA
1692 -- Chars (Name1) identifier name from pragma identifier
1693 -- Pragma_Argument_Associations (List2) (set to No_List if none)
1694 -- Debug_Statement (Node3) (set to Empty if not Debug, Assert)
1695 -- Next_Rep_Item (Node4-Sem)
1697 --------------------------------------
1698 -- 2.8 Pragma Argument Association --
1699 --------------------------------------
1701 -- PRAGMA_ARGUMENT_ASSOCIATION ::=
1702 -- [pragma_argument_IDENTIFIER =>] NAME
1703 -- | [pragma_argument_IDENTIFIER =>] EXPRESSION
1705 -- N_Pragma_Argument_Association
1706 -- Sloc points to first token in association
1707 -- Chars (Name1) (set to No_Name if no pragma argument identifier)
1708 -- Expression (Node3)
1710 ------------------------
1711 -- 2.9 Reserved Word --
1712 ------------------------
1714 -- Reserved words are parsed by the scanner, and returned as the
1715 -- corresponding token types (e.g. PACKAGE is returned as Tok_Package)
1717 ----------------------------
1718 -- 3.1 Basic Declaration --
1719 ----------------------------
1721 -- BASIC_DECLARATION ::=
1722 -- TYPE_DECLARATION | SUBTYPE_DECLARATION
1723 -- | OBJECT_DECLARATION | NUMBER_DECLARATION
1724 -- | SUBPROGRAM_DECLARATION | ABSTRACT_SUBPROGRAM_DECLARATION
1725 -- | PACKAGE_DECLARATION | RENAMING_DECLARATION
1726 -- | EXCEPTION_DECLARATION | GENERIC_DECLARATION
1727 -- | GENERIC_INSTANTIATION
1729 -- Basic declaration also includes IMPLICIT_LABEL_DECLARATION
1730 -- see further description in section on semantic nodes.
1732 -- Also, in the tree that is constructed, a pragma may appear
1733 -- anywhere that a declaration may appear.
1735 ------------------------------
1736 -- 3.1 Defining Identifier --
1737 ------------------------------
1739 -- DEFINING_IDENTIFIER ::= IDENTIFIER
1741 -- A defining identifier is an entity, which has additional fields
1742 -- depending on the setting of the Ekind field. These additional
1743 -- fields are defined (and access subprograms declared) in package
1746 -- Note: N_Defining_Identifier is an extended node whose fields are
1747 -- deliberate layed out to match the layout of fields in an ordinary
1748 -- N_Identifier node allowing for easy alteration of an identifier
1749 -- node into a defining identifier node. For details, see procedure
1750 -- Sinfo.CN.Change_Identifier_To_Defining_Identifier.
1752 -- N_Defining_Identifier
1753 -- Sloc points to identifier
1754 -- Chars (Name1) contains the Name_Id for the identifier
1755 -- Next_Entity (Node2-Sem)
1756 -- Scope (Node3-Sem)
1757 -- Etype (Node5-Sem)
1759 -----------------------------
1760 -- 3.2.1 Type Declaration --
1761 -----------------------------
1763 -- TYPE_DECLARATION ::=
1764 -- FULL_TYPE_DECLARATION
1765 -- | INCOMPLETE_TYPE_DECLARATION
1766 -- | PRIVATE_TYPE_DECLARATION
1767 -- | PRIVATE_EXTENSION_DECLARATION
1769 ----------------------------------
1770 -- 3.2.1 Full Type Declaration --
1771 ----------------------------------
1773 -- FULL_TYPE_DECLARATION ::=
1774 -- type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
1775 -- is TYPE_DEFINITION;
1776 -- | TASK_TYPE_DECLARATION
1777 -- | PROTECTED_TYPE_DECLARATION
1779 -- The full type declaration node is used only for the first case. The
1780 -- second case (concurrent type declaration), is represented directly
1781 -- by a task type declaration or a protected type declaration.
1783 -- N_Full_Type_Declaration
1784 -- Sloc points to TYPE
1785 -- Defining_Identifier (Node1)
1786 -- Discriminant_Specifications (List4) (set to No_List if none)
1787 -- Type_Definition (Node3)
1788 -- Discr_Check_Funcs_Built (Flag11-Sem)
1790 ----------------------------
1791 -- 3.2.1 Type Definition --
1792 ----------------------------
1794 -- TYPE_DEFINITION ::=
1795 -- ENUMERATION_TYPE_DEFINITION | INTEGER_TYPE_DEFINITION
1796 -- | REAL_TYPE_DEFINITION | ARRAY_TYPE_DEFINITION
1797 -- | RECORD_TYPE_DEFINITION | ACCESS_TYPE_DEFINITION
1798 -- | DERIVED_TYPE_DEFINITION
1800 --------------------------------
1801 -- 3.2.2 Subtype Declaration --
1802 --------------------------------
1804 -- SUBTYPE_DECLARATION ::=
1805 -- subtype DEFINING_IDENTIFIER is SUBTYPE_INDICATION;
1807 -- The subtype indication field is set to Empty for subtypes
1808 -- declared in package Standard (Positive, Natural).
1810 -- N_Subtype_Declaration
1811 -- Sloc points to SUBTYPE
1812 -- Defining_Identifier (Node1)
1813 -- Subtype_Indication (Node5)
1814 -- Generic_Parent_Type (Node4-Sem) (set for an actual derived type).
1815 -- Exception_Junk (Flag11-Sem)
1817 -------------------------------
1818 -- 3.2.2 Subtype Indication --
1819 -------------------------------
1821 -- SUBTYPE_INDICATION ::= SUBTYPE_MARK [CONSTRAINT]
1823 -- Note: if no constraint is present, the subtype indication appears
1824 -- directly in the tree as a subtype mark. The N_Subtype_Indication
1825 -- node is used only if a constraint is present.
1827 -- Note: the reason that this node has expression fields is that a
1828 -- subtype indication can appear as an operand of a membership test.
1830 -- N_Subtype_Indication
1831 -- Sloc points to first token of subtype mark
1832 -- Subtype_Mark (Node4)
1833 -- Constraint (Node3)
1834 -- Etype (Node5-Sem)
1835 -- Must_Not_Freeze (Flag8-Sem)
1837 -- Note: Etype is a copy of the Etype field of the Subtype_Mark. The
1838 -- reason for this redundancy is so that in a list of array index types,
1839 -- the Etype can be uniformly accessed to determine the subscript type.
1840 -- This means that no Itype is constructed for the actual subtype that
1841 -- is created by the subtype indication. If such an Itype is required,
1842 -- it is constructed in the context in which the indication appears.
1844 -------------------------
1845 -- 3.2.2 Subtype Mark --
1846 -------------------------
1848 -- SUBTYPE_MARK ::= subtype_NAME
1850 -----------------------
1851 -- 3.2.2 Constraint --
1852 -----------------------
1854 -- CONSTRAINT ::= SCALAR_CONSTRAINT | COMPOSITE_CONSTRAINT
1856 ------------------------------
1857 -- 3.2.2 Scalar Constraint --
1858 ------------------------------
1860 -- SCALAR_CONSTRAINT ::=
1861 -- RANGE_CONSTRAINT | DIGITS_CONSTRAINT | DELTA_CONSTRAINT
1863 ---------------------------------
1864 -- 3.2.2 Composite Constraint --
1865 ---------------------------------
1867 -- COMPOSITE_CONSTRAINT ::=
1868 -- INDEX_CONSTRAINT | DISCRIMINANT_CONSTRAINT
1870 -------------------------------
1871 -- 3.3.1 Object Declaration --
1872 -------------------------------
1874 -- OBJECT_DECLARATION ::=
1875 -- DEFINING_IDENTIFIER_LIST : [aliased] [constant]
1876 -- SUBTYPE_INDICATION [:= EXPRESSION];
1877 -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant]
1878 -- ARRAY_TYPE_DEFINITION [:= EXPRESSION];
1879 -- | SINGLE_TASK_DECLARATION
1880 -- | SINGLE_PROTECTED_DECLARATION
1882 -- Note: aliased is not permitted in Ada 83 mode
1884 -- The N_Object_Declaration node is only for the first two cases.
1885 -- Single task declaration is handled by P_Task (9.1)
1886 -- Single protected declaration is handled by P_protected (9.5)
1888 -- Although the syntax allows multiple identifiers in the list, the
1889 -- semantics is as though successive declarations were given with
1890 -- identical type definition and expression components. To simplify
1891 -- semantic processing, the parser represents a multiple declaration
1892 -- case as a sequence of single declarations, using the More_Ids and
1893 -- Prev_Ids flags to preserve the original source form as described
1894 -- in the section on "Handling of Defining Identifier Lists".
1896 -- Note: if a range check is required for the initialization
1897 -- expression then the Do_Range_Check flag is set in the Expression,
1898 -- with the check being done against the type given by the object
1899 -- definition, which is also the Etype of the defining identifier.
1901 -- Note: the contents of the Expression field must be ignored (i.e.
1902 -- treated as though it were Empty) if No_Initialization is set True.
1904 -- N_Object_Declaration
1905 -- Sloc points to first identifier
1906 -- Defining_Identifier (Node1)
1907 -- Aliased_Present (Flag4) set if ALIASED appears
1908 -- Constant_Present (Flag17) set if CONSTANT appears
1909 -- Object_Definition (Node4) subtype indication/array type definition
1910 -- Expression (Node3) (set to Empty if not present)
1911 -- Handler_List_Entry (Node2-Sem)
1912 -- Corresponding_Generic_Association (Node5-Sem)
1913 -- More_Ids (Flag5) (set to False if no more identifiers in list)
1914 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
1915 -- No_Initialization (Flag13-Sem)
1916 -- Assignment_OK (Flag15-Sem)
1917 -- Exception_Junk (Flag11-Sem)
1918 -- Delay_Finalize_Attach (Flag14-Sem)
1919 -- Is_Subprogram_Descriptor (Flag16-Sem)
1921 -------------------------------------
1922 -- 3.3.1 Defining Identifier List --
1923 -------------------------------------
1925 -- DEFINING_IDENTIFIER_LIST ::=
1926 -- DEFINING_IDENTIFIER {, DEFINING_IDENTIFIER}
1928 -------------------------------
1929 -- 3.3.2 Number Declaration --
1930 -------------------------------
1932 -- NUMBER_DECLARATION ::=
1933 -- DEFINING_IDENTIFIER_LIST : constant := static_EXPRESSION;
1935 -- Although the syntax allows multiple identifiers in the list, the
1936 -- semantics is as though successive declarations were given with
1937 -- identical expressions. To simplify semantic processing, the parser
1938 -- represents a multiple declaration case as a sequence of single
1939 -- declarations, using the More_Ids and Prev_Ids flags to preserve
1940 -- the original source form as described in the section on "Handling
1941 -- of Defining Identifier Lists".
1943 -- N_Number_Declaration
1944 -- Sloc points to first identifier
1945 -- Defining_Identifier (Node1)
1946 -- Expression (Node3)
1947 -- More_Ids (Flag5) (set to False if no more identifiers in list)
1948 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
1950 ----------------------------------
1951 -- 3.4 Derived Type Definition --
1952 ----------------------------------
1954 -- DERIVED_TYPE_DEFINITION ::=
1955 -- [abstract] new parent_SUBTYPE_INDICATION [RECORD_EXTENSION_PART]
1957 -- Note: ABSTRACT, record extension part not permitted in Ada 83 mode
1959 -- Note: a record extension part is required if ABSTRACT is present
1961 -- N_Derived_Type_Definition
1962 -- Sloc points to NEW
1963 -- Abstract_Present (Flag4)
1964 -- Subtype_Indication (Node5)
1965 -- Record_Extension_Part (Node3) (set to Empty if not present)
1967 ---------------------------
1968 -- 3.5 Range Constraint --
1969 ---------------------------
1971 -- RANGE_CONSTRAINT ::= range RANGE
1973 -- N_Range_Constraint
1974 -- Sloc points to RANGE
1975 -- Range_Expression (Node4)
1982 -- RANGE_ATTRIBUTE_REFERENCE
1983 -- | SIMPLE_EXPRESSION .. SIMPLE_EXPRESSION
1985 -- Note: the case of a range given as a range attribute reference
1986 -- appears directly in the tree as an attribute reference.
1988 -- Note: the field name for a reference to a range is Range_Expression
1989 -- rather than Range, because range is a reserved keyword in Ada!
1991 -- Note: the reason that this node has expression fields is that a
1992 -- range can appear as an operand of a membership test. The Etype
1993 -- field is the type of the range (we do NOT construct an implicit
1994 -- subtype to represent the range exactly).
1997 -- Sloc points to ..
1998 -- Low_Bound (Node1)
1999 -- High_Bound (Node2)
2000 -- Includes_Infinities (Flag11)
2001 -- plus fields for expression
2003 -- Note: if the range appears in a context, such as a subtype
2004 -- declaration, where range checks are required on one or both of
2005 -- the expression fields, then type conversion nodes are inserted
2006 -- to represent the required checks.
2008 ----------------------------------------
2009 -- 3.5.1 Enumeration Type Definition --
2010 ----------------------------------------
2012 -- ENUMERATION_TYPE_DEFINITION ::=
2013 -- (ENUMERATION_LITERAL_SPECIFICATION
2014 -- {, ENUMERATION_LITERAL_SPECIFICATION})
2016 -- Note: the Literals field in the node described below is null for
2017 -- the case of the standard types CHARACTER and WIDE_CHARACTER, for
2018 -- which special processing handles these types as special cases.
2020 -- N_Enumeration_Type_Definition
2021 -- Sloc points to left parenthesis
2022 -- Literals (List1) (Empty for CHARACTER or WIDE_CHARACTER)
2023 -- End_Label (Node4) (set to Empty if internally generated record)
2025 ----------------------------------------------
2026 -- 3.5.1 Enumeration Literal Specification --
2027 ----------------------------------------------
2029 -- ENUMERATION_LITERAL_SPECIFICATION ::=
2030 -- DEFINING_IDENTIFIER | DEFINING_CHARACTER_LITERAL
2032 ---------------------------------------
2033 -- 3.5.1 Defining Character Literal --
2034 ---------------------------------------
2036 -- DEFINING_CHARACTER_LITERAL ::= CHARACTER_LITERAL
2038 -- A defining character literal is an entity, which has additional
2039 -- fields depending on the setting of the Ekind field. These
2040 -- additional fields are defined (and access subprograms declared)
2041 -- in package Einfo.
2043 -- Note: N_Defining_Character_Literal is an extended node whose fields
2044 -- are deliberate layed out to match the layout of fields in an ordinary
2045 -- N_Character_Literal node allowing for easy alteration of a character
2046 -- literal node into a defining character literal node. For details, see
2047 -- Sinfo.CN.Change_Character_Literal_To_Defining_Character_Literal.
2049 -- N_Defining_Character_Literal
2050 -- Sloc points to literal
2051 -- Chars (Name1) contains the Name_Id for the identifier
2052 -- Next_Entity (Node2-Sem)
2053 -- Scope (Node3-Sem)
2054 -- Etype (Node5-Sem)
2056 ------------------------------------
2057 -- 3.5.4 Integer Type Definition --
2058 ------------------------------------
2060 -- Note: there is an error in this rule in the latest version of the
2061 -- grammar, so we have retained the old rule pending clarification.
2063 -- INTEGER_TYPE_DEFINITION ::=
2064 -- SIGNED_INTEGER_TYPE_DEFINITION
2065 -- MODULAR_TYPE_DEFINITION
2067 -------------------------------------------
2068 -- 3.5.4 Signed Integer Type Definition --
2069 -------------------------------------------
2071 -- SIGNED_INTEGER_TYPE_DEFINITION ::=
2072 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
2074 -- Note: the Low_Bound and High_Bound fields are set to Empty for
2075 -- integer types defined in package Standard.
2077 -- N_Signed_Integer_Type_Definition
2078 -- Sloc points to RANGE
2079 -- Low_Bound (Node1)
2080 -- High_Bound (Node2)
2082 -----------------------------------------
2083 -- 3.5.4 Unsigned Range Specification --
2084 -----------------------------------------
2086 -- MODULAR_TYPE_DEFINITION ::= mod static_EXPRESSION
2088 -- N_Modular_Type_Definition
2089 -- Sloc points to MOD
2090 -- Expression (Node3)
2092 ---------------------------------
2093 -- 3.5.6 Real Type Definition --
2094 ---------------------------------
2096 -- REAL_TYPE_DEFINITION ::=
2097 -- FLOATING_POINT_DEFINITION | FIXED_POINT_DEFINITION
2099 --------------------------------------
2100 -- 3.5.7 Floating Point Definition --
2101 --------------------------------------
2103 -- FLOATING_POINT_DEFINITION ::=
2104 -- digits static_SIMPLE_EXPRESSION [REAL_RANGE_SPECIFICATION]
2106 -- Note: The Digits_Expression and Real_Range_Specifications fields
2107 -- are set to Empty for floating-point types declared in Standard.
2109 -- N_Floating_Point_Definition
2110 -- Sloc points to DIGITS
2111 -- Digits_Expression (Node2)
2112 -- Real_Range_Specification (Node4) (set to Empty if not present)
2114 -------------------------------------
2115 -- 3.5.7 Real Range Specification --
2116 -------------------------------------
2118 -- REAL_RANGE_SPECIFICATION ::=
2119 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
2121 -- N_Real_Range_Specification
2122 -- Sloc points to RANGE
2123 -- Low_Bound (Node1)
2124 -- High_Bound (Node2)
2126 -----------------------------------
2127 -- 3.5.9 Fixed Point Definition --
2128 -----------------------------------
2130 -- FIXED_POINT_DEFINITION ::=
2131 -- ORDINARY_FIXED_POINT_DEFINITION | DECIMAL_FIXED_POINT_DEFINITION
2133 --------------------------------------------
2134 -- 3.5.9 Ordinary Fixed Point Definition --
2135 --------------------------------------------
2137 -- ORDINARY_FIXED_POINT_DEFINITION ::=
2138 -- delta static_EXPRESSION REAL_RANGE_SPECIFICATION
2140 -- Note: In Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
2142 -- Note: the Delta_Expression and Real_Range_Specification fields
2143 -- are set to Empty for fixed point types declared in Standard.
2145 -- N_Ordinary_Fixed_Point_Definition
2146 -- Sloc points to DELTA
2147 -- Delta_Expression (Node3)
2148 -- Real_Range_Specification (Node4)
2150 -------------------------------------------
2151 -- 3.5.9 Decimal Fixed Point Definition --
2152 -------------------------------------------
2154 -- DECIMAL_FIXED_POINT_DEFINITION ::=
2155 -- delta static_EXPRESSION
2156 -- digits static_EXPRESSION [REAL_RANGE_SPECIFICATION]
2158 -- Note: decimal types are not permitted in Ada 83 mode
2160 -- N_Decimal_Fixed_Point_Definition
2161 -- Sloc points to DELTA
2162 -- Delta_Expression (Node3)
2163 -- Digits_Expression (Node2)
2164 -- Real_Range_Specification (Node4) (set to Empty if not present)
2166 ------------------------------
2167 -- 3.5.9 Digits Constraint --
2168 ------------------------------
2170 -- DIGITS_CONSTRAINT ::=
2171 -- digits static_EXPRESSION [RANGE_CONSTRAINT]
2173 -- Note: in Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
2174 -- Note: in Ada 95, reduced accuracy subtypes are obsolescent
2176 -- N_Digits_Constraint
2177 -- Sloc points to DIGITS
2178 -- Digits_Expression (Node2)
2179 -- Range_Constraint (Node4) (set to Empty if not present)
2181 --------------------------------
2182 -- 3.6 Array Type Definition --
2183 --------------------------------
2185 -- ARRAY_TYPE_DEFINITION ::=
2186 -- UNCONSTRAINED_ARRAY_DEFINITION | CONSTRAINED_ARRAY_DEFINITION
2188 -----------------------------------------
2189 -- 3.6 Unconstrained Array Definition --
2190 -----------------------------------------
2192 -- UNCONSTRAINED_ARRAY_DEFINITION ::=
2193 -- array (INDEX_SUBTYPE_DEFINITION {, INDEX_SUBTYPE_DEFINITION}) of
2194 -- COMPONENT_DEFINITION
2196 -- Note: dimensionality of array is indicated by number of entries in
2197 -- the Subtype_Marks list, which has one entry for each dimension.
2199 -- N_Unconstrained_Array_Definition
2200 -- Sloc points to ARRAY
2201 -- Subtype_Marks (List2)
2202 -- Aliased_Present (Flag4) from component definition
2203 -- Subtype_Indication (Node5) from component definition
2205 -----------------------------------
2206 -- 3.6 Index Subtype Definition --
2207 -----------------------------------
2209 -- INDEX_SUBTYPE_DEFINITION ::= SUBTYPE_MARK range <>
2211 -- There is no explicit node in the tree for an index subtype
2212 -- definition since the N_Unconstrained_Array_Definition node
2213 -- incorporates the type marks which appear in this context.
2215 ---------------------------------------
2216 -- 3.6 Constrained Array Definition --
2217 ---------------------------------------
2219 -- CONSTRAINED_ARRAY_DEFINITION ::=
2220 -- array (DISCRETE_SUBTYPE_DEFINITION
2221 -- {, DISCRETE_SUBTYPE_DEFINITION})
2222 -- of COMPONENT_DEFINITION
2224 -- Note: dimensionality of array is indicated by number of entries
2225 -- in the Discrete_Subtype_Definitions list, which has one entry
2226 -- for each dimension.
2228 -- N_Constrained_Array_Definition
2229 -- Sloc points to ARRAY
2230 -- Discrete_Subtype_Definitions (List2)
2231 -- Aliased_Present (Flag4) from component definition
2232 -- Subtype_Indication (Node5) from component definition
2234 --------------------------------------
2235 -- 3.6 Discrete Subtype Definition --
2236 --------------------------------------
2238 -- DISCRETE_SUBTYPE_DEFINITION ::=
2239 -- discrete_SUBTYPE_INDICATION | RANGE
2241 -------------------------------
2242 -- 3.6 Component Definition --
2243 -------------------------------
2245 -- COMPONENT_DEFINITION ::= [aliased] SUBTYPE_INDICATION
2247 -- There is no explicit node in the tree for a component definition.
2248 -- Instead the subtype indication appears directly, and the ALIASED
2249 -- indication (Aliased_Present flag) is in the parent node.
2251 -- Note: although the syntax does not permit a component definition to
2252 -- be an anonymous array (and the parser will diagnose such an attempt
2253 -- with an appropriate message), it is possible for anonymous arrays
2254 -- to appear as component definitions. The semantics and back end handle
2255 -- this case properly, and the expander in fact generates such cases.
2257 -----------------------------
2258 -- 3.6.1 Index Constraint --
2259 -----------------------------
2261 -- INDEX_CONSTRAINT ::= (DISCRETE_RANGE {, DISCRETE_RANGE})
2263 -- It is not in general possible to distinguish between discriminant
2264 -- constraints and index constraints at parse time, since a simple
2265 -- name could be either the subtype mark of a discrete range, or an
2266 -- expression in a discriminant association with no name. Either
2267 -- entry appears simply as the name, and the semantic parse must
2268 -- distinguish between the two cases. Thus we use a common tree
2269 -- node format for both of these constraint types.
2271 -- See Discriminant_Constraint for format of node
2273 ---------------------------
2274 -- 3.6.1 Discrete Range --
2275 ---------------------------
2277 -- DISCRETE_RANGE ::= discrete_SUBTYPE_INDICATION | RANGE
2279 ----------------------------
2280 -- 3.7 Discriminant Part --
2281 ----------------------------
2283 -- DISCRIMINANT_PART ::=
2284 -- UNKNOWN_DISCRIMINANT_PART | KNOWN_DISCRIMINANT_PART
2286 ------------------------------------
2287 -- 3.7 Unknown Discriminant Part --
2288 ------------------------------------
2290 -- UNKNOWN_DISCRIMINANT_PART ::= (<>)
2292 -- Note: unknown discriminant parts are not permitted in Ada 83 mode
2294 -- There is no explicit node in the tree for an unknown discriminant
2295 -- part. Instead the Unknown_Discriminants_Present flag is set in the
2298 ----------------------------------
2299 -- 3.7 Known Discriminant Part --
2300 ----------------------------------
2302 -- KNOWN_DISCRIMINANT_PART ::=
2303 -- (DISCRIMINANT_SPECIFICATION {; DISCRIMINANT_SPECIFICATION})
2305 -------------------------------------
2306 -- 3.7 Discriminant Specification --
2307 -------------------------------------
2309 -- DISCRIMINANT_SPECIFICATION ::=
2310 -- DEFINING_IDENTIFIER_LIST : SUBTYPE_MARK
2311 -- [:= DEFAULT_EXPRESSION]
2312 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
2313 -- [:= DEFAULT_EXPRESSION]
2315 -- Although the syntax allows multiple identifiers in the list, the
2316 -- semantics is as though successive specifications were given with
2317 -- identical type definition and expression components. To simplify
2318 -- semantic processing, the parser represents a multiple declaration
2319 -- case as a sequence of single specifications, using the More_Ids and
2320 -- Prev_Ids flags to preserve the original source form as described
2321 -- in the section on "Handling of Defining Identifier Lists".
2323 -- N_Discriminant_Specification
2324 -- Sloc points to first identifier
2325 -- Defining_Identifier (Node1)
2326 -- Discriminant_Type (Node5) subtype mark or
2327 -- access parameter definition
2328 -- Expression (Node3) (set to Empty if no default expression)
2329 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2330 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2332 -----------------------------
2333 -- 3.7 Default Expression --
2334 -----------------------------
2336 -- DEFAULT_EXPRESSION ::= EXPRESSION
2338 ------------------------------------
2339 -- 3.7.1 Discriminant Constraint --
2340 ------------------------------------
2342 -- DISCRIMINANT_CONSTRAINT ::=
2343 -- (DISCRIMINANT_ASSOCIATION {, DISCRIMINANT_ASSOCIATION})
2345 -- It is not in general possible to distinguish between discriminant
2346 -- constraints and index constraints at parse time, since a simple
2347 -- name could be either the subtype mark of a discrete range, or an
2348 -- expression in a discriminant association with no name. Either
2349 -- entry appears simply as the name, and the semantic parse must
2350 -- distinguish between the two cases. Thus we use a common tree
2351 -- node format for both of these constraint types.
2353 -- N_Index_Or_Discriminant_Constraint
2354 -- Sloc points to left paren
2355 -- Constraints (List1) points to list of discrete ranges or
2356 -- discriminant associations
2358 -------------------------------------
2359 -- 3.7.1 Discriminant Association --
2360 -------------------------------------
2362 -- DISCRIMINANT_ASSOCIATION ::=
2363 -- [discriminant_SELECTOR_NAME
2364 -- {| discriminant_SELECTOR_NAME} =>] EXPRESSION
2366 -- Note: a discriminant association that has no selector name list
2367 -- appears directly as an expression in the tree.
2369 -- N_Discriminant_Association
2370 -- Sloc points to first token of discriminant association
2371 -- Selector_Names (List1) (always non-empty, since if no selector
2372 -- names are present, this node is not used, see comment above)
2373 -- Expression (Node3)
2375 ---------------------------------
2376 -- 3.8 Record Type Definition --
2377 ---------------------------------
2379 -- RECORD_TYPE_DEFINITION ::=
2380 -- [[abstract] tagged] [limited] RECORD_DEFINITION
2382 -- Note: ABSTRACT, TAGGED, LIMITED are not permitted in Ada 83 mode
2384 -- There is no explicit node in the tree for a record type definition.
2385 -- Instead the flags for Tagged_Present and Limited_Present appear in
2386 -- the N_Record_Definition node for a record definition appearing in
2387 -- the context of a record type definition.
2389 ----------------------------
2390 -- 3.8 Record Definition --
2391 ----------------------------
2393 -- RECORD_DEFINITION ::=
2399 -- Note: the Abstract_Present, Tagged_Present and Limited_Present
2400 -- flags appear only for a record definition appearing in a record
2403 -- Note: the NULL RECORD case is not permitted in Ada 83
2405 -- N_Record_Definition
2406 -- Sloc points to RECORD or NULL
2407 -- End_Label (Node4) (set to Empty if internally generated record)
2408 -- Abstract_Present (Flag4)
2409 -- Tagged_Present (Flag15)
2410 -- Limited_Present (Flag17)
2411 -- Component_List (Node1) empty in null record case
2412 -- Null_Present (Flag13) set in null record case
2414 -------------------------
2415 -- 3.8 Component List --
2416 -------------------------
2418 -- COMPONENT_LIST ::=
2419 -- COMPONENT_ITEM {COMPONENT_ITEM}
2420 -- | {COMPONENT_ITEM} VARIANT_PART
2424 -- Sloc points to first token of component list
2425 -- Component_Items (List3)
2426 -- Variant_Part (Node4) (set to Empty if no variant part)
2427 -- Null_Present (Flag13)
2429 -------------------------
2430 -- 3.8 Component Item --
2431 -------------------------
2433 -- COMPONENT_ITEM ::= COMPONENT_DECLARATION | REPRESENTATION_CLAUSE
2435 -- Note: A component item can also be a pragma, and in the tree
2436 -- that is obtained after semantic processing, a component item
2437 -- can be an N_Null node resulting from a non-recognized pragma.
2439 --------------------------------
2440 -- 3.8 Component Declaration --
2441 --------------------------------
2443 -- COMPONENT_DECLARATION ::=
2444 -- DEFINING_IDENTIFIER_LIST : COMPONENT_DEFINITION
2445 -- [:= DEFAULT_EXPRESSION]
2447 -- Note: although the syntax does not permit a component definition to
2448 -- be an anonymous array (and the parser will diagnose such an attempt
2449 -- with an appropriate message), it is possible for anonymous arrays
2450 -- to appear as component definitions. The semantics and back end handle
2451 -- this case properly, and the expander in fact generates such cases.
2453 -- Although the syntax allows multiple identifiers in the list, the
2454 -- semantics is as though successive declarations were given with the
2455 -- same component definition and expression components. To simplify
2456 -- semantic processing, the parser represents a multiple declaration
2457 -- case as a sequence of single declarations, using the More_Ids and
2458 -- Prev_Ids flags to preserve the original source form as described
2459 -- in the section on "Handling of Defining Identifier Lists".
2461 -- N_Component_Declaration
2462 -- Sloc points to first identifier
2463 -- Defining_Identifier (Node1)
2464 -- Aliased_Present (Flag4) from component definition
2465 -- Subtype_Indication (Node5) from component definition
2466 -- Expression (Node3) (set to Empty if no default expression)
2467 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2468 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2470 -------------------------
2471 -- 3.8.1 Variant Part --
2472 -------------------------
2475 -- case discriminant_DIRECT_NAME is
2480 -- Note: the variants list can contain pragmas as well as variants.
2481 -- In a properly formed program there is at least one variant.
2484 -- Sloc points to CASE
2488 --------------------
2490 --------------------
2493 -- when DISCRETE_CHOICE_LIST =>
2497 -- Sloc points to WHEN
2498 -- Discrete_Choices (List4)
2499 -- Component_List (Node1)
2500 -- Enclosing_Variant (Node2-Sem)
2501 -- Present_Expr (Uint3-Sem)
2502 -- Dcheck_Function (Node5-Sem)
2504 ---------------------------------
2505 -- 3.8.1 Discrete Choice List --
2506 ---------------------------------
2508 -- DISCRETE_CHOICE_LIST ::= DISCRETE_CHOICE {| DISCRETE_CHOICE}
2510 ----------------------------
2511 -- 3.8.1 Discrete Choice --
2512 ----------------------------
2514 -- DISCRETE_CHOICE ::= EXPRESSION | DISCRETE_RANGE | others
2516 -- Note: in Ada 83 mode, the expression must be a simple expression
2518 -- The only choice that appears explicitly is the OTHERS choice, as
2519 -- defined here. Other cases of discrete choice (expression and
2520 -- discrete range) appear directly. This production is also used
2521 -- for the OTHERS possibility of an exception choice.
2523 -- Note: in accordance with the syntax, the parser does not check that
2524 -- OTHERS appears at the end on its own in a choice list context. This
2525 -- is a semantic check.
2528 -- Sloc points to OTHERS
2529 -- Others_Discrete_Choices (List1-Sem)
2530 -- All_Others (Flag11-Sem)
2532 ----------------------------------
2533 -- 3.9.1 Record Extension Part --
2534 ----------------------------------
2536 -- RECORD_EXTENSION_PART ::= with RECORD_DEFINITION
2538 -- Note: record extension parts are not permitted in Ada 83 mode
2540 ----------------------------------
2541 -- 3.10 Access Type Definition --
2542 ----------------------------------
2544 -- ACCESS_TYPE_DEFINITION ::=
2545 -- ACCESS_TO_OBJECT_DEFINITION
2546 -- | ACCESS_TO_SUBPROGRAM_DEFINITION
2548 ---------------------------------------
2549 -- 3.10 Access To Object Definition --
2550 ---------------------------------------
2552 -- ACCESS_TO_OBJECT_DEFINITION ::=
2553 -- access [GENERAL_ACCESS_MODIFIER] SUBTYPE_INDICATION
2555 -- N_Access_To_Object_Definition
2556 -- Sloc points to ACCESS
2557 -- All_Present (Flag15)
2558 -- Subtype_Indication (Node5)
2559 -- Constant_Present (Flag17)
2561 -----------------------------------
2562 -- 3.10 General Access Modifier --
2563 -----------------------------------
2565 -- GENERAL_ACCESS_MODIFIER ::= all | constant
2567 -- Note: general access modifiers are not permitted in Ada 83 mode
2569 -- There is no explicit node in the tree for general access modifier.
2570 -- Instead the All_Present or Constant_Present flags are set in the
2573 -------------------------------------------
2574 -- 3.10 Access To Subprogram Definition --
2575 -------------------------------------------
2577 -- ACCESS_TO_SUBPROGRAM_DEFINITION
2578 -- access [protected] procedure PARAMETER_PROFILE
2579 -- | access [protected] function PARAMETER_AND_RESULT_PROFILE
2581 -- Note: access to subprograms are not permitted in Ada 83 mode
2583 -- N_Access_Function_Definition
2584 -- Sloc points to ACCESS
2585 -- Protected_Present (Flag15)
2586 -- Parameter_Specifications (List3) (set to No_List if no formal part)
2587 -- Subtype_Mark (Node4) result subtype
2589 -- N_Access_Procedure_Definition
2590 -- Sloc points to ACCESS
2591 -- Protected_Present (Flag15)
2592 -- Parameter_Specifications (List3) (set to No_List if no formal part)
2594 -----------------------------
2595 -- 3.10 Access Definition --
2596 -----------------------------
2598 -- ACCESS_DEFINITION ::= access SUBTYPE_MARK
2600 -- N_Access_Definition
2601 -- Sloc points to ACCESS
2602 -- Subtype_Mark (Node4)
2604 -----------------------------------------
2605 -- 3.10.1 Incomplete Type Declaration --
2606 -----------------------------------------
2608 -- INCOMPLETE_TYPE_DECLARATION ::=
2609 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART];
2611 -- N_Incomplete_Type_Declaration
2612 -- Sloc points to TYPE
2613 -- Defining_Identifier (Node1)
2614 -- Discriminant_Specifications (List4) (set to No_List if no
2615 -- discriminant part, or if the discriminant part is an
2616 -- unknown discriminant part)
2617 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
2619 ----------------------------
2620 -- 3.11 Declarative Part --
2621 ----------------------------
2623 -- DECLARATIVE_PART ::= {DECLARATIVE_ITEM}
2625 -- Note: although the parser enforces the syntactic requirement that
2626 -- a declarative part can contain only declarations, the semantic
2627 -- processing may add statements to the list of actions in a
2628 -- declarative part, so the code generator should be prepared
2629 -- to accept a statement in this position.
2631 ----------------------------
2632 -- 3.11 Declarative Item --
2633 ----------------------------
2635 -- DECLARATIVE_ITEM ::= BASIC_DECLARATIVE_ITEM | BODY
2637 ----------------------------------
2638 -- 3.11 Basic Declarative Item --
2639 ----------------------------------
2641 -- BASIC_DECLARATIVE_ITEM ::=
2642 -- BASIC_DECLARATION | REPRESENTATION_CLAUSE | USE_CLAUSE
2648 -- BODY ::= PROPER_BODY | BODY_STUB
2650 -----------------------
2651 -- 3.11 Proper Body --
2652 -----------------------
2655 -- SUBPROGRAM_BODY | PACKAGE_BODY | TASK_BODY | PROTECTED_BODY
2662 -- DIRECT_NAME | EXPLICIT_DEREFERENCE
2663 -- | INDEXED_COMPONENT | SLICE
2664 -- | SELECTED_COMPONENT | ATTRIBUTE_REFERENCE
2665 -- | TYPE_CONVERSION | FUNCTION_CALL
2666 -- | CHARACTER_LITERAL
2668 ----------------------
2669 -- 4.1 Direct Name --
2670 ----------------------
2672 -- DIRECT_NAME ::= IDENTIFIER | OPERATOR_SYMBOL
2678 -- PREFIX ::= NAME | IMPLICIT_DEREFERENCE
2680 -------------------------------
2681 -- 4.1 Explicit Dereference --
2682 -------------------------------
2684 -- EXPLICIT_DEREFERENCE ::= NAME . all
2686 -- N_Explicit_Dereference
2687 -- Sloc points to ALL
2689 -- Do_Access_Check (Flag11-Sem)
2690 -- plus fields for expression
2692 -------------------------------
2693 -- 4.1 Implicit Dereference --
2694 -------------------------------
2696 -- IMPLICIT_DEREFERENCE ::= NAME
2698 ------------------------------
2699 -- 4.1.1 Indexed Component --
2700 ------------------------------
2702 -- INDEXED_COMPONENT ::= PREFIX (EXPRESSION {, EXPRESSION})
2704 -- Note: the parser may generate this node in some situations where it
2705 -- should be a function call. The semantic pass must correct this
2706 -- misidentification (which is inevitable at the parser level).
2708 -- N_Indexed_Component
2709 -- Sloc contains a copy of the Sloc value of the Prefix
2711 -- Expressions (List1)
2712 -- Do_Access_Check (Flag11-Sem)
2713 -- plus fields for expression
2715 -- Note: if any of the subscripts requires a range check, then the
2716 -- Do_Range_Check flag is set on the corresponding expression, with
2717 -- the index type being determined from the type of the Prefix, which
2718 -- references the array being indexed.
2720 -- Note: in a fully analyzed and expanded indexed component node, and
2721 -- hence in any such node that gigi sees, if the prefix is an access
2722 -- type, then an explicit dereference operation has been inserted.
2728 -- SLICE ::= PREFIX (DISCRETE_RANGE)
2730 -- Note: an implicit subtype is created to describe the resulting
2731 -- type, so that the bounds of this type are the bounds of the slice.
2734 -- Sloc points to first token of prefix
2736 -- Discrete_Range (Node4)
2737 -- Do_Access_Check (Flag11-Sem)
2738 -- plus fields for expression
2740 -------------------------------
2741 -- 4.1.3 Selected Component --
2742 -------------------------------
2744 -- SELECTED_COMPONENT ::= PREFIX . SELECTOR_NAME
2746 -- Note: selected components that are semantically expanded names get
2747 -- changed during semantic processing into the separate N_Expanded_Name
2748 -- node. See description of this node in the section on semantic nodes.
2750 -- N_Selected_Component
2751 -- Sloc points to period
2753 -- Selector_Name (Node2)
2754 -- Associated_Node (Node4-Sem)
2755 -- Do_Access_Check (Flag11-Sem)
2756 -- Do_Discriminant_Check (Flag13-Sem)
2757 -- plus fields for expression
2759 --------------------------
2760 -- 4.1.3 Selector Name --
2761 --------------------------
2763 -- SELECTOR_NAME ::= IDENTIFIER | CHARACTER_LITERAL | OPERATOR_SYMBOL
2765 --------------------------------
2766 -- 4.1.4 Attribute Reference --
2767 --------------------------------
2769 -- ATTRIBUTE_REFERENCE ::= PREFIX ' ATTRIBUTE_DESIGNATOR
2771 -- Note: the syntax is quite ambiguous at this point. Consider:
2773 -- A'Length (X) X is part of the attribute designator
2774 -- A'Pos (X) X is an explicit actual parameter of function A'Pos
2775 -- A'Class (X) X is the expression of a type conversion
2777 -- It would be possible for the parser to distinguish these cases
2778 -- by looking at the attribute identifier. However, that would mean
2779 -- more work in introducing new implementation defined attributes,
2780 -- and also it would mean that special processing for attributes
2781 -- would be scattered around, instead of being centralized in the
2782 -- semantic routine that handles an N_Attribute_Reference node.
2783 -- Consequently, the parser in all the above cases stores the
2784 -- expression (X in these examples) as a single element list in
2785 -- in the Expressions field of the N_Attribute_Reference node.
2787 -- Similarly, for attributes like Max which take two arguments,
2788 -- we store the two arguments as a two element list in the
2789 -- Expressions field. Of course it is clear at parse time that
2790 -- this case is really a function call with an attribute as the
2791 -- prefix, but it turns out to be convenient to handle the two
2792 -- argument case in a similar manner to the one argument case,
2793 -- and indeed in general the parser will accept any number of
2794 -- expressions in this position and store them as a list in the
2795 -- attribute reference node. This allows for future addition of
2796 -- attributes that take more than two arguments.
2798 -- Note: named associates are not permitted in function calls where
2799 -- the function is an attribute (see RM 6.4(3)) so it is legitimate
2800 -- to skip the normal subprogram argument processing.
2802 -- Note: for the attributes whose designators are technically keywords,
2803 -- i.e. digits, access, delta, range, the Attribute_Name field contains
2804 -- the corresponding name, even though no identifier is involved.
2806 -- The flag OK_For_Stream is used in generated code to indicate that
2807 -- a stream attribute is permissible for a limited type, and results
2808 -- in the use of the stream attribute for the underlying full type,
2809 -- or in the case of a protected type, the components (including any
2810 -- disriminants) are merely streamed in order.
2812 -- See Exp_Attr for a complete description of which attributes are
2813 -- passed onto Gigi, and which are handled entirely by the front end.
2815 -- Gigi restriction: For the Pos attribute, the prefix cannot be
2816 -- a non-standard enumeration type or a nonzero/zero semantics
2817 -- boolean type, so the value is simply the stored representation.
2819 -- Note: In generated code, the Address and Unrestricted_Access
2820 -- attributes can be applied to any expression, and the meaning is
2821 -- to create an object containing the value (the object is in the
2822 -- current stack frame), and pass the address of this value. If the
2823 -- Must_Be_Byte_Aligned flag is set, then the object whose address
2824 -- is taken must be on a byte (storage unit) boundary, and if it is
2825 -- not (or may not be), then the generated code must create a copy
2826 -- that is byte aligned, and pass the address of this copy.
2828 -- N_Attribute_Reference
2829 -- Sloc points to apostrophe
2831 -- Attribute_Name (Name2) identifier name from attribute designator
2832 -- Expressions (List1) (set to No_List if no associated expressions)
2833 -- Entity (Node4-Sem) used if the attribute yields a type
2834 -- Associated_Node (Node4-Sem)
2835 -- Do_Access_Check (Flag11-Sem)
2836 -- Do_Overflow_Check (Flag17-Sem)
2837 -- Redundant_Use (Flag13-Sem)
2838 -- OK_For_Stream (Flag4-Sem)
2839 -- Must_Be_Byte_Aligned (Flag14)
2840 -- plus fields for expression
2842 ---------------------------------
2843 -- 4.1.4 Attribute Designator --
2844 ---------------------------------
2846 -- ATTRIBUTE_DESIGNATOR ::=
2847 -- IDENTIFIER [(static_EXPRESSION)]
2848 -- | access | delta | digits
2850 -- There is no explicit node in the tree for an attribute designator.
2851 -- Instead the Attribute_Name and Expressions fields of the parent
2852 -- node (N_Attribute_Reference node) hold the information.
2854 -- Note: if ACCESS, DELTA or DIGITS appears in an attribute
2855 -- designator, then they are treated as identifiers internally
2856 -- rather than the keywords of the same name.
2858 --------------------------------------
2859 -- 4.1.4 Range Attribute Reference --
2860 --------------------------------------
2862 -- RANGE_ATTRIBUTE_REFERENCE ::= PREFIX ' RANGE_ATTRIBUTE_DESIGNATOR
2864 -- A range attribute reference is represented in the tree using the
2865 -- normal N_Attribute_Reference node.
2867 ---------------------------------------
2868 -- 4.1.4 Range Attribute Designator --
2869 ---------------------------------------
2871 -- RANGE_ATTRIBUTE_DESIGNATOR ::= Range [(static_EXPRESSION)]
2873 -- A range attribute designator is represented in the tree using the
2874 -- normal N_Attribute_Reference node.
2876 --------------------
2878 --------------------
2881 -- RECORD_AGGREGATE | EXTENSION_AGGREGATE | ARRAY_AGGREGATE
2883 -----------------------------
2884 -- 4.3.1 Record Aggregate --
2885 -----------------------------
2887 -- RECORD_AGGREGATE ::= (RECORD_COMPONENT_ASSOCIATION_LIST)
2890 -- Sloc points to left parenthesis
2891 -- Expressions (List1) (set to No_List if none or null record case)
2892 -- Component_Associations (List2) (set to No_List if none)
2893 -- Null_Record_Present (Flag17)
2894 -- Aggregate_Bounds (Node3-Sem)
2895 -- Associated_Node (Node4-Sem)
2896 -- Static_Processing_OK (Flag4-Sem)
2897 -- Compile_Time_Known_Aggregate (Flag18-Sem)
2898 -- Expansion_Delayed (Flag11-Sem)
2899 -- plus fields for expression
2901 -- Note: this structure is used for both record and array aggregates
2902 -- since the two cases are not separable by the parser. The parser
2903 -- makes no attempt to enforce consistency here, so it is up to the
2904 -- semantic phase to make sure that the aggregate is consistent (i.e.
2905 -- that it is not a "half-and-half" case that mixes record and array
2906 -- syntax. In particular, for a record aggregate, the expressions
2907 -- field will be set if there are positional associations.
2909 -- Note: gigi/gcc can handle array aggregates correctly providing that
2910 -- they are entirely positional, and the array subtype involved has a
2911 -- known at compile time length and is not bit packed, or a convention
2912 -- Fortran array with more than one dimension. If these conditions
2913 -- are not met, then the front end must translate the aggregate into
2914 -- an appropriate set of assignments into a temporary.
2916 -- Note: for the record aggregate case, gigi/gcc can handle all cases
2917 -- of record aggregates, including those for packed, and rep-claused
2918 -- records, and also variant records, providing that there are no
2919 -- variable length fields whose size is not known at runtime, and
2920 -- providing that the aggregate is presented in fully named form.
2922 ----------------------------------------------
2923 -- 4.3.1 Record Component Association List --
2924 ----------------------------------------------
2926 -- RECORD_COMPONENT_ASSOCIATION_LIST ::=
2927 -- RECORD_COMPONENT_ASSOCIATION {, RECORD_COMPONENT_ASSOCIATION}
2930 -- There is no explicit node in the tree for a record component
2931 -- association list. Instead the Null_Record_Present flag is set in
2932 -- the parent node for the NULL RECORD case.
2934 ------------------------------------------------------
2935 -- 4.3.1 Record Component Association (also 4.3.3) --
2936 ------------------------------------------------------
2938 -- RECORD_COMPONENT_ASSOCIATION ::=
2939 -- [COMPONENT_CHOICE_LIST =>] EXPRESSION
2941 -- N_Component_Association
2942 -- Sloc points to first selector name
2944 -- Loop_Actions (List2-Sem)
2945 -- Expression (Node3)
2947 -- Note: this structure is used for both record component associations
2948 -- and array component associations, since the two cases aren't always
2949 -- separable by the parser. The choices list may represent either a
2950 -- list of selector names in the record aggregate case, or a list of
2951 -- discrete choices in the array aggregate case or an N_Others_Choice
2952 -- node (which appears as a singleton list).
2954 ------------------------------------
2955 -- 4.3.1 Commponent Choice List --
2956 ------------------------------------
2958 -- COMPONENT_CHOICE_LIST ::=
2959 -- component_SELECTOR_NAME {| component_SELECTOR_NAME}
2962 -- The entries of a component choice list appear in the Choices list
2963 -- of the associated N_Component_Association, as either selector
2964 -- names, or as an N_Others_Choice node.
2966 --------------------------------
2967 -- 4.3.2 Extension Aggregate --
2968 --------------------------------
2970 -- EXTENSION_AGGREGATE ::=
2971 -- (ANCESTOR_PART with RECORD_COMPONENT_ASSOCIATION_LIST)
2973 -- Note: extension aggregates are not permitted in Ada 83 mode
2975 -- N_Extension_Aggregate
2976 -- Sloc points to left parenthesis
2977 -- Ancestor_Part (Node3)
2978 -- Associated_Node (Node4-Sem)
2979 -- Expressions (List1) (set to No_List if none or null record case)
2980 -- Component_Associations (List2) (set to No_List if none)
2981 -- Null_Record_Present (Flag17)
2982 -- Expansion_Delayed (Flag11-Sem)
2983 -- plus fields for expression
2985 --------------------------
2986 -- 4.3.2 Ancestor Part --
2987 --------------------------
2989 -- ANCESTOR_PART ::= EXPRESSION | SUBTYPE_MARK
2991 ----------------------------
2992 -- 4.3.3 Array Aggregate --
2993 ----------------------------
2995 -- ARRAY_AGGREGATE ::=
2996 -- POSITIONAL_ARRAY_AGGREGATE | NAMED_ARRAY_AGGREGATE
2998 ---------------------------------------
2999 -- 4.3.3 Positional Array Aggregate --
3000 ---------------------------------------
3002 -- POSITIONAL_ARRAY_AGGREGATE ::=
3003 -- (EXPRESSION, EXPRESSION {, EXPRESSION})
3004 -- | (EXPRESSION {, EXPRESSION}, others => EXPRESSION)
3006 -- See Record_Aggregate (4.3.1) for node structure
3008 ----------------------------------
3009 -- 4.3.3 Named Array Aggregate --
3010 ----------------------------------
3012 -- NAMED_ARRAY_AGGREGATE ::=
3013 -- | (ARRAY_COMPONENT_ASSOCIATION {, ARRAY_COMPONENT_ASSOCIATION})
3015 -- See Record_Aggregate (4.3.1) for node structure
3017 ----------------------------------------
3018 -- 4.3.3 Array Component Association --
3019 ----------------------------------------
3021 -- ARRAY_COMPONENT_ASSOCIATION ::=
3022 -- DISCRETE_CHOICE_LIST => EXPRESSION
3024 -- See Record_Component_Association (4.3.1) for node structure
3026 --------------------------------------------------
3027 -- 4.4 Expression/Relation/Term/Factor/Primary --
3028 --------------------------------------------------
3031 -- RELATION {and RELATION} | RELATION {and then RELATION}
3032 -- | RELATION {or RELATION} | RELATION {or else RELATION}
3033 -- | RELATION {xor RELATION}
3036 -- SIMPLE_EXPRESSION [RELATIONAL_OPERATOR SIMPLE_EXPRESSION]
3037 -- | SIMPLE_EXPRESSION [not] in RANGE
3038 -- | SIMPLE_EXPRESSION [not] in SUBTYPE_MARK
3040 -- SIMPLE_EXPRESSION ::=
3041 -- [UNARY_ADDING_OPERATOR] TERM {BINARY_ADDING_OPERATOR TERM}
3043 -- TERM ::= FACTOR {MULTIPLYING_OPERATOR FACTOR}
3045 -- FACTOR ::= PRIMARY [** PRIMARY] | abs PRIMARY | not PRIMARY
3047 -- No nodes are generated for any of these constructs. Instead, the
3048 -- node for the operator appears directly. When we refer to an
3049 -- expression in this description, we mean any of the possible
3050 -- consistuent components of an expression (e.g. identifier is
3051 -- an example of an expression).
3058 -- NUMERIC_LITERAL | null
3059 -- | STRING_LITERAL | AGGREGATE
3060 -- | NAME | QUALIFIED_EXPRESSION
3061 -- | ALLOCATOR | (EXPRESSION)
3063 -- Usually there is no explicit node in the tree for primary. Instead
3064 -- the constituent (e.g. AGGREGATE) appears directly. There are two
3065 -- exceptions. First, there is an explicit node for a null primary.
3068 -- Sloc points to NULL
3069 -- plus fields for expression
3071 -- Second, the case of (EXPRESSION) is handled specially. Ada requires
3072 -- that the parser keep track of which subexpressions are enclosed
3073 -- in parentheses, and how many levels of parentheses are used. This
3074 -- information is required for optimization purposes, and also for
3075 -- some semantic checks (e.g. (((1))) in a procedure spec does not
3076 -- conform with ((((1)))) in the body).
3078 -- The parentheses are recorded by keeping a Paren_Count field in every
3079 -- subexpression node (it is actually present in all nodes, but only
3080 -- used in subexpression nodes). This count records the number of
3081 -- levels of parentheses. If the number of levels in the source exceeds
3082 -- the maximum accomodated by this count, then the count is simply left
3083 -- at the maximum value. This means that there are some pathalogical
3084 -- cases of failure to detect conformance failures (e.g. an expression
3085 -- with 500 levels of parens will conform with one with 501 levels),
3086 -- but we do not need to lose sleep over this.
3088 -- Historical note: in versions of GNAT prior to 1.75, there was a node
3089 -- type N_Parenthesized_Expression used to accurately record unlimited
3090 -- numbers of levels of parentheses. However, it turned out to be a
3091 -- real nuisance to have to take into account the possible presence of
3092 -- this node during semantic analysis, since basically parentheses have
3093 -- zero relevance to semantic analysis.
3095 -- Note: the level of parentheses always present in things like
3096 -- aggregates does not count, only the parentheses in the primary
3097 -- (EXPRESSION) affect the setting of the Paren_Count field.
3099 -- 2nd Note: the contents of the Expression field must be ignored (i.e.
3100 -- treated as though it were Empty) if No_Initialization is set True.
3102 --------------------------------------
3103 -- 4.5 Short Circuit Control Forms --
3104 --------------------------------------
3107 -- RELATION {and then RELATION} | RELATION {or else RELATION}
3109 -- Gigi restriction: For both these control forms, the operand and
3110 -- result types are always Standard.Boolean. The expander inserts the
3111 -- required conversion operations where needed to ensure this is the
3115 -- Sloc points to AND of AND THEN
3116 -- Left_Opnd (Node2)
3117 -- Right_Opnd (Node3)
3118 -- Actions (List1-Sem)
3119 -- plus fields for expression
3122 -- Sloc points to OR of OR ELSE
3123 -- Left_Opnd (Node2)
3124 -- Right_Opnd (Node3)
3125 -- Actions (List1-Sem)
3126 -- plus fields for expression
3128 -- Note: The Actions field is used to hold actions associated with
3129 -- the right hand operand. These have to be treated specially since
3130 -- they are not unconditionally executed. See Insert_Actions for a
3131 -- more detailed description of how these actions are handled.
3133 ---------------------------
3134 -- 4.5 Membership Tests --
3135 ---------------------------
3138 -- SIMPLE_EXPRESSION [not] in RANGE
3139 -- | SIMPLE_EXPRESSION [not] in SUBTYPE_MARK
3141 -- Note: although the grammar above allows only a range or a
3142 -- subtype mark, the parser in fact will accept any simple
3143 -- expression in place of a subtype mark. This means that the
3144 -- semantic analyzer must be prepared to deal with, and diagnose
3145 -- a simple expression other than a name for the right operand.
3146 -- This simplifies error recovery in the parser.
3149 -- Sloc points to IN
3150 -- Left_Opnd (Node2)
3151 -- Right_Opnd (Node3)
3152 -- plus fields for expression
3155 -- Sloc points to NOT of NOT IN
3156 -- Left_Opnd (Node2)
3157 -- Right_Opnd (Node3)
3158 -- plus fields for expression
3160 --------------------
3162 --------------------
3164 -- LOGICAL_OPERATOR ::= and | or | xor
3166 -- RELATIONAL_OPERATOR ::= = | /= | < | <= | > | >=
3168 -- BINARY_ADDING_OPERATOR ::= + | - | &
3170 -- UNARY_ADDING_OPERATOR ::= + | -
3172 -- MULTIPLYING_OPERATOR ::= * | / | mod | rem
3174 -- HIGHEST_PRECEDENCE_OPERATOR ::= ** | abs | not
3176 -- Sprint syntax if Treat_Fixed_As_Integer is set:
3183 -- Gigi restriction: For * / mod rem with fixed-point operands, Gigi
3184 -- will only be given nodes with the Treat_Fixed_As_Integer flag set.
3185 -- All handling of smalls for multiplication and division is handled
3186 -- by the front end (mod and rem result only from expansion). Gigi
3187 -- thus never needs to worry about small values (for other operators
3188 -- operating on fixed-point, e.g. addition, the small value does not
3189 -- have any semantic effect anyway, these are always integer operations.
3191 -- Gigi restriction: For all operators taking Boolean operands, the
3192 -- type is always Standard.Boolean. The expander inserts the required
3193 -- conversion operations where needed to ensure this is the case.
3196 -- Sloc points to AND
3197 -- Do_Length_Check (Flag4-Sem)
3198 -- plus fields for binary operator
3199 -- plus fields for expression
3202 -- Sloc points to OR
3203 -- Do_Length_Check (Flag4-Sem)
3204 -- plus fields for binary operator
3205 -- plus fields for expression
3208 -- Sloc points to XOR
3209 -- Do_Length_Check (Flag4-Sem)
3210 -- plus fields for binary operator
3211 -- plus fields for expression
3215 -- plus fields for binary operator
3216 -- plus fields for expression
3219 -- Sloc points to /=
3220 -- plus fields for binary operator
3221 -- plus fields for expression
3225 -- plus fields for binary operator
3226 -- plus fields for expression
3229 -- Sloc points to <=
3230 -- plus fields for binary operator
3231 -- plus fields for expression
3235 -- plus fields for binary operator
3236 -- plus fields for expression
3239 -- Sloc points to >=
3240 -- plus fields for binary operator
3241 -- plus fields for expression
3244 -- Sloc points to + (binary)
3245 -- plus fields for binary operator
3246 -- plus fields for expression
3249 -- Sloc points to - (binary)
3250 -- plus fields for binary operator
3251 -- plus fields for expression
3255 -- Is_Component_Left_Opnd (Flag13-Sem)
3256 -- Is_Component_Right_Opnd (Flag14-Sem)
3257 -- plus fields for binary operator
3258 -- plus fields for expression
3262 -- Treat_Fixed_As_Integer (Flag14-Sem)
3263 -- Rounded_Result (Flag18-Sem)
3264 -- plus fields for binary operator
3265 -- plus fields for expression
3269 -- Treat_Fixed_As_Integer (Flag14-Sem)
3270 -- Do_Division_Check (Flag13-Sem)
3271 -- Rounded_Result (Flag18-Sem)
3272 -- plus fields for binary operator
3273 -- plus fields for expression
3276 -- Sloc points to MOD
3277 -- Treat_Fixed_As_Integer (Flag14-Sem)
3278 -- Do_Division_Check (Flag13-Sem)
3279 -- plus fields for binary operator
3280 -- plus fields for expression
3283 -- Sloc points to REM
3284 -- Treat_Fixed_As_Integer (Flag14-Sem)
3285 -- Do_Division_Check (Flag13-Sem)
3286 -- plus fields for binary operator
3287 -- plus fields for expression
3290 -- Is_Power_Of_2_For_Shift (Flag13-Sem)
3291 -- Sloc points to **
3292 -- plus fields for binary operator
3293 -- plus fields for expression
3296 -- Sloc points to + (unary)
3297 -- plus fields for unary operator
3298 -- plus fields for expression
3301 -- Sloc points to - (unary)
3302 -- plus fields for unary operator
3303 -- plus fields for expression
3306 -- Sloc points to ABS
3307 -- plus fields for unary operator
3308 -- plus fields for expression
3311 -- Sloc points to NOT
3312 -- plus fields for unary operator
3313 -- plus fields for expression
3315 -- See also shift operators in section B.2
3317 -- Note on fixed-point operations passed to Gigi: For adding operators,
3318 -- the semantics is to treat these simply as integer operations, with
3319 -- the small values being ignored (the bounds are already stored in
3320 -- units of small, so that constraint checking works as usual). For the
3321 -- case of multiply/divide/rem/mod operations, Gigi will only see fixed
3322 -- point operands if the Treat_Fixed_As_Integer flag is set and will
3323 -- thus treat these nodes in identical manner, ignoring small values.
3325 --------------------------
3326 -- 4.6 Type Conversion --
3327 --------------------------
3329 -- TYPE_CONVERSION ::=
3330 -- SUBTYPE_MARK (EXPRESSION) | SUBTYPE_MARK (NAME)
3332 -- In the (NAME) case, the name is stored as the expression
3334 -- Note: the parser never generates a type conversion node, since it
3335 -- looks like an indexed component which is generated by preference.
3336 -- The semantic pass must correct this misidentification.
3338 -- Gigi handles conversions that involve no change in the root type,
3339 -- and also all conversions from integer to floating-point types.
3340 -- Conversions from floating-point to integer are only handled in
3341 -- the case where Float_Truncate flag set. Other conversions from
3342 -- floating-point to integer (involving rounding) and all conversions
3343 -- involving fixed-point types are handled by the expander.
3345 -- Sprint syntax if Float_Truncate set: X^(Y)
3346 -- Sprint syntax if Conversion_OK set X?(Y)
3347 -- Sprint syntax if both flags set X?^(Y)
3349 -- Note: If either the operand or result type is fixed-point, Gigi will
3350 -- only see a type conversion node with Conversion_OK set. The front end
3351 -- takes care of all handling of small's for fixed-point conversions.
3353 -- N_Type_Conversion
3354 -- Sloc points to first token of subtype mark
3355 -- Subtype_Mark (Node4)
3356 -- Expression (Node3)
3357 -- Do_Overflow_Check (Flag17-Sem)
3358 -- Do_Tag_Check (Flag13-Sem)
3359 -- Do_Length_Check (Flag4-Sem)
3360 -- Float_Truncate (Flag11-Sem)
3361 -- Rounded_Result (Flag18-Sem)
3362 -- Conversion_OK (Flag14-Sem)
3363 -- plus fields for expression
3365 -- Note: if a range check is required, then the Do_Range_Check flag
3366 -- is set in the Expression with the check being done against the
3367 -- target type range (after the base type conversion, if any).
3369 -------------------------------
3370 -- 4.7 Qualified Expression --
3371 -------------------------------
3373 -- QUALIFIED_EXPRESSION ::=
3374 -- SUBTYPE_MARK ' (EXPRESSION) | SUBTYPE_MARK ' AGGREGATE
3376 -- Note: the parentheses in the (EXPRESSION) case are deemed to enclose
3377 -- the expression, so the Expression field of this node always points
3378 -- to a parenthesized expression in this case (i.e. Paren_Count will
3379 -- always be non-zero for the referenced expression if it is not an
3382 -- N_Qualified_Expression
3383 -- Sloc points to apostrophe
3384 -- Subtype_Mark (Node4)
3385 -- Expression (Node3) expression or aggregate
3386 -- plus fields for expression
3388 --------------------
3390 --------------------
3393 -- new SUBTYPE_INDICATION | new QUALIFIED_EXPRESSION
3395 -- Sprint syntax (when storage pool present)
3396 -- new xxx (storage_pool = pool)
3399 -- Sloc points to NEW
3400 -- Expression (Node3) subtype indication or qualified expression
3401 -- Storage_Pool (Node1-Sem)
3402 -- Procedure_To_Call (Node4-Sem)
3403 -- No_Initialization (Flag13-Sem)
3404 -- Do_Storage_Check (Flag17-Sem)
3405 -- plus fields for expression
3407 ---------------------------------
3408 -- 5.1 Sequence Of Statements --
3409 ---------------------------------
3411 -- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT}
3413 -- Note: Although the parser will not accept a declaration as a
3414 -- statement, the semantic analyzer may insert declarations (e.g.
3415 -- declarations of implicit types needed for execution of other
3416 -- statements) into a sequence of statements, so the code genmerator
3417 -- should be prepared to accept a declaration where a statement is
3418 -- expected. Note also that pragmas can appear as statements.
3420 --------------------
3422 --------------------
3425 -- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT
3427 -- There is no explicit node in the tree for a statement. Instead, the
3428 -- individual statement appears directly. Labels are treated as a
3429 -- kind of statement, i.e. they are linked into a statement list at
3430 -- the point they appear, so the labeled statement appears following
3431 -- the label or labels in the statement list.
3433 ---------------------------
3434 -- 5.1 Simple Statement --
3435 ---------------------------
3437 -- SIMPLE_STATEMENT ::= NULL_STATEMENT
3438 -- | ASSIGNMENT_STATEMENT | EXIT_STATEMENT
3439 -- | GOTO_STATEMENT | PROCEDURE_CALL_STATEMENT
3440 -- | RETURN_STATEMENT | ENTRY_CALL_STATEMENT
3441 -- | REQUEUE_STATEMENT | DELAY_STATEMENT
3442 -- | ABORT_STATEMENT | RAISE_STATEMENT
3445 -----------------------------
3446 -- 5.1 Compound Statement --
3447 -----------------------------
3449 -- COMPOUND_STATEMENT ::=
3450 -- IF_STATEMENT | CASE_STATEMENT
3451 -- | LOOP_STATEMENT | BLOCK_STATEMENT
3452 -- | ACCEPT_STATEMENT | SELECT_STATEMENT
3454 -------------------------
3455 -- 5.1 Null Statement --
3456 -------------------------
3458 -- NULL_STATEMENT ::= null;
3461 -- Sloc points to NULL
3467 -- LABEL ::= <<label_STATEMENT_IDENTIFIER>>
3469 -- Note that the occurrence of a label is not a defining identifier,
3470 -- but rather a referencing occurrence. The defining occurrence is
3471 -- in the implicit label declaration which occurs in the innermost
3475 -- Sloc points to <<
3476 -- Identifier (Node1) direct name of statement identifier
3477 -- Exception_Junk (Flag11-Sem)
3479 -------------------------------
3480 -- 5.1 Statement Identifier --
3481 -------------------------------
3483 -- STATEMENT_INDENTIFIER ::= DIRECT_NAME
3485 -- The IDENTIFIER of a STATEMENT_IDENTIFIER shall be an identifier
3486 -- (not an OPERATOR_SYMBOL)
3488 -------------------------------
3489 -- 5.2 Assignment Statement --
3490 -------------------------------
3492 -- ASSIGNMENT_STATEMENT ::=
3493 -- variable_NAME := EXPRESSION;
3495 -- N_Assignment_Statement
3496 -- Sloc points to :=
3498 -- Expression (Node3)
3499 -- Do_Tag_Check (Flag13-Sem)
3500 -- Do_Length_Check (Flag4-Sem)
3501 -- Forwards_OK (Flag5-Sem)
3502 -- Backwards_OK (Flag6-Sem)
3503 -- No_Ctrl_Actions (Flag7-Sem)
3505 -- Note: if a range check is required, then the Do_Range_Check flag
3506 -- is set in the Expression (right hand side), with the check being
3507 -- done against the type of the Name (left hand side).
3509 -----------------------
3510 -- 5.3 If Statement --
3511 -----------------------
3514 -- if CONDITION then
3515 -- SEQUENCE_OF_STATEMENTS
3516 -- {elsif CONDITION then
3517 -- SEQUENCE_OF_STATEMENTS}
3519 -- SEQUENCE_OF_STATEMENTS]
3522 -- Gigi restriction: This expander ensures that the type of the
3523 -- Condition fields is always Standard.Boolean, even if the type
3524 -- in the source is some non-standard boolean type.
3527 -- Sloc points to IF
3528 -- Condition (Node1)
3529 -- Then_Statements (List2)
3530 -- Elsif_Parts (List3) (set to No_List if none present)
3531 -- Else_Statements (List4) (set to No_List if no else part present)
3532 -- End_Span (Uint5) (set to No_Uint if expander generated)
3535 -- Sloc points to ELSIF
3536 -- Condition (Node1)
3537 -- Then_Statements (List2)
3538 -- Condition_Actions (List3-Sem)
3540 --------------------
3542 --------------------
3544 -- CONDITION ::= boolean_EXPRESSION
3546 -------------------------
3547 -- 5.4 Case Statement --
3548 -------------------------
3550 -- CASE_STATEMENT ::=
3551 -- case EXPRESSION is
3552 -- CASE_STATEMENT_ALTERNATIVE
3553 -- {CASE_STATEMENT_ALTERNATIVE}
3556 -- Note: the Alternatives can contain pragmas. These only occur at
3557 -- the start of the list, since any pragmas occurring after the first
3558 -- alternative are absorbed into the corresponding statement sequence.
3561 -- Sloc points to CASE
3562 -- Expression (Node3)
3563 -- Alternatives (List4)
3564 -- End_Span (Uint5) (set to No_Uint if expander generated)
3566 -------------------------------------
3567 -- 5.4 Case Statement Alternative --
3568 -------------------------------------
3570 -- CASE_STATEMENT_ALTERNATIVE ::=
3571 -- when DISCRETE_CHOICE_LIST =>
3572 -- SEQUENCE_OF_STATEMENTS
3574 -- N_Case_Statement_Alternative
3575 -- Sloc points to WHEN
3576 -- Discrete_Choices (List4)
3577 -- Statements (List3)
3579 -------------------------
3580 -- 5.5 Loop Statement --
3581 -------------------------
3583 -- LOOP_STATEMENT ::=
3584 -- [loop_STATEMENT_IDENTIFIER :]
3585 -- [ITERATION_SCHEME] loop
3586 -- SEQUENCE_OF_STATEMENTS
3587 -- end loop [loop_IDENTIFIER];
3589 -- Note: The occurrence of a loop label is not a defining identifier
3590 -- but rather a referencing occurrence. The defining occurrence is in
3591 -- the implicit label declaration which occurs in the innermost
3594 -- Note: there is always a loop statement identifier present in
3595 -- the tree, even if none was given in the source. In the case where
3596 -- no loop identifier is given in the source, the parser creates
3597 -- a name of the form _Loop_n, where n is a decimal integer (the
3598 -- two underlines ensure that the loop names created in this manner
3599 -- do not conflict with any user defined identifiers), and the flag
3600 -- Has_Created_Identifier is set to True. The only exception to the
3601 -- rule that all loop statement nodes have identifiers occurs for
3602 -- loops constructed by the expander, and the semantic analyzer will
3603 -- create and supply dummy loop identifiers in these cases.
3606 -- Sloc points to LOOP
3607 -- Identifier (Node1) loop identifier (set to Empty if no identifier)
3608 -- Iteration_Scheme (Node2) (set to Empty if no iteration scheme)
3609 -- Statements (List3)
3610 -- End_Label (Node4)
3611 -- Has_Created_Identifier (Flag15)
3613 --------------------------
3614 -- 5.5 Iteration Scheme --
3615 --------------------------
3617 -- ITERATION_SCHEME ::=
3618 -- while CONDITION | for LOOP_PARAMETER_SPECIFICATION
3620 -- Gigi restriction: This expander ensures that the type of the
3621 -- Condition field is always Standard.Boolean, even if the type
3622 -- in the source is some non-standard boolean type.
3624 -- N_Iteration_Scheme
3625 -- Sloc points to WHILE or FOR
3626 -- Condition (Node1) (set to Empty if FOR case)
3627 -- Condition_Actions (List3-Sem)
3628 -- Loop_Parameter_Specification (Node4) (set to Empty if WHILE case)
3630 ---------------------------------------
3631 -- 5.5 Loop parameter specification --
3632 ---------------------------------------
3634 -- LOOP_PARAMETER_SPECIFICATION ::=
3635 -- DEFINING_IDENTIFIER in [reverse] DISCRETE_SUBTYPE_DEFINITION
3637 -- N_Loop_Parameter_Specification
3638 -- Sloc points to first identifier
3639 -- Defining_Identifier (Node1)
3640 -- Reverse_Present (Flag15)
3641 -- Discrete_Subtype_Definition (Node4)
3643 --------------------------
3644 -- 5.6 Block Statement --
3645 --------------------------
3647 -- BLOCK_STATEMENT ::=
3648 -- [block_STATEMENT_IDENTIFIER:]
3650 -- DECLARATIVE_PART]
3652 -- HANDLED_SEQUENCE_OF_STATEMENTS
3653 -- end [block_IDENTIFIER];
3655 -- Note that the occurrence of a block identifier is not a defining
3656 -- identifier, but rather a referencing occurrence. The defining
3657 -- occurrence is in the implicit label declaration which occurs in
3658 -- the innermost enclosing block.
3660 -- Note: there is always a block statement identifier present in
3661 -- the tree, even if none was given in the source. In the case where
3662 -- no block identifier is given in the source, the parser creates
3663 -- a name of the form _Block_n, where n is a decimal integer (the
3664 -- two underlines ensure that the block names created in this manner
3665 -- do not conflict with any user defined identifiers), and the flag
3666 -- Has_Created_Identifier is set to True. The only exception to the
3667 -- rule that all loop statement nodes have identifiers occurs for
3668 -- blocks constructed by the expander, and the semantic analyzer
3669 -- creates and supplies dummy names for the blocks).
3671 -- N_Block_Statement
3672 -- Sloc points to DECLARE or BEGIN
3673 -- Identifier (Node1) block direct name (set to Empty if not present)
3674 -- Declarations (List2) (set to No_List if no DECLARE part)
3675 -- Handled_Statement_Sequence (Node4)
3676 -- Is_Task_Master (Flag5-Sem)
3677 -- Activation_Chain_Entity (Node3-Sem)
3678 -- Has_Created_Identifier (Flag15)
3679 -- Is_Task_Allocation_Block (Flag6)
3680 -- Is_Asynchronous_Call_Block (Flag7)
3682 -------------------------
3683 -- 5.7 Exit Statement --
3684 -------------------------
3686 -- EXIT_STATEMENT ::= exit [loop_NAME] [when CONDITION];
3688 -- Gigi restriction: This expander ensures that the type of the
3689 -- Condition field is always Standard.Boolean, even if the type
3690 -- in the source is some non-standard boolean type.
3693 -- Sloc points to EXIT
3694 -- Name (Node2) (set to Empty if no loop name present)
3695 -- Condition (Node1) (set to Empty if no when part present)
3697 -------------------------
3698 -- 5.9 Goto Statement --
3699 -------------------------
3701 -- GOTO_STATEMENT ::= goto label_NAME;
3704 -- Sloc points to GOTO
3706 -- Exception_Junk (Flag11-Sem)
3708 ---------------------------------
3709 -- 6.1 Subprogram Declaration --
3710 ---------------------------------
3712 -- SUBPROGRAM_DECLARATION ::= SUBPROGRAM_SPECIFICATION;
3714 -- N_Subprogram_Declaration
3715 -- Sloc points to FUNCTION or PROCEDURE
3716 -- Specification (Node1)
3717 -- Body_To_Inline (Node3-Sem)
3718 -- Corresponding_Body (Node5-Sem)
3719 -- Parent_Spec (Node4-Sem)
3721 ------------------------------------------
3722 -- 6.1 Abstract Subprogram Declaration --
3723 ------------------------------------------
3725 -- ABSTRACT_SUBPROGRAM_DECLARATION ::=
3726 -- SUBPROGRAM_SPECIFICATION is abstract;
3728 -- N_Abstract_Subprogram_Declaration
3729 -- Sloc points to ABSTRACT
3730 -- Specification (Node1)
3732 -----------------------------------
3733 -- 6.1 Subprogram Specification --
3734 -----------------------------------
3736 -- SUBPROGRAM_SPECIFICATION ::=
3737 -- procedure DEFINING_PROGRAM_UNIT_NAME PARAMETER_PROFILE
3738 -- | function DEFINING_DESIGNATOR PARAMETER_AND_RESULT_PROFILE
3740 -- Note: there are no separate nodes for the profiles, instead the
3741 -- information appears directly in the following nodes.
3743 -- N_Function_Specification
3744 -- Sloc points to FUNCTION
3745 -- Defining_Unit_Name (Node1) (the designator)
3746 -- Elaboration_Boolean (Node2-Sem)
3747 -- Parameter_Specifications (List3) (set to No_List if no formal part)
3748 -- Subtype_Mark (Node4) for return type
3749 -- Generic_Parent (Node5-Sem)
3751 -- N_Procedure_Specification
3752 -- Sloc points to PROCEDURE
3753 -- Defining_Unit_Name (Node1)
3754 -- Elaboration_Boolean (Node2-Sem)
3755 -- Parameter_Specifications (List3) (set to No_List if no formal part)
3756 -- Generic_Parent (Node5-Sem)
3758 ---------------------
3759 -- 6.1 Designator --
3760 ---------------------
3763 -- [PARENT_UNIT_NAME .] IDENTIFIER | OPERATOR_SYMBOL
3765 -- Designators that are simply identifiers or operator symbols appear
3766 -- directly in the tree in this form. The following node is used only
3767 -- in the case where the designator has a parent unit name component.
3770 -- Sloc points to period
3771 -- Name (Node2) holds the parent unit name. Note that this is always
3772 -- non-Empty, since this node is only used for the case where a
3773 -- parent library unit package name is present.
3774 -- Identifier (Node1)
3776 -- Note that the identifier can also be an operator symbol here.
3778 ------------------------------
3779 -- 6.1 Defining Designator --
3780 ------------------------------
3782 -- DEFINING_DESIGNATOR ::=
3783 -- DEFINING_PROGRAM_UNIT_NAME | DEFINING_OPERATOR_SYMBOL
3785 -------------------------------------
3786 -- 6.1 Defining Program Unit Name --
3787 -------------------------------------
3789 -- DEFINING_PROGRAM_UNIT_NAME ::=
3790 -- [PARENT_UNIT_NAME .] DEFINING_IDENTIFIER
3792 -- The parent unit name is present only in the case of a child unit
3793 -- name (permissible only for Ada 95 for a library level unit, i.e.
3794 -- a unit at scope level one). If no such name is present, the defining
3795 -- program unit name is represented simply as the defining identifier.
3796 -- In the child unit case, the following node is used to represent the
3799 -- N_Defining_Program_Unit_Name
3800 -- Sloc points to period
3801 -- Name (Node2) holds the parent unit name. Note that this is always
3802 -- non-Empty, since this node is only used for the case where a
3803 -- parent unit name is present.
3804 -- Defining_Identifier (Node1)
3806 --------------------------
3807 -- 6.1 Operator Symbol --
3808 --------------------------
3810 -- OPERATOR_SYMBOL ::= STRING_LITERAL
3812 -- Note: the fields of the N_Operator_Symbol node are laid out to
3813 -- match the corresponding fields of an N_Character_Literal node. This
3814 -- allows easy conversion of the operator symbol node into a character
3815 -- literal node in the case where a string constant of the form of an
3816 -- operator symbol is scanned out as such, but turns out semantically
3817 -- to be a string literal that is not an operator. For details see
3818 -- Sinfo.CN.Change_Operator_Symbol_To_String_Literal.
3820 -- N_Operator_Symbol
3821 -- Sloc points to literal
3822 -- Chars (Name1) contains the Name_Id for the operator symbol
3823 -- Strval (Str3) Id of string value. This is used if the operator
3824 -- symbol turns out to be a normal string after all.
3825 -- Entity (Node4-Sem)
3826 -- Associated_Node (Node4-Sem)
3827 -- Has_Private_View (Flag11-Sem) set in generic units.
3828 -- Etype (Node5-Sem)
3830 -- Note: the Strval field may be set to No_String for generated
3831 -- operator symbols that are known not to be string literals
3834 -----------------------------------
3835 -- 6.1 Defining Operator Symbol --
3836 -----------------------------------
3838 -- DEFINING_OPERATOR_SYMBOL ::= OPERATOR_SYMBOL
3840 -- A defining operator symbol is an entity, which has additional
3841 -- fields depending on the setting of the Ekind field. These
3842 -- additional fields are defined (and access subprograms declared)
3843 -- in package Einfo.
3845 -- Note: N_Defining_Operator_Symbol is an extended node whose fields
3846 -- are deliberately layed out to match the layout of fields in an
3847 -- ordinary N_Operator_Symbol node allowing for easy alteration of
3848 -- an operator symbol node into a defining operator symbol node.
3849 -- See Sinfo.CN.Change_Operator_Symbol_To_Defining_Operator_Symbol
3850 -- for further details.
3852 -- N_Defining_Operator_Symbol
3853 -- Sloc points to literal
3854 -- Chars (Name1) contains the Name_Id for the operator symbol
3855 -- Next_Entity (Node2-Sem)
3856 -- Scope (Node3-Sem)
3857 -- Etype (Node5-Sem)
3859 ----------------------------
3860 -- 6.1 Parameter Profile --
3861 ----------------------------
3863 -- PARAMETER_PROFILE ::= [FORMAL_PART]
3865 ---------------------------------------
3866 -- 6.1 Parameter and Result Profile --
3867 ---------------------------------------
3869 -- PARAMETER_AND_RESULT_PROFILE ::= [FORMAL_PART] return SUBTYPE_MARK
3871 -- There is no explicit node in the tree for a parameter and result
3872 -- profile. Instead the information appears directly in the parent.
3874 ----------------------
3875 -- 6.1 Formal part --
3876 ----------------------
3879 -- (PARAMETER_SPECIFICATION {; PARAMETER_SPECIFICATION})
3881 ----------------------------------
3882 -- 6.1 Parameter specification --
3883 ----------------------------------
3885 -- PARAMETER_SPECIFICATION ::=
3886 -- DEFINING_IDENTIFIER_LIST : MODE SUBTYPE_MARK
3887 -- [:= DEFAULT_EXPRESSION]
3888 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
3889 -- [:= DEFAULT_EXPRESSION]
3891 -- Although the syntax allows multiple identifiers in the list, the
3892 -- semantics is as though successive specifications were given with
3893 -- identical type definition and expression components. To simplify
3894 -- semantic processing, the parser represents a multiple declaration
3895 -- case as a sequence of single Specifications, using the More_Ids and
3896 -- Prev_Ids flags to preserve the original source form as described
3897 -- in the section on "Handling of Defining Identifier Lists".
3899 -- N_Parameter_Specification
3900 -- Sloc points to first identifier
3901 -- Defining_Identifier (Node1)
3902 -- In_Present (Flag15)
3903 -- Out_Present (Flag17)
3904 -- Parameter_Type (Node2) subtype mark or access definition
3905 -- Expression (Node3) (set to Empty if no default expression present)
3906 -- Do_Accessibility_Check (Flag13-Sem)
3907 -- More_Ids (Flag5) (set to False if no more identifiers in list)
3908 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
3909 -- Default_Expression (Node5-Sem)
3915 -- MODE ::= [in] | in out | out
3917 -- There is no explicit node in the tree for the Mode. Instead the
3918 -- In_Present and Out_Present flags are set in the parent node to
3919 -- record the presence of keywords specifying the mode.
3921 --------------------------
3922 -- 6.3 Subprogram Body --
3923 --------------------------
3925 -- SUBPROGRAM_BODY ::=
3926 -- SUBPROGRAM_SPECIFICATION is
3929 -- HANDLED_SEQUENCE_OF_STATEMENTS
3930 -- end [DESIGNATOR];
3932 -- N_Subprogram_Body
3933 -- Sloc points to FUNCTION or PROCEDURE
3934 -- Specification (Node1)
3935 -- Declarations (List2)
3936 -- Handled_Statement_Sequence (Node4)
3937 -- Activation_Chain_Entity (Node3-Sem)
3938 -- Corresponding_Spec (Node5-Sem)
3939 -- Acts_As_Spec (Flag4-Sem)
3940 -- Bad_Is_Detected (Flag15) used only by parser
3941 -- Do_Storage_Check (Flag17-Sem)
3942 -- Has_Priority_Pragma (Flag6-Sem)
3943 -- Is_Protected_Subprogram_Body (Flag7-Sem)
3944 -- Is_Task_Master (Flag5-Sem)
3945 -- Was_Originally_Stub (Flag13-Sem)
3947 -----------------------------------
3948 -- 6.4 Procedure Call Statement --
3949 -----------------------------------
3951 -- PROCEDURE_CALL_STATEMENT ::=
3952 -- procedure_NAME; | procedure_PREFIX ACTUAL_PARAMETER_PART;
3954 -- Note: the reason that a procedure call has expression fields is
3955 -- that it semantically resembles an expression, e.g. overloading is
3956 -- allowed and a type is concocted for semantic processing purposes.
3957 -- Certain of these fields, such as Parens are not relevant, but it
3958 -- is easier to just supply all of them together!
3960 -- N_Procedure_Call_Statement
3961 -- Sloc points to first token of name or prefix
3962 -- Name (Node2) stores name or prefix
3963 -- Parameter_Associations (List3) (set to No_List if no
3964 -- actual parameter part)
3965 -- First_Named_Actual (Node4-Sem)
3966 -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
3967 -- Do_Tag_Check (Flag13-Sem)
3968 -- Parameter_List_Truncated (Flag17-Sem)
3969 -- ABE_Is_Certain (Flag18-Sem)
3970 -- plus fields for expression
3972 -- If any IN parameter requires a range check, then the corresponding
3973 -- argument expression has the Do_Range_Check flag set, and the range
3974 -- check is done against the formal type. Note that this argument
3975 -- expression may appear directly in the Parameter_Associations list,
3976 -- or may be a descendent of an N_Parameter_Association node that
3977 -- appears in this list.
3979 ------------------------
3980 -- 6.4 Function Call --
3981 ------------------------
3983 -- FUNCTION_CALL ::=
3984 -- function_NAME | function_PREFIX ACTUAL_PARAMETER_PART
3986 -- Note: the parser may generate an indexed component node or simply
3987 -- a name node instead of a function call node. The semantic pass must
3988 -- correct this misidentification.
3991 -- Sloc points to first token of name or prefix
3992 -- Name (Node2) stores name or prefix
3993 -- Parameter_Associations (List3) (set to No_List if no
3994 -- actual parameter part)
3995 -- First_Named_Actual (Node4-Sem)
3996 -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
3997 -- Do_Tag_Check (Flag13-Sem)
3998 -- Parameter_List_Truncated (Flag17-Sem)
3999 -- ABE_Is_Certain (Flag18-Sem)
4000 -- plus fields for expression
4002 --------------------------------
4003 -- 6.4 Actual Parameter Part --
4004 --------------------------------
4006 -- ACTUAL_PARAMETER_PART ::=
4007 -- (PARAMETER_ASSOCIATION {,PARAMETER_ASSOCIATION})
4009 --------------------------------
4010 -- 6.4 Parameter Association --
4011 --------------------------------
4013 -- PARAMETER_ASSOCIATION ::=
4014 -- [formal_parameter_SELECTOR_NAME =>] EXPLICIT_ACTUAL_PARAMETER
4016 -- Note: the N_Parameter_Association node is built only if a formal
4017 -- parameter selector name is present, otherwise the parameter
4018 -- association appears in the tree simply as the node for the
4019 -- explicit actual parameter.
4021 -- N_Parameter_Association
4022 -- Sloc points to formal parameter
4023 -- Selector_Name (Node2) (always non-Empty, since this node is
4024 -- only used if a formal parameter selector name is present)
4025 -- Explicit_Actual_Parameter (Node3)
4026 -- Next_Named_Actual (Node4-Sem)
4028 ---------------------------
4029 -- 6.4 Actual Parameter --
4030 ---------------------------
4032 -- EXPLICIT_ACTUAL_PARAMETER ::= EXPRESSION | variable_NAME
4034 ---------------------------
4035 -- 6.5 Return Statement --
4036 ---------------------------
4038 -- RETURN_STATEMENT ::= return [EXPRESSION];
4040 -- N_Return_Statement
4041 -- Sloc points to RETURN
4042 -- Expression (Node3) (set to Empty if no expression present)
4043 -- Storage_Pool (Node1-Sem)
4044 -- Procedure_To_Call (Node4-Sem)
4045 -- Do_Tag_Check (Flag13-Sem)
4046 -- Return_Type (Node2-Sem)
4047 -- By_Ref (Flag5-Sem)
4049 -- Note: if a range check is required, then Do_Range_Check is set
4050 -- on the Expression. The range check is against Return_Type.
4052 ------------------------------
4053 -- 7.1 Package Declaration --
4054 ------------------------------
4056 -- PACKAGE_DECLARATION ::= PACKAGE_SPECIFICATION;
4058 -- Note: the activation chain entity for a package spec is used for
4059 -- all tasks declared in the package spec, or in the package body.
4061 -- N_Package_Declaration
4062 -- Sloc points to PACKAGE
4063 -- Specification (Node1)
4064 -- Corresponding_Body (Node5-Sem)
4065 -- Parent_Spec (Node4-Sem)
4066 -- Activation_Chain_Entity (Node3-Sem)
4068 --------------------------------
4069 -- 7.1 Package Specification --
4070 --------------------------------
4072 -- PACKAGE_SPECIFICATION ::=
4073 -- package DEFINING_PROGRAM_UNIT_NAME is
4074 -- {BASIC_DECLARATIVE_ITEM}
4076 -- {BASIC_DECLARATIVE_ITEM}]
4077 -- end [[PARENT_UNIT_NAME .] IDENTIFIER]
4079 -- N_Package_Specification
4080 -- Sloc points to PACKAGE
4081 -- Defining_Unit_Name (Node1)
4082 -- Visible_Declarations (List2)
4083 -- Private_Declarations (List3) (set to No_List if no private
4085 -- End_Label (Node4)
4086 -- Generic_Parent (Node5-Sem)
4088 -----------------------
4089 -- 7.1 Package Body --
4090 -----------------------
4093 -- package body DEFINING_PROGRAM_UNIT_NAME is
4096 -- HANDLED_SEQUENCE_OF_STATEMENTS]
4097 -- end [[PARENT_UNIT_NAME .] IDENTIFIER];
4100 -- Sloc points to PACKAGE
4101 -- Defining_Unit_Name (Node1)
4102 -- Declarations (List2)
4103 -- Handled_Statement_Sequence (Node4) (set to Empty if no HSS present)
4104 -- Corresponding_Spec (Node5-Sem)
4105 -- Was_Originally_Stub (Flag13-Sem)
4107 -- Note: if a source level package does not contain a handled sequence
4108 -- of statements, then the parser supplies a dummy one with a null
4109 -- sequence of statements. Comes_From_Source will be False in this
4110 -- constructed sequence. The reason we need this is for the End_Label
4111 -- field in the HSS.
4113 -----------------------------------
4114 -- 7.4 Private Type Declaration --
4115 -----------------------------------
4117 -- PRIVATE_TYPE_DECLARATION ::=
4118 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
4119 -- is [[abstract] tagged] [limited] private;
4121 -- Note: TAGGED is not permitted in Ada 83 mode
4123 -- N_Private_Type_Declaration
4124 -- Sloc points to TYPE
4125 -- Defining_Identifier (Node1)
4126 -- Discriminant_Specifications (List4) (set to No_List if no
4127 -- discriminant part)
4128 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
4129 -- Abstract_Present (Flag4)
4130 -- Tagged_Present (Flag15)
4131 -- Limited_Present (Flag17)
4133 ----------------------------------------
4134 -- 7.4 Private Extension Declaration --
4135 ----------------------------------------
4137 -- PRIVATE_EXTENSION_DECLARATION ::=
4138 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] is
4139 -- [abstract] new ancestor_SUBTYPE_INDICATION with private;
4141 -- Note: private extension declarations are not allowed in Ada 83 mode
4143 -- N_Private_Extension_Declaration
4144 -- Sloc points to TYPE
4145 -- Defining_Identifier (Node1)
4146 -- Discriminant_Specifications (List4) (set to No_List if no
4147 -- discriminant part)
4148 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
4149 -- Abstract_Present (Flag4)
4150 -- Subtype_Indication (Node5)
4152 ---------------------
4153 -- 8.4 Use Clause --
4154 ---------------------
4156 -- USE_CLAUSE ::= USE_PACKAGE_CLAUSE | USE_TYPE_CLAUSE
4158 -----------------------------
4159 -- 8.4 Use Package Clause --
4160 -----------------------------
4162 -- USE_PACKAGE_CLAUSE ::= use package_NAME {, package_NAME};
4164 -- N_Use_Package_Clause
4165 -- Sloc points to USE
4167 -- Next_Use_Clause (Node3-Sem)
4168 -- Hidden_By_Use_Clause (Elist4-Sem)
4170 --------------------------
4171 -- 8.4 Use Type Clause --
4172 --------------------------
4174 -- USE_TYPE_CLAUSE ::= use type SUBTYPE_MARK {, SUBTYPE_MARK};
4176 -- Note: use type clause is not permitted in Ada 83 mode
4178 -- N_Use_Type_Clause
4179 -- Sloc points to USE
4180 -- Subtype_Marks (List2)
4181 -- Next_Use_Clause (Node3-Sem)
4182 -- Hidden_By_Use_Clause (Elist4-Sem)
4184 -------------------------------
4185 -- 8.5 Renaming Declaration --
4186 -------------------------------
4188 -- RENAMING_DECLARATION ::=
4189 -- OBJECT_RENAMING_DECLARATION
4190 -- | EXCEPTION_RENAMING_DECLARATION
4191 -- | PACKAGE_RENAMING_DECLARATION
4192 -- | SUBPROGRAM_RENAMING_DECLARATION
4193 -- | GENERIC_RENAMING_DECLARATION
4195 --------------------------------------
4196 -- 8.5 Object Renaming Declaration --
4197 --------------------------------------
4199 -- OBJECT_RENAMING_DECLARATION ::=
4200 -- DEFINING_IDENTIFIER : SUBTYPE_MARK renames object_NAME;
4202 -- N_Object_Renaming_Declaration
4203 -- Sloc points to first identifier
4204 -- Defining_Identifier (Node1)
4205 -- Subtype_Mark (Node4)
4207 -- Corresponding_Generic_Association (Node5-Sem)
4209 -----------------------------------------
4210 -- 8.5 Exception Renaming Declaration --
4211 -----------------------------------------
4213 -- EXCEPTION_RENAMING_DECLARATION ::=
4214 -- DEFINING_IDENTIFIER : exception renames exception_NAME;
4216 -- N_Exception_Renaming_Declaration
4217 -- Sloc points to first identifier
4218 -- Defining_Identifier (Node1)
4221 ---------------------------------------
4222 -- 8.5 Package Renaming Declaration --
4223 ---------------------------------------
4225 -- PACKAGE_RENAMING_DECLARATION ::=
4226 -- package DEFINING_PROGRAM_UNIT_NAME renames package_NAME;
4228 -- N_Package_Renaming_Declaration
4229 -- Sloc points to PACKAGE
4230 -- Defining_Unit_Name (Node1)
4232 -- Parent_Spec (Node4-Sem)
4234 ------------------------------------------
4235 -- 8.5 Subprogram Renaming Declaration --
4236 ------------------------------------------
4238 -- SUBPROGRAM_RENAMING_DECLARATION ::=
4239 -- SUBPROGRAM_SPECIFICATION renames callable_entity_NAME;
4241 -- N_Subprogram_Renaming_Declaration
4242 -- Sloc points to RENAMES
4243 -- Specification (Node1)
4245 -- Parent_Spec (Node4-Sem)
4246 -- Corresponding_Spec (Node5-Sem)
4248 -----------------------------------------
4249 -- 8.5.5 Generic Renaming Declaration --
4250 -----------------------------------------
4252 -- GENERIC_RENAMING_DECLARATION ::=
4253 -- generic package DEFINING_PROGRAM_UNIT_NAME
4254 -- renames generic_package_NAME
4255 -- | generic procedure DEFINING_PROGRAM_UNIT_NAME
4256 -- renames generic_procedure_NAME
4257 -- | generic function DEFINING_PROGRAM_UNIT_NAME
4258 -- renames generic_function_NAME
4260 -- N_Generic_Package_Renaming_Declaration
4261 -- Sloc points to GENERIC
4262 -- Defining_Unit_Name (Node1)
4264 -- Parent_Spec (Node4-Sem)
4266 -- N_Generic_Procedure_Renaming_Declaration
4267 -- Sloc points to GENERIC
4268 -- Defining_Unit_Name (Node1)
4270 -- Parent_Spec (Node4-Sem)
4272 -- N_Generic_Function_Renaming_Declaration
4273 -- Sloc points to GENERIC
4274 -- Defining_Unit_Name (Node1)
4276 -- Parent_Spec (Node4-Sem)
4278 --------------------------------
4279 -- 9.1 Task Type Declaration --
4280 --------------------------------
4282 -- TASK_TYPE_DECLARATION ::=
4283 -- task type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
4284 -- [is TASK_DEFINITITION];
4286 -- N_Task_Type_Declaration
4287 -- Sloc points to TASK
4288 -- Defining_Identifier (Node1)
4289 -- Task_Body_Procedure (Node2-Sem)
4290 -- Discriminant_Specifications (List4) (set to No_List if no
4291 -- discriminant part)
4292 -- Task_Definition (Node3) (set to Empty if not present)
4293 -- Corresponding_Body (Node5-Sem)
4295 ----------------------------------
4296 -- 9.1 Single Task Declaration --
4297 ----------------------------------
4299 -- SINGLE_TASK_DECLARATION ::=
4300 -- task DEFINING_IDENTIFIER [is TASK_DEFINITION];
4302 -- N_Single_Task_Declaration
4303 -- Sloc points to TASK
4304 -- Defining_Identifier (Node1)
4305 -- Task_Definition (Node3) (set to Empty if not present)
4307 --------------------------
4308 -- 9.1 Task Definition --
4309 --------------------------
4311 -- TASK_DEFINITION ::=
4315 -- end [task_IDENTIFIER]
4317 -- Note: as a result of semantic analysis, the list of task items can
4318 -- include implicit type declarations resulting from entry families.
4320 -- N_Task_Definition
4321 -- Sloc points to first token of task definition
4322 -- Visible_Declarations (List2)
4323 -- Private_Declarations (List3) (set to No_List if no private part)
4324 -- End_Label (Node4)
4325 -- Has_Priority_Pragma (Flag6-Sem)
4326 -- Has_Storage_Size_Pragma (Flag5-Sem)
4327 -- Has_Task_Info_Pragma (Flag7-Sem)
4328 -- Has_Task_Name_Pragma (Flag8-Sem)
4330 --------------------
4332 --------------------
4334 -- TASK_ITEM ::= ENTRY_DECLARATION | REPRESENTATION_CLAUSE
4336 --------------------
4338 --------------------
4341 -- task body task_DEFINING_IDENTIFIER is
4344 -- HANDLED_SEQUENCE_OF_STATEMENTS
4345 -- end [task_IDENTIFIER];
4347 -- Gigi restriction: This node never appears.
4350 -- Sloc points to TASK
4351 -- Defining_Identifier (Node1)
4352 -- Declarations (List2)
4353 -- Handled_Statement_Sequence (Node4)
4354 -- Is_Task_Master (Flag5-Sem)
4355 -- Activation_Chain_Entity (Node3-Sem)
4356 -- Corresponding_Spec (Node5-Sem)
4357 -- Was_Originally_Stub (Flag13-Sem)
4359 -------------------------------------
4360 -- 9.4 Protected Type Declaration --
4361 -------------------------------------
4363 -- PROTECTED_TYPE_DECLARATION ::=
4364 -- protected type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
4365 -- is PROTECTED_DEFINITION;
4367 -- Note: protected type declarations are not permitted in Ada 83 mode
4369 -- N_Protected_Type_Declaration
4370 -- Sloc points to PROTECTED
4371 -- Defining_Identifier (Node1)
4372 -- Discriminant_Specifications (List4) (set to No_List if no
4373 -- discriminant part)
4374 -- Protected_Definition (Node3)
4375 -- Corresponding_Body (Node5-Sem)
4377 ---------------------------------------
4378 -- 9.4 Single Protected Declaration --
4379 ---------------------------------------
4381 -- SINGLE_PROTECTED_DECLARATION ::=
4382 -- protected DEFINING_IDENTIFIER is PROTECTED_DEFINITION;
4384 -- Note: single protected declarations are not allowed in Ada 83 mode
4386 -- N_Single_Protected_Declaration
4387 -- Sloc points to PROTECTED
4388 -- Defining_Identifier (Node1)
4389 -- Protected_Definition (Node3)
4391 -------------------------------
4392 -- 9.4 Protected Definition --
4393 -------------------------------
4395 -- PROTECTED_DEFINITION ::=
4396 -- {PROTECTED_OPERATION_DECLARATION}
4398 -- {PROTECTED_ELEMENT_DECLARATION}]
4399 -- end [protected_IDENTIFIER]
4401 -- N_Protected_Definition
4402 -- Sloc points to first token of protected definition
4403 -- Visible_Declarations (List2)
4404 -- Private_Declarations (List3) (set to No_List if no private part)
4405 -- End_Label (Node4)
4406 -- Has_Priority_Pragma (Flag6-Sem)
4408 ------------------------------------------
4409 -- 9.4 Protected Operation Declaration --
4410 ------------------------------------------
4412 -- PROTECTED_OPERATION_DECLARATION ::=
4413 -- SUBPROGRAM_DECLARATION
4414 -- | ENTRY_DECLARATION
4415 -- | REPRESENTATION_CLAUSE
4417 ----------------------------------------
4418 -- 9.4 Protected Element Declaration --
4419 ----------------------------------------
4421 -- PROTECTED_ELEMENT_DECLARATION ::=
4422 -- PROTECTED_OPERATION_DECLARATION | COMPONENT_DECLARATION
4424 -------------------------
4425 -- 9.4 Protected Body --
4426 -------------------------
4428 -- PROTECTED_BODY ::=
4429 -- protected body DEFINING_IDENTIFIER is
4430 -- {PROTECTED_OPERATION_ITEM}
4431 -- end [protected_IDENTIFIER];
4433 -- Note: protected bodies are not allowed in Ada 83 mode
4435 -- Gigi restriction: This node never appears.
4438 -- Sloc points to PROTECTED
4439 -- Defining_Identifier (Node1)
4440 -- Declarations (List2) protected operation items (and pragmas)
4441 -- End_Label (Node4)
4442 -- Corresponding_Spec (Node5-Sem)
4443 -- Was_Originally_Stub (Flag13-Sem)
4445 -----------------------------------
4446 -- 9.4 Protected Operation Item --
4447 -----------------------------------
4449 -- PROTECTED_OPERATION_ITEM ::=
4450 -- SUBPROGRAM_DECLARATION
4451 -- | SUBPROGRAM_BODY
4453 -- | REPRESENTATION_CLAUSE
4455 ------------------------------
4456 -- 9.5.2 Entry Declaration --
4457 ------------------------------
4459 -- ENTRY_DECLARATION ::=
4460 -- entry DEFINING_IDENTIFIER
4461 -- [(DISCRETE_SUBTYPE_DEFINITION)] PARAMETER_PROFILE;
4463 -- N_Entry_Declaration
4464 -- Sloc points to ENTRY
4465 -- Defining_Identifier (Node1)
4466 -- Discrete_Subtype_Definition (Node4) (set to Empty if not present)
4467 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4469 -----------------------------
4470 -- 9.5.2 Accept statement --
4471 -----------------------------
4473 -- ACCEPT_STATEMENT ::=
4474 -- accept entry_DIRECT_NAME
4475 -- [(ENTRY_INDEX)] PARAMETER_PROFILE [do
4476 -- HANDLED_SEQUENCE_OF_STATEMENTS
4477 -- end [entry_IDENTIFIER]];
4479 -- Gigi restriction: This node never appears.
4481 -- Note: there are no explicit declarations allowed in an accept
4482 -- statement. However, the implicit declarations for any statement
4483 -- identifiers (labels and block/loop identifiers) are declarations
4484 -- that belong logically to the accept statement, and that is why
4485 -- there is a Declarations field in this node.
4487 -- N_Accept_Statement
4488 -- Sloc points to ACCEPT
4489 -- Entry_Direct_Name (Node1)
4490 -- Entry_Index (Node5) (set to Empty if not present)
4491 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4492 -- Handled_Statement_Sequence (Node4)
4493 -- Declarations (List2) (set to No_List if no declarations)
4495 ------------------------
4496 -- 9.5.2 Entry Index --
4497 ------------------------
4499 -- ENTRY_INDEX ::= EXPRESSION
4501 -----------------------
4502 -- 9.5.2 Entry Body --
4503 -----------------------
4506 -- entry DEFINING_IDENTIFIER ENTRY_BODY_FORMAL_PART ENTRY_BARRIER is
4509 -- HANDLED_SEQUENCE_OF_STATEMENTS
4510 -- end [entry_IDENTIFIER];
4512 -- ENTRY_BARRIER ::= when CONDITION
4514 -- Note: we store the CONDITION of the ENTRY_BARRIER in the node for
4515 -- the ENTRY_BODY_FORMAL_PART to avoid the N_Entry_Body node getting
4516 -- too full (it would otherwise have too many fields)
4518 -- Gigi restriction: This node never appears.
4521 -- Sloc points to ENTRY
4522 -- Defining_Identifier (Node1)
4523 -- Entry_Body_Formal_Part (Node5)
4524 -- Declarations (List2)
4525 -- Handled_Statement_Sequence (Node4)
4526 -- Activation_Chain_Entity (Node3-Sem)
4528 -----------------------------------
4529 -- 9.5.2 Entry Body Formal Part --
4530 -----------------------------------
4532 -- ENTRY_BODY_FORMAL_PART ::=
4533 -- [(ENTRY_INDEX_SPECIFICATION)] PARAMETER_PROFILE
4535 -- Note that an entry body formal part node is present even if it is
4536 -- empty. This reflects the grammar, in which it is the components of
4537 -- the entry body formal part that are optional, not the entry body
4538 -- formal part itself. Also this means that the barrier condition
4539 -- always has somewhere to be stored.
4541 -- Gigi restriction: This node never appears.
4543 -- N_Entry_Body_Formal_Part
4544 -- Sloc points to first token
4545 -- Entry_Index_Specification (Node4) (set to Empty if not present)
4546 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4547 -- Condition (Node1) from entry barrier of entry body
4549 --------------------------
4550 -- 9.5.2 Entry Barrier --
4551 --------------------------
4553 -- ENTRY_BARRIER ::= when CONDITION
4555 --------------------------------------
4556 -- 9.5.2 Entry Index Specification --
4557 --------------------------------------
4559 -- ENTRY_INDEX_SPECIFICATION ::=
4560 -- for DEFINING_IDENTIFIER in DISCRETE_SUBTYPE_DEFINITION
4562 -- Gigi restriction: This node never appears.
4564 -- N_Entry_Index_Specification
4565 -- Sloc points to FOR
4566 -- Defining_Identifier (Node1)
4567 -- Discrete_Subtype_Definition (Node4)
4569 ---------------------------------
4570 -- 9.5.3 Entry Call Statement --
4571 ---------------------------------
4573 -- ENTRY_CALL_STATEMENT ::= entry_NAME [ACTUAL_PARAMETER_PART];
4575 -- The parser may generate a procedure call for this construct. The
4576 -- semantic pass must correct this misidentification where needed.
4578 -- Gigi restriction: This node never appears.
4580 -- N_Entry_Call_Statement
4581 -- Sloc points to first token of name
4583 -- Parameter_Associations (List3) (set to No_List if no
4584 -- actual parameter part)
4585 -- First_Named_Actual (Node4-Sem)
4587 ------------------------------
4588 -- 9.5.4 Requeue Statement --
4589 ------------------------------
4591 -- REQUEUE_STATEMENT ::= requeue entry_NAME [with abort];
4593 -- Note: requeue statements are not permitted in Ada 83 mode
4595 -- Gigi restriction: This node never appears.
4597 -- N_Requeue_Statement
4598 -- Sloc points to REQUEUE
4600 -- Abort_Present (Flag15)
4602 --------------------------
4603 -- 9.6 Delay Statement --
4604 --------------------------
4606 -- DELAY_STATEMENT ::=
4607 -- DELAY_UNTIL_STATEMENT
4608 -- | DELAY_RELATIVE_STATEMENT
4610 --------------------------------
4611 -- 9.6 Delay Until Statement --
4612 --------------------------------
4614 -- DELAY_UNTIL_STATEMENT ::= delay until delay_EXPRESSION;
4616 -- Note: delay until statements are not permitted in Ada 83 mode
4618 -- Gigi restriction: This node never appears.
4620 -- N_Delay_Until_Statement
4621 -- Sloc points to DELAY
4622 -- Expression (Node3)
4624 -----------------------------------
4625 -- 9.6 Delay Relative Statement --
4626 -----------------------------------
4628 -- DELAY_RELATIVE_STATEMENT ::= delay delay_EXPRESSION;
4630 -- Gigi restriction: This node never appears.
4632 -- N_Delay_Relative_Statement
4633 -- Sloc points to DELAY
4634 -- Expression (Node3)
4636 ---------------------------
4637 -- 9.7 Select Statement --
4638 ---------------------------
4640 -- SELECT_STATEMENT ::=
4642 -- | TIMED_ENTRY_CALL
4643 -- | CONDITIONAL_ENTRY_CALL
4644 -- | ASYNCHRONOUS_SELECT
4646 -----------------------------
4647 -- 9.7.1 Selective Accept --
4648 -----------------------------
4650 -- SELECTIVE_ACCEPT ::=
4653 -- SELECT_ALTERNATIVE
4656 -- SELECT_ALTERNATIVE}
4658 -- SEQUENCE_OF_STATEMENTS]
4661 -- Gigi restriction: This node never appears.
4663 -- Note: the guard expression, if present, appears in the node for
4664 -- the select alternative.
4666 -- N_Selective_Accept
4667 -- Sloc points to SELECT
4668 -- Select_Alternatives (List1)
4669 -- Else_Statements (List4) (set to No_List if no else part)
4675 -- GUARD ::= when CONDITION =>
4677 -- As noted above, the CONDITION that is part of a GUARD is included
4678 -- in the node for the select alernative for convenience.
4680 -------------------------------
4681 -- 9.7.1 Select Alternative --
4682 -------------------------------
4684 -- SELECT_ALTERNATIVE ::=
4685 -- ACCEPT_ALTERNATIVE
4686 -- | DELAY_ALTERNATIVE
4687 -- | TERMINATE_ALTERNATIVE
4689 -------------------------------
4690 -- 9.7.1 Accept Alternative --
4691 -------------------------------
4693 -- ACCEPT_ALTERNATIVE ::=
4694 -- ACCEPT_STATEMENT [SEQUENCE_OF_STATEMENTS]
4696 -- Gigi restriction: This node never appears.
4698 -- N_Accept_Alternative
4699 -- Sloc points to ACCEPT
4700 -- Accept_Statement (Node2)
4701 -- Condition (Node1) from the guard (set to Empty if no guard present)
4702 -- Statements (List3) (set to Empty_List if no statements)
4703 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4704 -- Accept_Handler_Records (List5-Sem)
4706 ------------------------------
4707 -- 9.7.1 Delay Alternative --
4708 ------------------------------
4710 -- DELAY_ALTERNATIVE ::=
4711 -- DELAY_STATEMENT [SEQUENCE_OF_STATEMENTS]
4713 -- Gigi restriction: This node never appears.
4715 -- N_Delay_Alternative
4716 -- Sloc points to DELAY
4717 -- Delay_Statement (Node2)
4718 -- Condition (Node1) from the guard (set to Empty if no guard present)
4719 -- Statements (List3) (set to Empty_List if no statements)
4720 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4722 ----------------------------------
4723 -- 9.7.1 Terminate Alternative --
4724 ----------------------------------
4726 -- TERMINATE_ALTERNATIVE ::= terminate;
4728 -- Gigi restriction: This node never appears.
4730 -- N_Terminate_Alternative
4731 -- Sloc points to TERMINATE
4732 -- Condition (Node1) from the guard (set to Empty if no guard present)
4733 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4734 -- Pragmas_After (List5) pragmas after alt (set to No_List if none)
4736 -----------------------------
4737 -- 9.7.2 Timed Entry Call --
4738 -----------------------------
4740 -- TIMED_ENTRY_CALL ::=
4742 -- ENTRY_CALL_ALTERNATIVE
4744 -- DELAY_ALTERNATIVE
4747 -- Gigi restriction: This node never appears.
4749 -- N_Timed_Entry_Call
4750 -- Sloc points to SELECT
4751 -- Entry_Call_Alternative (Node1)
4752 -- Delay_Alternative (Node4)
4754 -----------------------------------
4755 -- 9.7.2 Entry Call Alternative --
4756 -----------------------------------
4758 -- ENTRY_CALL_ALTERNATIVE ::=
4759 -- ENTRY_CALL_STATEMENT [SEQUENCE_OF_STATEMENTS]
4761 -- Gigi restriction: This node never appears.
4763 -- N_Entry_Call_Alternative
4764 -- Sloc points to first token of entry call statement
4765 -- Entry_Call_Statement (Node1)
4766 -- Statements (List3) (set to Empty_List if no statements)
4767 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4769 -----------------------------------
4770 -- 9.7.3 Conditional Entry Call --
4771 -----------------------------------
4773 -- CONDITIONAL_ENTRY_CALL ::=
4775 -- ENTRY_CALL_ALTERNATIVE
4777 -- SEQUENCE_OF_STATEMENTS
4780 -- Gigi restriction: This node never appears.
4782 -- N_Conditional_Entry_Call
4783 -- Sloc points to SELECT
4784 -- Entry_Call_Alternative (Node1)
4785 -- Else_Statements (List4)
4787 --------------------------------
4788 -- 9.7.4 Asynchronous Select --
4789 --------------------------------
4791 -- ASYNCHRONOUS_SELECT ::=
4793 -- TRIGGERING_ALTERNATIVE
4798 -- Note: asynchronous select is not permitted in Ada 83 mode
4800 -- Gigi restriction: This node never appears.
4802 -- N_Asynchronous_Select
4803 -- Sloc points to SELECT
4804 -- Triggering_Alternative (Node1)
4805 -- Abortable_Part (Node2)
4807 -----------------------------------
4808 -- 9.7.4 Triggering Alternative --
4809 -----------------------------------
4811 -- TRIGGERING_ALTERNATIVE ::=
4812 -- TRIGGERING_STATEMENT [SEQUENCE_OF_STATEMENTS]
4814 -- Gigi restriction: This node never appears.
4816 -- N_Triggering_Alternative
4817 -- Sloc points to first token of triggering statement
4818 -- Triggering_Statement (Node1)
4819 -- Statements (List3) (set to Empty_List if no statements)
4820 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4822 ---------------------------------
4823 -- 9.7.4 Triggering Statement --
4824 ---------------------------------
4826 -- TRIGGERING_STATEMENT ::= ENTRY_CALL_STATEMENT | DELAY_STATEMENT
4828 ---------------------------
4829 -- 9.7.4 Abortable Part --
4830 ---------------------------
4832 -- ABORTABLE_PART ::= SEQUENCE_OF_STATEMENTS
4834 -- Gigi restriction: This node never appears.
4837 -- Sloc points to ABORT
4838 -- Statements (List3)
4840 --------------------------
4841 -- 9.8 Abort Statement --
4842 --------------------------
4844 -- ABORT_STATEMENT ::= abort task_NAME {, task_NAME};
4846 -- Gigi restriction: This node never appears.
4848 -- N_Abort_Statement
4849 -- Sloc points to ABORT
4852 -------------------------
4853 -- 10.1.1 Compilation --
4854 -------------------------
4856 -- COMPILATION ::= {COMPILATION_UNIT}
4858 -- There is no explicit node in the tree for a compilation, since in
4859 -- general the compiler is processing only a single compilation unit
4860 -- at a time. It is possible to parse multiple units in syntax check
4861 -- only mode, but they the trees are discarded in any case.
4863 ------------------------------
4864 -- 10.1.1 Compilation Unit --
4865 ------------------------------
4867 -- COMPILATION_UNIT ::=
4868 -- CONTEXT_CLAUSE LIBRARY_ITEM
4869 -- | CONTEXT_CLAUSE SUBUNIT
4871 -- The N_Compilation_Unit node itself respresents the above syntax.
4872 -- However, there are two additional items not reflected in the above
4873 -- syntax. First we have the global declarations that are added by the
4874 -- code generator. These are outer level declarations (so they cannot
4875 -- be represented as being inside the units). An example is the wrapper
4876 -- subprograms that are created to do ABE checking. As always a list of
4877 -- declarations can contain actions as well (i.e. statements), and such
4878 -- statements are executed as part of the elaboration of the unit. Note
4879 -- that all such declarations are elaborated before the library unit.
4881 -- Similarly, certain actions need to be elaborated at the completion
4882 -- of elaboration of the library unit (notably the statement that sets
4883 -- the Boolean flag indicating that elaboration is complete).
4885 -- The third item not reflected in the syntax is pragmas that appear
4886 -- after the compilation unit. As always pragmas are a problem since
4887 -- they are not part of the formal syntax, but can be stuck into the
4888 -- source following a set of ad hoc rules, and we have to find an ad
4889 -- hoc way of sticking them into the tree. For pragmas that appear
4890 -- before the library unit, we just consider them to be part of the
4891 -- context clause, and pragmas can appear in the Context_Items list
4892 -- of the compilation unit. However, pragmas can also appear after
4893 -- the library item.
4895 -- To deal with all these problems, we create an auxiliary node for
4896 -- a compilation unit, referenced from the N_Compilation_Unit node
4897 -- that contains these three items.
4899 -- N_Compilation_Unit
4900 -- Sloc points to first token of defining unit name
4901 -- Library_Unit (Node4-Sem) corresponding/parent spec/body
4902 -- Context_Items (List1) context items and pragmas preceding unit
4903 -- Private_Present (Flag15) set if library unit has private keyword
4904 -- Unit (Node2) library item or subunit
4905 -- Aux_Decls_Node (Node5) points to the N_Compilation_Unit_Aux node
4906 -- Has_No_Elaboration_Code (Flag17-Sem)
4907 -- Body_Required (Flag13-Sem) set for spec if body is required
4908 -- Acts_As_Spec (Flag4-Sem) flag for subprogram body with no spec
4909 -- First_Inlined_Subprogram (Node3-Sem)
4911 -- N_Compilation_Unit_Aux
4912 -- Sloc is a copy of the Sloc from the N_Compilation_Unit node
4913 -- Declarations (List2) (set to No_List if no global declarations)
4914 -- Actions (List1) (set to No_List if no actions)
4915 -- Pragmas_After (List5) pragmas after unit (set to No_List if none)
4917 --------------------------
4918 -- 10.1.1 Library Item --
4919 --------------------------
4922 -- [private] LIBRARY_UNIT_DECLARATION
4923 -- | LIBRARY_UNIT_BODY
4924 -- | [private] LIBRARY_UNIT_RENAMING_DECLARATION
4926 -- Note: PRIVATE is not allowed in Ada 83 mode
4928 -- There is no explicit node in the tree for library item, instead
4929 -- the declaration or body, and the flag for private if present,
4930 -- appear in the N_Compilation_Unit clause.
4932 ----------------------------------------
4933 -- 10.1.1 Library Unit Declararation --
4934 ----------------------------------------
4936 -- LIBRARY_UNIT_DECLARATION ::=
4937 -- SUBPROGRAM_DECLARATION | PACKAGE_DECLARATION
4938 -- | GENERIC_DECLARATION | GENERIC_INSTANTIATION
4940 -------------------------------------------------
4941 -- 10.1.1 Library Unit Renaming Declararation --
4942 -------------------------------------------------
4944 -- LIBRARY_UNIT_RENAMING_DECLARATION ::=
4945 -- PACKAGE_RENAMING_DECLARATION
4946 -- | GENERIC_RENAMING_DECLARATION
4947 -- | SUBPROGRAM_RENAMING_DECLARATION
4949 -------------------------------
4950 -- 10.1.1 Library unit body --
4951 -------------------------------
4953 -- LIBRARY_UNIT_BODY ::= SUBPROGRAM_BODY | PACKAGE_BODY
4955 ------------------------------
4956 -- 10.1.1 Parent Unit Name --
4957 ------------------------------
4959 -- PARENT_UNIT_NAME ::= NAME
4961 ----------------------------
4962 -- 10.1.2 Context clause --
4963 ----------------------------
4965 -- CONTEXT_CLAUSE ::= {CONTEXT_ITEM}
4967 -- The context clause can include pragmas, and any pragmas that appear
4968 -- before the context clause proper (i.e. all configuration pragmas,
4969 -- also appear at the front of this list).
4971 --------------------------
4972 -- 10.1.2 Context_Item --
4973 --------------------------
4975 -- CONTEXT_ITEM ::= WITH_CLAUSE | USE_CLAUSE | WITH_TYPE_CLAUSE
4977 -------------------------
4978 -- 10.1.2 With clause --
4979 -------------------------
4982 -- with library_unit_NAME {,library_unit_NAME};
4984 -- A separate With clause is built for each name, so that we have
4985 -- a Corresponding_Spec field for each with'ed spec. The flags
4986 -- First_Name and Last_Name are used to reconstruct the exact
4987 -- source form. When a list of names appears in one with clause,
4988 -- the first name in the list has First_Name set, and the last
4989 -- has Last_Name set. If the with clause has only one name, then
4990 -- both of the flags First_Name and Last_Name are set in this name.
4992 -- Note: in the case of implicit with's that are installed by the
4993 -- Rtsfind routine, Implicit_With is set, and the Sloc is typically
4994 -- set to Standard_Location, but it is incorrect to test the Sloc
4995 -- to find out if a with clause is implicit, test the flag instead.
4998 -- Sloc points to first token of library unit name
5000 -- Library_Unit (Node4-Sem)
5001 -- Corresponding_Spec (Node5-Sem)
5002 -- First_Name (Flag5) (set to True if first name or only one name)
5003 -- Last_Name (Flag6) (set to True if last name or only one name)
5004 -- Context_Installed (Flag13-Sem)
5005 -- Elaborate_Present (Flag4-Sem)
5006 -- Elaborate_All_Present (Flag15-Sem)
5007 -- Implicit_With (Flag17-Sem)
5008 -- Unreferenced_In_Spec (Flag7-Sem)
5009 -- No_Entities_Ref_In_Spec (Flag8-Sem)
5011 ----------------------
5012 -- With_Type clause --
5013 ----------------------
5015 -- This is a GNAT extension, used to implement mutually recursive
5016 -- types declared in different packages.
5018 -- WITH_TYPE_CLAUSE ::=
5019 -- with type type_NAME is access | with type type_NAME is tagged
5021 -- N_With_Type_Clause
5022 -- Sloc points to first token of type name
5024 -- Tagged_Present (Flag15)
5026 ---------------------
5027 -- 10.2 Body stub --
5028 ---------------------
5031 -- SUBPROGRAM_BODY_STUB
5032 -- | PACKAGE_BODY_STUB
5034 -- | PROTECTED_BODY_STUB
5036 ----------------------------------
5037 -- 10.1.3 Subprogram Body Stub --
5038 ----------------------------------
5040 -- SUBPROGRAM_BODY_STUB ::=
5041 -- SUBPROGRAM_SPECIFICATION is separate;
5043 -- N_Subprogram_Body_Stub
5044 -- Sloc points to FUNCTION or PROCEDURE
5045 -- Specification (Node1)
5046 -- Library_Unit (Node4-Sem) points to the subunit
5047 -- Corresponding_Body (Node5-Sem)
5049 -------------------------------
5050 -- 10.1.3 Package Body Stub --
5051 -------------------------------
5053 -- PACKAGE_BODY_STUB ::=
5054 -- package body DEFINING_IDENTIFIER is separate;
5056 -- N_Package_Body_Stub
5057 -- Sloc points to PACKAGE
5058 -- Defining_Identifier (Node1)
5059 -- Library_Unit (Node4-Sem) points to the subunit
5060 -- Corresponding_Body (Node5-Sem)
5062 ----------------------------
5063 -- 10.1.3 Task Body Stub --
5064 ----------------------------
5066 -- TASK_BODY_STUB ::=
5067 -- task body DEFINING_IDENTIFIER is separate;
5070 -- Sloc points to TASK
5071 -- Defining_Identifier (Node1)
5072 -- Library_Unit (Node4-Sem) points to the subunit
5073 -- Corresponding_Body (Node5-Sem)
5075 ---------------------------------
5076 -- 10.1.3 Protected Body Stub --
5077 ---------------------------------
5079 -- PROTECTED_BODY_STUB ::=
5080 -- protected body DEFINING_IDENTIFIER is separate;
5082 -- Note: protected body stubs are not allowed in Ada 83 mode
5084 -- N_Protected_Body_Stub
5085 -- Sloc points to PROTECTED
5086 -- Defining_Identifier (Node1)
5087 -- Library_Unit (Node4-Sem) points to the subunit
5088 -- Corresponding_Body (Node5-Sem)
5090 ---------------------
5091 -- 10.1.3 Subunit --
5092 ---------------------
5094 -- SUBUNIT ::= separate (PARENT_UNIT_NAME) PROPER_BODY
5097 -- Sloc points to SEPARATE
5098 -- Name (Node2) is the name of the parent unit
5099 -- Proper_Body (Node1) is the subunit body
5100 -- Corresponding_Stub (Node3-Sem) is the stub declaration for the unit.
5102 ---------------------------------
5103 -- 11.1 Exception Declaration --
5104 ---------------------------------
5106 -- EXCEPTION_DECLARATION ::= DEFINING_IDENTIFIER_LIST : exception;
5108 -- For consistency with object declarations etc, the parser converts
5109 -- the case of multiple identifiers being declared to a series of
5110 -- declarations in which the expression is copied, using the More_Ids
5111 -- and Prev_Ids flags to remember the souce form as described in the
5112 -- section on "Handling of Defining Identifier Lists".
5114 -- N_Exception_Declaration
5115 -- Sloc points to EXCEPTION
5116 -- Defining_Identifier (Node1)
5117 -- Expression (Node3-Sem)
5118 -- More_Ids (Flag5) (set to False if no more identifiers in list)
5119 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
5121 ------------------------------------------
5122 -- 11.2 Handled Sequence Of Statements --
5123 ------------------------------------------
5125 -- HANDLED_SEQUENCE_OF_STATEMENTS ::=
5126 -- SEQUENCE_OF_STATEMENTS
5128 -- EXCEPTION_HANDLER
5129 -- {EXCEPTION_HANDLER}]
5131 -- cleanup_procedure_call (param, param, param, ...);]
5133 -- The AT END phrase is a GNAT extension to provide for cleanups. It is
5134 -- used only internally currently, but is considered to be syntactic.
5135 -- At the moment, the only cleanup action allowed is a single call to
5136 -- a parameterless procedure, and the Identifier field of the node is
5137 -- the procedure to be called. Also there is a current restriction
5138 -- that exception handles and a cleanup cannot be present in the same
5139 -- frame, so at least one of Exception_Handlers or the Identifier must
5142 -- Actually, more accurately, this restriction applies to the original
5143 -- source program. In the expanded tree, if the At_End_Proc field is
5144 -- present, then there will also be an exception handler of the form:
5146 -- when all others =>
5150 -- where cleanup is the procedure to be generated. The reason we do
5151 -- this is so that the front end can handle the necessary entries in
5152 -- the exception tables, and other exception handler actions required
5153 -- as part of the normal handling for exception handlers.
5155 -- The AT END cleanup handler protects only the sequence of statements
5156 -- (not the associated declarations of the parent), just like exception
5157 -- handlers. The big difference is that the cleanup procedure is called
5158 -- on either a normal or an abnormal exit from the statement sequence.
5160 -- Note: the list of Exception_Handlers can contain pragmas as well
5161 -- as actual handlers. In practice these pragmas can only occur at
5162 -- the start of the list, since any pragmas occurring later on will
5163 -- be included in the statement list of the corresponding handler.
5165 -- Note: although in the Ada syntax, the sequence of statements in
5166 -- a handled sequence of statements can only contain statements, we
5167 -- allow free mixing of declarations and statements in the resulting
5168 -- expanded tree. This is for example used to deal with the case of
5169 -- a cleanup procedure that must handle declarations as well as the
5170 -- statements of a block.
5172 -- N_Handled_Sequence_Of_Statements
5173 -- Sloc points to first token of first statement
5174 -- Statements (List3)
5175 -- End_Label (Node4) (set to Empty if expander generated)
5176 -- Exception_Handlers (List5) (set to No_List if none present)
5177 -- At_End_Proc (Node1) (set to Empty if no clean up procedure)
5178 -- First_Real_Statement (Node2-Sem)
5179 -- Zero_Cost_Handling (Flag5-Sem)
5181 -- Note: the parent always contains a Declarations field which contains
5182 -- declarations associated with the handled sequence of statements. This
5183 -- is true even in the case of an accept statement (see description of
5184 -- the N_Accept_Statement node).
5186 -- End_Label refers to the containing construct.
5188 -----------------------------
5189 -- 11.2 Exception Handler --
5190 -----------------------------
5192 -- EXCEPTION_HANDLER ::=
5193 -- when [CHOICE_PARAMETER_SPECIFICATION :]
5194 -- EXCEPTION_CHOICE {| EXCEPTION_CHOICE} =>
5195 -- SEQUENCE_OF_STATEMENTS
5197 -- Note: choice parameter specification is not allowed in Ada 83 mode
5199 -- N_Exception_Handler
5200 -- Sloc points to WHEN
5201 -- Choice_Parameter (Node2) (set to Empty if not present)
5202 -- Exception_Choices (List4)
5203 -- Statements (List3)
5204 -- Zero_Cost_Handling (Flag5-Sem)
5206 ------------------------------------------
5207 -- 11.2 Choice parameter specification --
5208 ------------------------------------------
5210 -- CHOICE_PARAMETER_SPECIFICATION ::= DEFINING_IDENTIFIER
5212 ----------------------------
5213 -- 11.2 Exception Choice --
5214 ----------------------------
5216 -- EXCEPTION_CHOICE ::= exception_NAME | others
5218 -- Except in the case of OTHERS, no explicit node appears in the tree
5219 -- for exception choice. Instead the exception name appears directly.
5220 -- An OTHERS choice is represented by a N_Others_Choice node (see
5223 -- Note: for the exception choice created for an at end handler, the
5224 -- exception choice is an N_Others_Choice node with All_Others set.
5226 ---------------------------
5227 -- 11.3 Raise Statement --
5228 ---------------------------
5230 -- RAISE_STATEMENT ::= raise [exception_NAME];
5232 -- N_Raise_Statement
5233 -- Sloc points to RAISE
5234 -- Name (Node2) (set to Empty if no exception name present)
5236 -------------------------------
5237 -- 12.1 Generic Declaration --
5238 -------------------------------
5240 -- GENERIC_DECLARATION ::=
5241 -- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
5243 ------------------------------------------
5244 -- 12.1 Generic Subprogram Declaration --
5245 ------------------------------------------
5247 -- GENERIC_SUBPROGRAM_DECLARATION ::=
5248 -- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION;
5250 -- Note: Generic_Formal_Declarations can include pragmas
5252 -- N_Generic_Subprogram_Declaration
5253 -- Sloc points to GENERIC
5254 -- Specification (Node1) subprogram specification
5255 -- Corresponding_Body (Node5-Sem)
5256 -- Generic_Formal_Declarations (List2) from generic formal part
5257 -- Parent_Spec (Node4-Sem)
5259 ---------------------------------------
5260 -- 12.1 Generic Package Declaration --
5261 ---------------------------------------
5263 -- GENERIC_PACKAGE_DECLARATION ::=
5264 -- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION;
5266 -- Note: when we do generics right, the Activation_Chain_Entity entry
5267 -- for this node can be removed (since the expander won't see generic
5268 -- units any more)???.
5270 -- Note: Generic_Formal_Declarations can include pragmas
5272 -- N_Generic_Package_Declaration
5273 -- Sloc points to GENERIC
5274 -- Specification (Node1) package specification
5275 -- Corresponding_Body (Node5-Sem)
5276 -- Generic_Formal_Declarations (List2) from generic formal part
5277 -- Parent_Spec (Node4-Sem)
5278 -- Activation_Chain_Entity (Node3-Sem)
5280 -------------------------------
5281 -- 12.1 Generic Formal Part --
5282 -------------------------------
5284 -- GENERIC_FORMAL_PART ::=
5285 -- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
5287 ------------------------------------------------
5288 -- 12.1 Generic Formal Parameter Declaration --
5289 ------------------------------------------------
5291 -- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
5292 -- FORMAL_OBJECT_DECLARATION
5293 -- | FORMAL_TYPE_DECLARATION
5294 -- | FORMAL_SUBPROGRAM_DECLARATION
5295 -- | FORMAL_PACKAGE_DECLARATION
5297 ---------------------------------
5298 -- 12.3 Generic Instantiation --
5299 ---------------------------------
5301 -- GENERIC_INSTANTIATION ::=
5302 -- package DEFINING_PROGRAM_UNIT_NAME is
5303 -- new generic_package_NAME [GENERIC_ACTUAL_PART];
5304 -- | procedure DEFINING_PROGRAM_UNIT_NAME is
5305 -- new generic_procedure_NAME [GENERIC_ACTUAL_PART];
5306 -- | function DEFINING_DESIGNATOR is
5307 -- new generic_function_NAME [GENERIC_ACTUAL_PART];
5309 -- N_Package_Instantiation
5310 -- Sloc points to PACKAGE
5311 -- Defining_Unit_Name (Node1)
5313 -- Generic_Associations (List3) (set to No_List if no
5314 -- generic actual part)
5315 -- Parent_Spec (Node4-Sem)
5316 -- Instance_Spec (Node5-Sem)
5317 -- ABE_Is_Certain (Flag18-Sem)
5319 -- N_Procedure_Instantiation
5320 -- Sloc points to PROCEDURE
5321 -- Defining_Unit_Name (Node1)
5323 -- Parent_Spec (Node4-Sem)
5324 -- Generic_Associations (List3) (set to No_List if no
5325 -- generic actual part)
5326 -- Instance_Spec (Node5-Sem)
5327 -- ABE_Is_Certain (Flag18-Sem)
5329 -- N_Function_Instantiation
5330 -- Sloc points to FUNCTION
5331 -- Defining_Unit_Name (Node1)
5333 -- Generic_Associations (List3) (set to No_List if no
5334 -- generic actual part)
5335 -- Parent_Spec (Node4-Sem)
5336 -- Instance_Spec (Node5-Sem)
5337 -- ABE_Is_Certain (Flag18-Sem)
5339 ------------------------------
5340 -- 12.3 Generic Actual Part --
5341 ------------------------------
5343 -- GENERIC_ACTUAL_PART ::=
5344 -- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
5346 -------------------------------
5347 -- 12.3 Generic Association --
5348 -------------------------------
5350 -- GENERIC_ASSOCIATION ::=
5351 -- [generic_formal_parameter_SELECTOR_NAME =>]
5352 -- EXPLICIT_GENERIC_ACTUAL_PARAMETER
5354 -- Note: unlike the procedure call case, a generic association node
5355 -- is generated for every association, even if no formal is present.
5356 -- In this case the parser will leave the Selector_Name field set
5357 -- to Empty, to be filled in later by the semantic pass.
5359 -- N_Generic_Association
5360 -- Sloc points to first token of generic association
5361 -- Selector_Name (Node2) (set to Empty if no formal
5362 -- parameter selector name)
5363 -- Explicit_Generic_Actual_Parameter (Node1)
5365 ---------------------------------------------
5366 -- 12.3 Explicit Generic Actual Parameter --
5367 ---------------------------------------------
5369 -- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
5370 -- EXPRESSION | variable_NAME | subprogram_NAME
5371 -- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
5373 -------------------------------------
5374 -- 12.4 Formal Object Declaration --
5375 -------------------------------------
5377 -- FORMAL_OBJECT_DECLARATION ::=
5378 -- DEFINING_IDENTIFIER_LIST :
5379 -- MODE SUBTYPE_MARK [:= DEFAULT_EXPRESSION];
5381 -- Although the syntax allows multiple identifiers in the list, the
5382 -- semantics is as though successive declarations were given with
5383 -- identical type definition and expression components. To simplify
5384 -- semantic processing, the parser represents a multiple declaration
5385 -- case as a sequence of single declarations, using the More_Ids and
5386 -- Prev_Ids flags to preserve the original source form as described
5387 -- in the section on "Handling of Defining Identifier Lists".
5389 -- N_Formal_Object_Declaration
5390 -- Sloc points to first identifier
5391 -- Defining_Identifier (Node1)
5392 -- In_Present (Flag15)
5393 -- Out_Present (Flag17)
5394 -- Subtype_Mark (Node4)
5395 -- Expression (Node3) (set to Empty if no default expression)
5396 -- More_Ids (Flag5) (set to False if no more identifiers in list)
5397 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
5399 -----------------------------------
5400 -- 12.5 Formal Type Declaration --
5401 -----------------------------------
5403 -- FORMAL_TYPE_DECLARATION ::=
5404 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
5405 -- is FORMAL_TYPE_DEFINITION;
5407 -- N_Formal_Type_Declaration
5408 -- Sloc points to TYPE
5409 -- Defining_Identifier (Node1)
5410 -- Formal_Type_Definition (Node3)
5411 -- Discriminant_Specifications (List4) (set to No_List if no
5412 -- discriminant part)
5413 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
5415 ----------------------------------
5416 -- 12.5 Formal type definition --
5417 ----------------------------------
5419 -- FORMAL_TYPE_DEFINITION ::=
5420 -- FORMAL_PRIVATE_TYPE_DEFINITION
5421 -- | FORMAL_DERIVED_TYPE_DEFINITION
5422 -- | FORMAL_DISCRETE_TYPE_DEFINITION
5423 -- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
5424 -- | FORMAL_MODULAR_TYPE_DEFINITION
5425 -- | FORMAL_FLOATING_POINT_DEFINITION
5426 -- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
5427 -- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
5428 -- | FORMAL_ARRAY_TYPE_DEFINITION
5429 -- | FORMAL_ACCESS_TYPE_DEFINITION
5431 ---------------------------------------------
5432 -- 12.5.1 Formal Private Type Definition --
5433 ---------------------------------------------
5435 -- FORMAL_PRIVATE_TYPE_DEFINITION ::=
5436 -- [[abstract] tagged] [limited] private
5438 -- Note: TAGGED is not allowed in Ada 83 mode
5440 -- N_Formal_Private_Type_Definition
5441 -- Sloc points to PRIVATE
5442 -- Abstract_Present (Flag4)
5443 -- Tagged_Present (Flag15)
5444 -- Limited_Present (Flag17)
5446 --------------------------------------------
5447 -- 12.5.1 Formal Derived Type Definition --
5448 --------------------------------------------
5450 -- FORMAL_DERIVED_TYPE_DEFINITION ::=
5451 -- [abstract] new SUBTYPE_MARK [with private]
5453 -- Note: this construct is not allowed in Ada 83 mode
5455 -- N_Formal_Derived_Type_Definition
5456 -- Sloc points to NEW
5457 -- Subtype_Mark (Node4)
5458 -- Private_Present (Flag15)
5459 -- Abstract_Present (Flag4)
5461 ---------------------------------------------
5462 -- 12.5.2 Formal Discrete Type Definition --
5463 ---------------------------------------------
5465 -- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
5467 -- N_Formal_Discrete_Type_Definition
5470 ---------------------------------------------------
5471 -- 12.5.2 Formal Signed Integer Type Definition --
5472 ---------------------------------------------------
5474 -- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
5476 -- N_Formal_Signed_Integer_Type_Definition
5477 -- Sloc points to RANGE
5479 --------------------------------------------
5480 -- 12.5.2 Formal Modular Type Definition --
5481 --------------------------------------------
5483 -- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
5485 -- N_Formal_Modular_Type_Definition
5486 -- Sloc points to MOD
5488 ----------------------------------------------
5489 -- 12.5.2 Formal Floating Point Definition --
5490 ----------------------------------------------
5492 -- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
5494 -- N_Formal_Floating_Point_Definition
5495 -- Sloc points to DIGITS
5497 ----------------------------------------------------
5498 -- 12.5.2 Formal Ordinary Fixed Point Definition --
5499 ----------------------------------------------------
5501 -- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
5503 -- N_Formal_Ordinary_Fixed_Point_Definition
5504 -- Sloc points to DELTA
5506 ---------------------------------------------------
5507 -- 12.5.2 Formal Decimal Fixed Point Definition --
5508 ---------------------------------------------------
5510 -- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
5512 -- Note: formal decimal fixed point definition not allowed in Ada 83
5514 -- N_Formal_Decimal_Fixed_Point_Definition
5515 -- Sloc points to DELTA
5517 ------------------------------------------
5518 -- 12.5.3 Formal Array Type Definition --
5519 ------------------------------------------
5521 -- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
5523 -------------------------------------------
5524 -- 12.5.4 Formal Access Type Definition --
5525 -------------------------------------------
5527 -- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
5529 -----------------------------------------
5530 -- 12.6 Formal Subprogram Declaration --
5531 -----------------------------------------
5533 -- FORMAL_SUBPROGRAM_DECLARATION ::=
5534 -- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
5536 -- N_Formal_Subprogram_Declaration
5537 -- Sloc points to WITH
5538 -- Specification (Node1)
5539 -- Default_Name (Node2) (set to Empty if no subprogram default)
5540 -- Box_Present (Flag15)
5542 -- Note: if no subprogram default is present, then Name is set
5543 -- to Empty, and Box_Present is False.
5545 ------------------------------
5546 -- 12.6 Subprogram Default --
5547 ------------------------------
5549 -- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
5551 -- There is no separate node in the tree for a subprogram default.
5552 -- Instead the parent (N_Formal_Subprogram_Declaration) node contains
5553 -- the default name or box indication, as needed.
5555 ------------------------
5556 -- 12.6 Default Name --
5557 ------------------------
5559 -- DEFAULT_NAME ::= NAME
5561 --------------------------------------
5562 -- 12.7 Formal Package Declaration --
5563 --------------------------------------
5565 -- FORMAL_PACKAGE_DECLARATION ::=
5566 -- with package DEFINING_IDENTIFIER
5567 -- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART;
5569 -- Note: formal package declarations not allowed in Ada 83 mode
5571 -- N_Formal_Package_Declaration
5572 -- Sloc points to WITH
5573 -- Defining_Identifier (Node1)
5575 -- Generic_Associations (List3) (set to No_List if (<>) case or
5576 -- empty generic actual part)
5577 -- Box_Present (Flag15)
5578 -- Instance_Spec (Node5-Sem)
5579 -- ABE_Is_Certain (Flag18-Sem)
5581 --------------------------------------
5582 -- 12.7 Formal Package Actual Part --
5583 --------------------------------------
5585 -- FORMAL_PACKAGE_ACTUAL_PART ::=
5586 -- (<>) | [GENERIC_ACTUAL_PART]
5588 -- There is no explicit node in the tree for a formal package
5589 -- actual part. Instead the information appears in the parent node
5590 -- (i.e. the formal package declaration node itself).
5592 ---------------------------------
5593 -- 13.1 Representation clause --
5594 ---------------------------------
5596 -- REPRESENTATION_CLAUSE ::=
5597 -- ATTRIBUTE_DEFINITION_CLAUSE
5598 -- | ENUMERATION_REPRESENTATION_CLAUSE
5599 -- | RECORD_REPRESENTATION_CLAUSE
5602 ----------------------
5603 -- 13.1 Local Name --
5604 ----------------------
5608 -- | DIRECT_NAME'ATTRIBUTE_DESIGNATOR
5609 -- | library_unit_NAME
5611 -- The construct DIRECT_NAME'ATTRIBUTE_DESIGNATOR appears in the tree
5612 -- as an attribute reference, which has essentially the same form.
5614 ---------------------------------------
5615 -- 13.3 Attribute definition clause --
5616 ---------------------------------------
5618 -- ATTRIBUTE_DEFINITION_CLAUSE ::=
5619 -- for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use EXPRESSION;
5620 -- | for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use NAME;
5622 -- In Ada 83, the expression must be a simple expression and the
5623 -- local name must be a direct name.
5625 -- Note: The only attribute definition clause that is processed
5626 -- by Gigi is the alignment clause (for all other cases, the
5627 -- information is extracted by the front end and either results
5628 -- in setting entity information, e.g. Esize for the Size case,
5629 -- or in appropriate expansion actions (e.g. in the storage size
5630 -- case). For the alignment case, Gigi requires that the expression
5631 -- be an integer literal.
5633 -- N_Attribute_Definition_Clause
5634 -- Sloc points to FOR
5635 -- Name (Node2) the local name
5636 -- Chars (Name1) the identifier name from the attribute designator
5637 -- Expression (Node3) the expression or name
5638 -- Next_Rep_Item (Node4-Sem)
5639 -- From_At_Mod (Flag4-Sem)
5641 ---------------------------------------------
5642 -- 13.4 Enumeration representation clause --
5643 ---------------------------------------------
5645 -- ENUMERATION_REPRESENTATION_CLAUSE ::=
5646 -- for first_subtype_LOCAL_NAME use ENUMERATION_AGGREGATE;
5648 -- In Ada 83, the name must be a direct name
5650 -- N_Enumeration_Representation_Clause
5651 -- Sloc points to FOR
5652 -- Identifier (Node1) direct name
5653 -- Array_Aggregate (Node3)
5654 -- Next_Rep_Item (Node4-Sem)
5656 ---------------------------------
5657 -- 13.4 Enumeration aggregate --
5658 ---------------------------------
5660 -- ENUMERATION_AGGREGATE ::= ARRAY_AGGREGATE
5662 ------------------------------------------
5663 -- 13.5.1 Record representation clause --
5664 ------------------------------------------
5666 -- RECORD_REPRESENTATION_CLAUSE ::=
5667 -- for first_subtype_LOCAL_NAME use
5668 -- record [MOD_CLAUSE]
5669 -- {COMPONENT_CLAUSE}
5672 -- Gigi restriction: Mod_Clause is always Empty (if present it is
5673 -- replaced by a corresponding Alignment attribute definition clause).
5675 -- Note: Component_Clauses can include pragmas
5677 -- N_Record_Representation_Clause
5678 -- Sloc points to FOR
5679 -- Identifier (Node1) direct name
5680 -- Mod_Clause (Node2) (set to Empty if no mod clause present)
5681 -- Component_Clauses (List3)
5682 -- Next_Rep_Item (Node4-Sem)
5684 ------------------------------
5685 -- 13.5.1 Component clause --
5686 ------------------------------
5688 -- COMPONENT_CLAUSE ::=
5689 -- component_LOCAL_NAME at POSITION
5690 -- range FIRST_BIT .. LAST_BIT;
5692 -- N_Component_Clause
5693 -- Sloc points to AT
5694 -- Component_Name (Node1) points to Name or Attribute_Reference
5696 -- First_Bit (Node3)
5699 ----------------------
5700 -- 13.5.1 Position --
5701 ----------------------
5703 -- POSITION ::= static_EXPRESSION
5705 -----------------------
5706 -- 13.5.1 First_Bit --
5707 -----------------------
5709 -- FIRST_BIT ::= static_SIMPLE_EXPRESSION
5711 ----------------------
5712 -- 13.5.1 Last_Bit --
5713 ----------------------
5715 -- LAST_BIT ::= static_SIMPLE_EXPRESSION
5717 --------------------------
5718 -- 13.8 Code statement --
5719 --------------------------
5721 -- CODE_STATEMENT ::= QUALIFIED_EXPRESSION;
5723 -- Note: in GNAT, the qualified expression has the form
5725 -- Asm_Insn'(Asm (...));
5729 -- Asm_Insn'(Asm_Volatile (...))
5731 -- See package System.Machine_Code in file s-maccod.ads for details
5732 -- on the allowed parameters to Asm[_Volatile]. There are two ways
5733 -- this node can arise, as a code statement, in which case the
5734 -- expression is the qualified expression, or as a result of the
5735 -- expansion of an intrinsic call to the Asm or Asm_Input procedure.
5738 -- Sloc points to first token of the expression
5739 -- Expression (Node3)
5741 -- Note: package Exp_Code contains an abstract functional interface
5742 -- for use by Gigi in accessing the data from N_Code_Statement nodes.
5744 ------------------------
5745 -- 13.12 Restriction --
5746 ------------------------
5749 -- restriction_IDENTIFIER
5750 -- | restriction_parameter_IDENTIFIER => EXPRESSION
5752 -- There is no explicit node for restrictions. Instead the restriction
5753 -- appears in normal pragma syntax as a pragma argument association,
5754 -- which has the same syntactic form.
5756 --------------------------
5757 -- B.2 Shift Operators --
5758 --------------------------
5760 -- Calls to the intrinsic shift functions are converted to one of
5761 -- the following shift nodes, which have the form of normal binary
5762 -- operator names. Note that for a given shift operation, one node
5763 -- covers all possible types, as for normal operators.
5765 -- Note: it is perfectly permissible for the expander to generate
5766 -- shift operation nodes directly, in which case they will be analyzed
5767 -- and parsed in the usual manner.
5769 -- Sprint syntax: shift-function-name!(expr, count)
5771 -- Note: the Left_Opnd field holds the first argument (the value to
5772 -- be shifted). The Right_Opnd field holds the second argument (the
5773 -- shift count). The Chars field is the name of the intrinsic function.
5776 -- Sloc points to the function name
5777 -- plus fields for binary operator
5778 -- plus fields for expression
5779 -- Shift_Count_OK (Flag4-Sem)
5781 -- N_Op_Rotate_Right
5782 -- Sloc points to the function name
5783 -- plus fields for binary operator
5784 -- plus fields for expression
5785 -- Shift_Count_OK (Flag4-Sem)
5788 -- Sloc points to the function name
5789 -- plus fields for binary operator
5790 -- plus fields for expression
5791 -- Shift_Count_OK (Flag4-Sem)
5793 -- N_Op_Shift_Right_Arithmetic
5794 -- Sloc points to the function name
5795 -- plus fields for binary operator
5796 -- plus fields for expression
5797 -- Shift_Count_OK (Flag4-Sem)
5800 -- Sloc points to the function name
5801 -- plus fields for binary operator
5802 -- plus fields for expression
5803 -- Shift_Count_OK (Flag4-Sem)
5805 --------------------------
5806 -- Obsolescent Features --
5807 --------------------------
5809 -- The syntax descriptions and tree nodes for obsolescent features are
5810 -- grouped together, corresponding to their location in appendix I in
5811 -- the RM. However, parsing and semantic analysis for these constructs
5812 -- is located in an appropriate chapter (see individual notes).
5814 ---------------------------
5815 -- J.3 Delta Constraint --
5816 ---------------------------
5818 -- Note: the parse routine for this construct is located in section
5819 -- 3.5.9 of Par-Ch3, and semantic analysis is in Sem_Ch3, which is
5820 -- where delta constraint logically belongs.
5822 -- DELTA_CONSTRAINT ::= DELTA static_EXPRESSION [RANGE_CONSTRAINT]
5824 -- N_Delta_Constraint
5825 -- Sloc points to DELTA
5826 -- Delta_Expression (Node3)
5827 -- Range_Constraint (Node4) (set to Empty if not present)
5829 --------------------
5831 --------------------
5833 -- AT_CLAUSE ::= for DIRECT_NAME use at EXPRESSION;
5835 -- Note: the parse routine for this construct is located in Par-Ch13,
5836 -- and the semantic analysis is in Sem_Ch13, where at clause logically
5837 -- belongs if it were not obsolescent.
5839 -- Note: in Ada 83 the expression must be a simple expression
5841 -- Gigi restriction: This node never appears, it is rewritten as an
5842 -- address attribute definition clause.
5845 -- Sloc points to FOR
5846 -- Identifier (Node1)
5847 -- Expression (Node3)
5849 ---------------------
5850 -- J.8 Mod clause --
5851 ---------------------
5853 -- MOD_CLAUSE ::= at mod static_EXPRESSION;
5855 -- Note: the parse routine for this construct is located in Par-Ch13,
5856 -- and the semantic analysis is in Sem_Ch13, where mod clause logically
5857 -- belongs if it were not obsolescent.
5859 -- Note: in Ada 83, the expression must be a simple expression
5861 -- Gigi restriction: this node never appears. It is replaced
5862 -- by a corresponding Alignment attribute definition clause.
5864 -- Note: pragmas can appear before and after the MOD_CLAUSE since
5865 -- its name has "clause" in it. This is rather strange, but is quite
5866 -- definitely specified. The pragmas before are collected in the
5867 -- Pragmas_Before field of the mod clause node itself, and pragmas
5868 -- after are simply swallowed up in the list of component clauses.
5871 -- Sloc points to AT
5872 -- Expression (Node3)
5873 -- Pragmas_Before (List4) Pragmas before mod clause (No_List if none)
5875 --------------------
5876 -- Semantic Nodes --
5877 --------------------
5879 -- These semantic nodes are used to hold additional semantic information.
5880 -- They are inserted into the tree as a result of semantic processing.
5881 -- Although there are no legitimate source syntax constructions that
5882 -- correspond directly to these nodes, we need a source syntax for the
5883 -- reconstructed tree printed by Sprint, and the node descriptions here
5884 -- show this syntax.
5886 ----------------------------
5887 -- Conditional Expression --
5888 ----------------------------
5890 -- This node is used to represent an expression corresponding to the
5891 -- C construct (condition ? then-expression : else_expression), where
5892 -- Expressions is a three element list, whose first expression is the
5893 -- condition, and whose second and third expressions are the then and
5894 -- else expressions respectively.
5896 -- Note: the Then_Actions and Else_Actions fields are always set to
5897 -- No_List in the tree passed to Gigi. These fields are used only
5898 -- for temporary processing purposes in the expander.
5900 -- Sprint syntax: (if expr then expr else expr)
5902 -- N_Conditional_Expression
5903 -- Sloc points to related node
5904 -- Expressions (List1)
5905 -- Then_Actions (List2-Sem)
5906 -- Else_Actions (List3-Sem)
5907 -- plus fields for expression
5909 -- Note: in the case where a debug source file is generated, the Sloc
5910 -- for this node points to the IF keyword in the Sprint file output.
5916 -- The N_Expanded_Name node is used to represent a selected component
5917 -- name that has been resolved to an expanded name. The semantic phase
5918 -- replaces N_Selected_Component nodes that represent names by the use
5919 -- of this node, leaving the N_Selected_Component node used only when
5920 -- the prefix is a record or protected type.
5922 -- The fields of the N_Expanded_Name node are layed out identically
5923 -- to those of the N_Selected_Component node, allowing conversion of
5924 -- an expanded name node to a selected component node to be done
5925 -- easily, see Sinfo.CN.Change_Selected_Component_To_Expanded_Name.
5927 -- There is no special sprint syntax for an expanded name.
5930 -- Sloc points to the period
5931 -- Chars (Name1) copy of Chars field of selector name
5933 -- Selector_Name (Node2)
5934 -- Entity (Node4-Sem)
5935 -- Associated_Node (Node4-Sem)
5936 -- Redundant_Use (Flag13-Sem)
5937 -- Has_Private_View (Flag11-Sem) set in generic units.
5938 -- plus fields for expression
5940 --------------------
5941 -- Free Statement --
5942 --------------------
5944 -- The N_Free_Statement node is generated as a result of a call to an
5945 -- instantiation of Unchecked_Deallocation. The instantiation of this
5946 -- generic is handled specially and generates this node directly.
5948 -- Sprint syntax: free expression
5951 -- Sloc is copied from the unchecked deallocation call
5952 -- Expression (Node3) argument to unchecked deallocation call
5953 -- Storage_Pool (Node1-Sem)
5954 -- Procedure_To_Call (Node4-Sem)
5956 -- Note: in the case where a debug source file is generated, the Sloc
5957 -- for this node points to the FREE keyword in the Sprint file output.
5963 -- This node marks the point in a declarative part at which an entity
5964 -- declared therein becomes frozen. The expander places initialization
5965 -- procedures for types at those points. Gigi uses the freezing point
5966 -- to elaborate entities that may depend on previous private types.
5968 -- See the section in Einfo "Delayed Freezing and Elaboration" for
5969 -- a full description of the use of this node.
5971 -- The Entity field points back to the entity for the type (whose
5972 -- Freeze_Node field points back to this freeze node).
5974 -- The Actions field contains a list of declarations and statements
5975 -- generated by the expander which are associated with the freeze
5976 -- node, and are elaborated as though the freeze node were replaced
5977 -- by this sequence of actions.
5979 -- Note: the Sloc field in the freeze node references a construct
5980 -- associated with the freezing point. This is used for posting
5981 -- messages in some error/warning situations, e.g. the case where
5982 -- a primitive operation of a tagged type is declared too late.
5984 -- Sprint syntax: freeze entity-name [
5989 -- Sloc points near freeze point (see above special note)
5990 -- Entity (Node4-Sem)
5991 -- Access_Types_To_Process (Elist2-Sem) (set to No_Elist if none)
5992 -- TSS_Elist (Elist3-Sem) (set to No_Elist if no associated TSS's)
5993 -- Actions (List1) (set to No_List if no freeze actions)
5994 -- First_Subtype_Link (Node5-Sem) (set to Empty if no link)
5996 -- The Actions field holds actions associated with the freeze. These
5997 -- actions are elaborated at the point where the type is frozen.
5999 -- Note: in the case where a debug source file is generated, the Sloc
6000 -- for this node points to the FREEZE keyword in the Sprint file output.
6002 --------------------------------
6003 -- Implicit Label Declaration --
6004 --------------------------------
6006 -- An implicit label declaration is created for every occurrence of a
6007 -- label on a statement or a label on a block or loop. It is chained
6008 -- in the declarations of the innermost enclosing block as specified
6009 -- in RM section 5.1 (3).
6011 -- The Defining_Identifier is the actual identifier for the
6012 -- statement identifier. Note that the occurrence of the label
6013 -- is a reference, NOT the defining occurrence. The defining
6014 -- occurrence occurs at the head of the innermost enclosing
6015 -- block, and is represented by this node.
6017 -- Note: from the grammar, this might better be called an implicit
6018 -- statement identifier declaration, but the term we choose seems
6019 -- friendlier, since at least informally statement identifiers are
6020 -- called labels in both cases (i.e. when used in labels, and when
6021 -- used as the identifiers of blocks and loops).
6023 -- Note: although this is logically a semantic node, since it does
6024 -- not correspond directly to a source syntax construction, these
6025 -- nodes are actually created by the parser in a post pass done just
6026 -- after parsing is complete, before semantic analysis is started (see
6027 -- the Par.Labl subunit in file par-labl.adb).
6029 -- Sprint syntax: labelname : label;
6031 -- N_Implicit_Label_Declaration
6032 -- Sloc points to the << of the label
6033 -- Defining_Identifier (Node1)
6034 -- Label_Construct (Node2-Sem)
6036 -- Note: in the case where a debug source file is generated, the Sloc
6037 -- for this node points to the label name in the generated declaration.
6039 ---------------------
6040 -- Itype_Reference --
6041 ---------------------
6043 -- This node is used to create a reference to an Itype. The only
6044 -- purpose is to make sure that the Itype is defined if this is the
6047 -- A typical use of this node is when an Itype is to be referenced in
6048 -- two branches of an if statement. In this case it is important that
6049 -- the first use of the Itype not be inside the conditional, since
6050 -- then it might not be defined if the wrong branch of the if is
6051 -- taken in the case where the definition generates elaboration code.
6053 -- The Itype field points to the referenced Itype
6055 -- sprint syntax: reference itype-name
6057 -- N_Itype_Reference
6058 -- Sloc points to the node generating the reference
6059 -- Itype (Node1-Sem)
6061 -- Note: in the case where a debug source file is generated, the Sloc
6062 -- for this node points to the REFERENCE keyword in the file output.
6064 ---------------------
6065 -- Raise_xxx_Error --
6066 ---------------------
6068 -- One of these nodes is created during semantic analysis to replace
6069 -- a node for an expression that is determined to definitely raise
6070 -- the corresponding exception.
6072 -- The N_Raise_xxx_Error node may also stand alone in place
6073 -- of a declaration or statement, in which case it simply causes
6074 -- the exception to be raised (i.e. it is equivalent to a raise
6075 -- statement that raises the corresponding exception). This use
6076 -- is distinguished by the fact that the Etype in this case is
6077 -- Standard_Void_Type, In the subexprssion case, the Etype is the
6078 -- same as the type of the subexpression which it replaces.
6080 -- If Condition is empty, then the raise is unconditional. If the
6081 -- Condition field is non-empty, it is a boolean expression which
6082 -- is first evaluated, and the exception is raised only if the
6083 -- value of the expression is True. In the unconditional case, the
6084 -- creation of this node is usually accompanied by a warning message
6085 -- error. The creation of this node will usually be accompanied by a
6086 -- message (unless it appears within the right operand of a short
6087 -- circuit form whose left argument is static and decisively
6088 -- eliminates elaboration of the raise operation.
6090 -- The exception is generated with a message that contains the
6091 -- file name and line number, and then appended text. The Reason
6092 -- code shows the text to be added. The Reason code is an element
6093 -- of the type Types.RT_Exception_Code, and indicates both the
6094 -- message to be added, and the exception to be raised (which must
6095 -- match the node type). The value is stored by storing a Uint which
6096 -- is the Pos value of the enumeration element in this type.
6098 -- Gigi restriction: This expander ensures that the type of the
6099 -- Condition field is always Standard.Boolean, even if the type
6100 -- in the source is some non-standard boolean type.
6102 -- Sprint syntax: [xxx_error "msg"]
6103 -- or: [xxx_error when condition "msg"]
6105 -- N_Raise_Constraint_Error
6106 -- Sloc references related construct
6107 -- Condition (Node1) (set to Empty if no condition)
6109 -- plus fields for expression
6111 -- N_Raise_Program_Error
6112 -- Sloc references related construct
6113 -- Condition (Node1) (set to Empty if no condition)
6115 -- plus fields for expression
6117 -- N_Raise_Storage_Error
6118 -- Sloc references related construct
6119 -- Condition (Node1) (set to Empty if no condition)
6121 -- plus fields for expression
6123 -- Note: Sloc is copied from the expression generating the exception.
6124 -- In the case where a debug source file is generated, the Sloc for
6125 -- this node points to the left bracket in the Sprint file output.
6131 -- For a number of purposes, we need to construct references to objects.
6132 -- These references are subsequently treated as normal access values.
6133 -- An example is the construction of the parameter block passed to a
6134 -- task entry. The N_Reference node is provided for this purpose. It is
6135 -- similar in effect to the use of the Unrestricted_Access attribute,
6136 -- and like Unrestricted_Access can be applied to objects which would
6137 -- not be valid prefixes for the Unchecked_Access attribute (e.g.
6138 -- objects which are not aliased, and slices). In addition it can be
6139 -- applied to composite type values as well as objects, including string
6140 -- values and aggregates.
6142 -- Note: we use the Prefix field for this expression so that the
6143 -- resulting node can be treated using common code with the attribute
6144 -- nodes for the 'Access and related attributes. Logically it would make
6145 -- more sense to call it an Expression field, but then we would have to
6146 -- special case the treatment of the N_Reference node.
6148 -- Sprint syntax: prefix'reference
6151 -- Sloc is copied from the expression
6153 -- plus fields for expression
6155 -- Note: in the case where a debug source file is generated, the Sloc
6156 -- for this node points to the quote in the Sprint file output.
6158 ---------------------
6159 -- Subprogram_Info --
6160 ---------------------
6162 -- This node generates the appropriate Subprogram_Info value for a
6163 -- given procedure. See Ada.Exceptions for further details
6165 -- Sprint syntax: subprog'subprogram_info
6167 -- N_Subprogram_Info
6168 -- Sloc points to the entity for the procedure
6169 -- Identifier (Node1) identifier referencing the procedure
6170 -- Etype (Node5-Sem) type (always set to Ada.Exceptions.Code_Loc
6172 -- Note: in the case where a debug source file is generated, the Sloc
6173 -- for this node points to the quote in the Sprint file output.
6175 --------------------------
6176 -- Unchecked Expression --
6177 --------------------------
6179 -- An unchecked expression is one that must be analyzed and resolved
6180 -- with all checks off, regardless of the current setting of scope
6183 -- Sprint syntax: `(expression).
6185 -- Note: this node is always removed from the tree (and replaced by
6186 -- its constituent expression) on completion of analysis, so it only
6187 -- appears in intermediate trees, and will never be seen by Gigi.
6189 -- N_Unchecked_Expression
6190 -- Sloc is a copy of the Sloc of the expression
6191 -- Expression (Node3)
6192 -- plus fields for expression
6194 -- Note: in the case where a debug source file is generated, the Sloc
6195 -- for this node points to the back quote in the Sprint file output.
6197 -------------------------------
6198 -- Unchecked Type Conversion --
6199 -------------------------------
6201 -- An unchecked type conversion node represents the semantic action
6202 -- corresponding to a call to an instantiation of Unchecked_Conversion.
6203 -- It is generated as a result of actual use of Unchecked_Conversion
6204 -- and also the expander generates unchecked type conversion nodes
6205 -- directly for expansion of complex semantic actions.
6207 -- Note: an unchecked type conversion is a variable as far as the
6208 -- semantics are concerned, which is convenient for the expander.
6209 -- This does not change what Ada source programs are legal, since
6210 -- clearly a function call to an instantiation of Unchecked_Conversion
6211 -- is not a variable in any case.
6213 -- Sprint syntax: subtype-mark!(expression).
6215 -- N_Unchecked_Type_Conversion
6216 -- Sloc points to related node in source
6217 -- Subtype_Mark (Node4)
6218 -- Expression (Node3)
6219 -- Kill_Range_Check (Flag11-Sem)
6220 -- plus fields for expression
6222 -- Note: in the case where a debug source file is generated, the Sloc
6223 -- for this node points to the exclamation in the Sprint file output.
6225 -----------------------------------
6226 -- Validate_Unchecked_Conversion --
6227 -----------------------------------
6229 -- The front end does most of the validation of unchecked conversion,
6230 -- including checking sizes (this is done after the back end is called
6231 -- to take advantage of back-annotation of calculated sizes).
6233 -- The front end also deals with specific cases that are not allowed
6234 -- e.g. involving unconstrained array types.
6236 -- For the case of the standard gigi backend, this means that all
6237 -- checks are done in the front-end.
6239 -- However, in the case of specialized back-ends, notably the JVM
6240 -- backend for JGNAT, additional requirements and restrictions apply
6241 -- to unchecked conversion, and these are most conveniently performed
6242 -- in the specialized back-end.
6244 -- To accommodate this requirement, for such back ends, the following
6245 -- special node is generated recording an unchecked conversion that
6246 -- needs to be validated. The back end should post an appropriate
6247 -- error message if the unchecked conversion is invalid or warrants
6248 -- a special warning message.
6250 -- Source_Type and Target_Type point to the entities for the two
6251 -- types involved in the unchecked conversion instantiation that
6252 -- is to be validated.
6254 -- Sprint syntax: validate Unchecked_Conversion (source, target);
6256 -- N_Validate_Unchecked_Conversion
6257 -- Sloc points to instantiation (location for warning message)
6258 -- Source_Type (Node1-Sem)
6259 -- Target_Type (Node2-Sem)
6261 -- Note: in the case where a debug source file is generated, the Sloc
6262 -- for this node points to the VALIDATE keyword in the file output.
6268 -- Used as the contents of the Nkind field of the dummy Empty node
6269 -- and in some other situations to indicate an uninitialized value.
6272 -- Chars (Name1) is set to No_Name
6278 -- Used as the contents of the Nkind field of the dummy Error node.
6279 -- Has an Etype field, which gets set to Any_Type later on, to help
6280 -- error recovery (Error_Posted is also set in the Error node).
6283 -- Chars (Name1) is set to Error_Name
6284 -- Etype (Node5-Sem)
6286 --------------------------
6287 -- Node Type Definition --
6288 --------------------------
6290 -- The following is the definition of the Node_Kind type. As previously
6291 -- discussed, this is separated off to allow rearrangement of the order
6292 -- to facilitiate definition of subtype ranges. The comments show the
6293 -- subtype classes which apply to each set of node kinds. The first
6294 -- entry in the comment characterizes the following list of nodes.
6299 -- N_Representation_Clause
6302 N_Enumeration_Representation_Clause
,
6304 N_Record_Representation_Clause
,
6306 -- N_Representation_Clause, N_Has_Chars
6307 N_Attribute_Definition_Clause
,
6312 N_Pragma_Argument_Association
,
6317 -- N_Entity, N_Has_Etype, N_Has_Chars
6318 N_Defining_Character_Literal
,
6319 N_Defining_Identifier
,
6320 N_Defining_Operator_Symbol
,
6322 -- N_Subexpr, N_Has_Etype, N_Has_Chars, N_Has_Entity
6325 -- N_Direct_Name, N_Subexpr, N_Has_Etype,
6326 -- N_Has_Chars, N_Has_Entity
6330 -- N_Direct_Name, N_Subexpr, N_Has_Etype,
6331 -- N_Has_Chars, N_Has_Entity
6332 N_Character_Literal
,
6334 -- N_Binary_Op, N_Op, N_Subexpr,
6335 -- N_Has_Etype, N_Has_Chars, N_Has_Entity
6345 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6346 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean
6349 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6350 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean,
6359 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6360 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean
6364 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype,
6365 -- N_Op_Shift, N_Has_Chars, N_Has_Entity
6370 N_Op_Shift_Right_Arithmetic
,
6372 -- N_Unary_Op, N_Op, N_Subexpr, N_Has_Etype,
6373 -- N_Has_Chars, N_Has_Entity
6379 -- N_Subexpr, N_Has_Etype, N_Has_Entity
6380 N_Attribute_Reference
,
6382 -- N_Subexpr, N_Has_Etype
6384 N_Conditional_Expression
,
6385 N_Explicit_Dereference
,
6388 N_Indexed_Component
,
6393 N_Procedure_Call_Statement
,
6394 N_Qualified_Expression
,
6396 -- N_Raise_xxx_Error, N_Subexpr, N_Has_Etype
6398 N_Raise_Constraint_Error
,
6399 N_Raise_Program_Error
,
6400 N_Raise_Storage_Error
,
6402 -- N_Subexpr, N_Has_Etype
6406 N_Extension_Aggregate
,
6410 N_Selected_Component
,
6415 N_Unchecked_Expression
,
6416 N_Unchecked_Type_Conversion
,
6419 N_Subtype_Indication
,
6422 N_Component_Declaration
,
6423 N_Entry_Declaration
,
6424 N_Formal_Object_Declaration
,
6425 N_Formal_Type_Declaration
,
6426 N_Full_Type_Declaration
,
6427 N_Incomplete_Type_Declaration
,
6428 N_Loop_Parameter_Specification
,
6429 N_Object_Declaration
,
6430 N_Protected_Type_Declaration
,
6431 N_Private_Extension_Declaration
,
6432 N_Private_Type_Declaration
,
6433 N_Subtype_Declaration
,
6435 -- N_Subprogram_Specification, N_Declaration
6436 N_Function_Specification
,
6437 N_Procedure_Specification
,
6439 -- (nothing special)
6440 N_Entry_Index_Specification
,
6443 -- N_Access_To_Subprogram_Definition
6444 N_Access_Function_Definition
,
6445 N_Access_Procedure_Definition
,
6447 -- N_Later_Decl_Item,
6448 N_Task_Type_Declaration
,
6450 -- N_Body_Stub, N_Later_Decl_Item
6451 N_Package_Body_Stub
,
6452 N_Protected_Body_Stub
,
6453 N_Subprogram_Body_Stub
,
6456 -- N_Generic_Instantiation, N_Later_Decl_Item
6457 N_Function_Instantiation
,
6458 N_Package_Instantiation
,
6459 N_Procedure_Instantiation
,
6461 -- N_Unit_Body, N_Later_Decl_Item, N_Proper_Body
6465 -- N_Later_Decl_Item, N_Proper_Body
6469 -- N_Later_Decl_Item
6470 N_Implicit_Label_Declaration
,
6471 N_Package_Declaration
,
6472 N_Single_Task_Declaration
,
6473 N_Subprogram_Declaration
,
6474 N_Use_Package_Clause
,
6476 -- N_Generic_Declaration, N_Later_Decl_Item
6477 N_Generic_Package_Declaration
,
6478 N_Generic_Subprogram_Declaration
,
6480 -- N_Array_Type_Definition
6481 N_Constrained_Array_Definition
,
6482 N_Unconstrained_Array_Definition
,
6484 -- N_Renaming_Declaration
6485 N_Exception_Renaming_Declaration
,
6486 N_Object_Renaming_Declaration
,
6487 N_Package_Renaming_Declaration
,
6488 N_Subprogram_Renaming_Declaration
,
6490 -- N_Generic_Renaming_Declarations, N_Renaming_Declaration
6491 N_Generic_Function_Renaming_Declaration
,
6492 N_Generic_Package_Renaming_Declaration
,
6493 N_Generic_Procedure_Renaming_Declaration
,
6495 -- N_Statement_Other_Than_Procedure_Call
6498 N_Assignment_Statement
,
6499 N_Asynchronous_Select
,
6503 N_Conditional_Entry_Call
,
6504 N_Delay_Relative_Statement
,
6505 N_Delay_Until_Statement
,
6506 N_Entry_Call_Statement
,
6512 N_Requeue_Statement
,
6517 -- N_Statement_Other_Than_Procedure_Call, N_Has_Condition
6522 N_Accept_Alternative
,
6523 N_Delay_Alternative
,
6525 N_Entry_Body_Formal_Part
,
6527 N_Terminate_Alternative
,
6529 -- Other nodes (not part of any subtype class)
6531 N_Abstract_Subprogram_Declaration
,
6532 N_Access_Definition
,
6533 N_Access_To_Object_Definition
,
6534 N_Case_Statement_Alternative
,
6536 N_Compilation_Unit_Aux
,
6537 N_Component_Association
,
6539 N_Derived_Type_Definition
,
6540 N_Decimal_Fixed_Point_Definition
,
6541 N_Defining_Program_Unit_Name
,
6544 N_Digits_Constraint
,
6545 N_Discriminant_Association
,
6546 N_Discriminant_Specification
,
6547 N_Enumeration_Type_Definition
,
6549 N_Entry_Call_Alternative
,
6550 N_Exception_Declaration
,
6551 N_Exception_Handler
,
6552 N_Floating_Point_Definition
,
6553 N_Formal_Decimal_Fixed_Point_Definition
,
6554 N_Formal_Derived_Type_Definition
,
6555 N_Formal_Discrete_Type_Definition
,
6556 N_Formal_Floating_Point_Definition
,
6557 N_Formal_Modular_Type_Definition
,
6558 N_Formal_Ordinary_Fixed_Point_Definition
,
6559 N_Formal_Package_Declaration
,
6560 N_Formal_Private_Type_Definition
,
6561 N_Formal_Signed_Integer_Type_Definition
,
6562 N_Formal_Subprogram_Declaration
,
6563 N_Generic_Association
,
6564 N_Handled_Sequence_Of_Statements
,
6565 N_Index_Or_Discriminant_Constraint
,
6568 N_Modular_Type_Definition
,
6569 N_Number_Declaration
,
6570 N_Ordinary_Fixed_Point_Definition
,
6572 N_Package_Specification
,
6573 N_Parameter_Association
,
6574 N_Parameter_Specification
,
6575 N_Protected_Definition
,
6577 N_Real_Range_Specification
,
6578 N_Record_Definition
,
6579 N_Signed_Integer_Type_Definition
,
6580 N_Single_Protected_Declaration
,
6583 N_Triggering_Alternative
,
6585 N_Validate_Unchecked_Conversion
,
6592 for Node_Kind
'Size use 8;
6593 -- The data structures in Atree assume this!
6595 ----------------------------
6596 -- Node Class Definitions --
6597 ----------------------------
6599 subtype N_Access_To_Subprogram_Definition
is Node_Kind
range
6600 N_Access_Function_Definition
..
6601 N_Access_Procedure_Definition
;
6603 subtype N_Array_Type_Definition
is Node_Kind
range
6604 N_Constrained_Array_Definition
..
6605 N_Unconstrained_Array_Definition
;
6607 subtype N_Binary_Op
is Node_Kind
range
6609 N_Op_Shift_Right_Arithmetic
;
6611 subtype N_Body_Stub
is Node_Kind
range
6612 N_Package_Body_Stub
..
6615 subtype N_Declaration
is Node_Kind
range
6616 N_Component_Declaration
..
6617 N_Procedure_Specification
;
6618 -- Note: this includes all constructs normally thought of as declarations
6619 -- except those which are separately grouped as later declarations.
6621 subtype N_Direct_Name
is Node_Kind
range
6623 N_Character_Literal
;
6625 subtype N_Entity
is Node_Kind
range
6626 N_Defining_Character_Literal
..
6627 N_Defining_Operator_Symbol
;
6629 subtype N_Generic_Declaration
is Node_Kind
range
6630 N_Generic_Package_Declaration
..
6631 N_Generic_Subprogram_Declaration
;
6633 subtype N_Generic_Instantiation
is Node_Kind
range
6634 N_Function_Instantiation
..
6635 N_Procedure_Instantiation
;
6637 subtype N_Generic_Renaming_Declaration
is Node_Kind
range
6638 N_Generic_Function_Renaming_Declaration
..
6639 N_Generic_Procedure_Renaming_Declaration
;
6641 subtype N_Has_Chars
is Node_Kind
range
6642 N_Attribute_Definition_Clause
..
6645 subtype N_Has_Entity
is Node_Kind
range
6647 N_Attribute_Reference
;
6648 -- Nodes that have Entity fields
6649 -- Warning: DOES NOT INCLUDE N_Freeze_Entity!
6651 subtype N_Has_Etype
is Node_Kind
range
6653 N_Subtype_Indication
;
6655 subtype N_Later_Decl_Item
is Node_Kind
range
6656 N_Task_Type_Declaration
..
6657 N_Generic_Subprogram_Declaration
;
6658 -- Note: this is Ada 83 relevant only (see Ada 83 RM 3.9 (2)) and
6659 -- includes only those items which can appear as later declarative
6660 -- items. This also includes N_Implicit_Label_Declaration which is
6661 -- not specifically in the grammar but may appear as a valid later
6662 -- declarative items. It does NOT include N_Pragma which can also
6663 -- appear among later declarative items. It does however include
6664 -- N_Protected_Body, which is a bit peculiar, but harmless since
6665 -- this cannot appear in Ada 83 mode anyway.
6667 subtype N_Op
is Node_Kind
range
6671 subtype N_Op_Boolean
is Node_Kind
range
6674 -- Binary operators which take operands of a boolean type, and yield
6675 -- a result of a boolean type.
6677 subtype N_Op_Compare
is Node_Kind
range
6681 subtype N_Op_Shift
is Node_Kind
range
6683 N_Op_Shift_Right_Arithmetic
;
6685 subtype N_Proper_Body
is Node_Kind
range
6689 subtype N_Raise_xxx_Error
is Node_Kind
range
6690 N_Raise_Constraint_Error
..
6691 N_Raise_Storage_Error
;
6693 subtype N_Renaming_Declaration
is Node_Kind
range
6694 N_Exception_Renaming_Declaration
..
6695 N_Generic_Procedure_Renaming_Declaration
;
6697 subtype N_Representation_Clause
is Node_Kind
range
6699 N_Attribute_Definition_Clause
;
6701 subtype N_Statement_Other_Than_Procedure_Call
is Node_Kind
range
6702 N_Abort_Statement
..
6704 -- Note that this includes all statement types except for the cases of the
6705 -- N_Procedure_Call_Statement which is considered to be a subexpression
6706 -- (since overloading is possible, so it needs to go through the normal
6707 -- overloading resolution for expressions).
6709 subtype N_Has_Condition
is Node_Kind
range
6711 N_Terminate_Alternative
;
6712 -- Nodes with condition fields (does not include N_Raise_xxx_Error)
6714 subtype N_Subexpr
is Node_Kind
range
6716 N_Unchecked_Type_Conversion
;
6717 -- Nodes with expression fields
6719 subtype N_Subprogram_Specification
is Node_Kind
range
6720 N_Function_Specification
..
6721 N_Procedure_Specification
;
6723 subtype N_Unary_Op
is Node_Kind
range
6727 subtype N_Unit_Body
is Node_Kind
range
6731 ---------------------------
6732 -- Node Access Functions --
6733 ---------------------------
6735 -- The following functions return the contents of the indicated field of
6736 -- the node referenced by the argument, which is a Node_Id. They provide
6737 -- logical access to fields in the node which could be accessed using the
6738 -- Atree.Unchecked_Access package, but the idea is always to use these
6739 -- higher level routines which preserve strong typing. In debug mode,
6740 -- these routines check that they are being applied to an appropriate
6741 -- node, as well as checking that the node is in range.
6743 function ABE_Is_Certain
6744 (N
: Node_Id
) return Boolean; -- Flag18
6746 function Abort_Present
6747 (N
: Node_Id
) return Boolean; -- Flag15
6749 function Abortable_Part
6750 (N
: Node_Id
) return Node_Id
; -- Node2
6752 function Abstract_Present
6753 (N
: Node_Id
) return Boolean; -- Flag4
6755 function Accept_Handler_Records
6756 (N
: Node_Id
) return List_Id
; -- List5
6758 function Accept_Statement
6759 (N
: Node_Id
) return Node_Id
; -- Node2
6761 function Access_Types_To_Process
6762 (N
: Node_Id
) return Elist_Id
; -- Elist2
6765 (N
: Node_Id
) return List_Id
; -- List1
6767 function Activation_Chain_Entity
6768 (N
: Node_Id
) return Node_Id
; -- Node3
6770 function Acts_As_Spec
6771 (N
: Node_Id
) return Boolean; -- Flag4
6773 function Aggregate_Bounds
6774 (N
: Node_Id
) return Node_Id
; -- Node3
6776 function Aliased_Present
6777 (N
: Node_Id
) return Boolean; -- Flag4
6780 (N
: Node_Id
) return Boolean; -- Flag11
6782 function All_Present
6783 (N
: Node_Id
) return Boolean; -- Flag15
6785 function Alternatives
6786 (N
: Node_Id
) return List_Id
; -- List4
6788 function Ancestor_Part
6789 (N
: Node_Id
) return Node_Id
; -- Node3
6791 function Array_Aggregate
6792 (N
: Node_Id
) return Node_Id
; -- Node3
6794 function Assignment_OK
6795 (N
: Node_Id
) return Boolean; -- Flag15
6797 function Associated_Node
6798 (N
: Node_Id
) return Node_Id
; -- Node4
6800 function At_End_Proc
6801 (N
: Node_Id
) return Node_Id
; -- Node1
6803 function Attribute_Name
6804 (N
: Node_Id
) return Name_Id
; -- Name2
6806 function Aux_Decls_Node
6807 (N
: Node_Id
) return Node_Id
; -- Node5
6809 function Backwards_OK
6810 (N
: Node_Id
) return Boolean; -- Flag6
6812 function Bad_Is_Detected
6813 (N
: Node_Id
) return Boolean; -- Flag15
6816 (N
: Node_Id
) return Boolean; -- Flag5
6818 function Body_Required
6819 (N
: Node_Id
) return Boolean; -- Flag13
6821 function Body_To_Inline
6822 (N
: Node_Id
) return Node_Id
; -- Node3
6824 function Box_Present
6825 (N
: Node_Id
) return Boolean; -- Flag15
6827 function Char_Literal_Value
6828 (N
: Node_Id
) return Char_Code
; -- Char_Code2
6831 (N
: Node_Id
) return Name_Id
; -- Name1
6833 function Choice_Parameter
6834 (N
: Node_Id
) return Node_Id
; -- Node2
6837 (N
: Node_Id
) return List_Id
; -- List1
6839 function Compile_Time_Known_Aggregate
6840 (N
: Node_Id
) return Boolean; -- Flag18
6842 function Component_Associations
6843 (N
: Node_Id
) return List_Id
; -- List2
6845 function Component_Clauses
6846 (N
: Node_Id
) return List_Id
; -- List3
6848 function Component_Items
6849 (N
: Node_Id
) return List_Id
; -- List3
6851 function Component_List
6852 (N
: Node_Id
) return Node_Id
; -- Node1
6854 function Component_Name
6855 (N
: Node_Id
) return Node_Id
; -- Node1
6858 (N
: Node_Id
) return Node_Id
; -- Node1
6860 function Condition_Actions
6861 (N
: Node_Id
) return List_Id
; -- List3
6863 function Constant_Present
6864 (N
: Node_Id
) return Boolean; -- Flag17
6867 (N
: Node_Id
) return Node_Id
; -- Node3
6869 function Constraints
6870 (N
: Node_Id
) return List_Id
; -- List1
6872 function Context_Installed
6873 (N
: Node_Id
) return Boolean; -- Flag13
6875 function Context_Items
6876 (N
: Node_Id
) return List_Id
; -- List1
6878 function Controlling_Argument
6879 (N
: Node_Id
) return Node_Id
; -- Node1
6881 function Conversion_OK
6882 (N
: Node_Id
) return Boolean; -- Flag14
6884 function Corresponding_Body
6885 (N
: Node_Id
) return Node_Id
; -- Node5
6887 function Corresponding_Generic_Association
6888 (N
: Node_Id
) return Node_Id
; -- Node5
6890 function Corresponding_Integer_Value
6891 (N
: Node_Id
) return Uint
; -- Uint4
6893 function Corresponding_Spec
6894 (N
: Node_Id
) return Node_Id
; -- Node5
6896 function Corresponding_Stub
6897 (N
: Node_Id
) return Node_Id
; -- Node3
6899 function Dcheck_Function
6900 (N
: Node_Id
) return Entity_Id
; -- Node5
6902 function Debug_Statement
6903 (N
: Node_Id
) return Node_Id
; -- Node3
6905 function Declarations
6906 (N
: Node_Id
) return List_Id
; -- List2
6908 function Default_Expression
6909 (N
: Node_Id
) return Node_Id
; -- Node5
6911 function Default_Name
6912 (N
: Node_Id
) return Node_Id
; -- Node2
6914 function Defining_Identifier
6915 (N
: Node_Id
) return Entity_Id
; -- Node1
6917 function Defining_Unit_Name
6918 (N
: Node_Id
) return Node_Id
; -- Node1
6920 function Delay_Alternative
6921 (N
: Node_Id
) return Node_Id
; -- Node4
6923 function Delay_Finalize_Attach
6924 (N
: Node_Id
) return Boolean; -- Flag14
6926 function Delay_Statement
6927 (N
: Node_Id
) return Node_Id
; -- Node2
6929 function Delta_Expression
6930 (N
: Node_Id
) return Node_Id
; -- Node3
6932 function Digits_Expression
6933 (N
: Node_Id
) return Node_Id
; -- Node2
6935 function Discr_Check_Funcs_Built
6936 (N
: Node_Id
) return Boolean; -- Flag11
6938 function Discrete_Choices
6939 (N
: Node_Id
) return List_Id
; -- List4
6941 function Discrete_Range
6942 (N
: Node_Id
) return Node_Id
; -- Node4
6944 function Discrete_Subtype_Definition
6945 (N
: Node_Id
) return Node_Id
; -- Node4
6947 function Discrete_Subtype_Definitions
6948 (N
: Node_Id
) return List_Id
; -- List2
6950 function Discriminant_Specifications
6951 (N
: Node_Id
) return List_Id
; -- List4
6953 function Discriminant_Type
6954 (N
: Node_Id
) return Node_Id
; -- Node5
6956 function Do_Access_Check
6957 (N
: Node_Id
) return Boolean; -- Flag11
6959 function Do_Accessibility_Check
6960 (N
: Node_Id
) return Boolean; -- Flag13
6962 function Do_Discriminant_Check
6963 (N
: Node_Id
) return Boolean; -- Flag13
6965 function Do_Division_Check
6966 (N
: Node_Id
) return Boolean; -- Flag13
6968 function Do_Length_Check
6969 (N
: Node_Id
) return Boolean; -- Flag4
6971 function Do_Overflow_Check
6972 (N
: Node_Id
) return Boolean; -- Flag17
6974 function Do_Range_Check
6975 (N
: Node_Id
) return Boolean; -- Flag9
6977 function Do_Storage_Check
6978 (N
: Node_Id
) return Boolean; -- Flag17
6980 function Do_Tag_Check
6981 (N
: Node_Id
) return Boolean; -- Flag13
6983 function Elaborate_All_Present
6984 (N
: Node_Id
) return Boolean; -- Flag15
6986 function Elaborate_Present
6987 (N
: Node_Id
) return Boolean; -- Flag4
6989 function Elaboration_Boolean
6990 (N
: Node_Id
) return Node_Id
; -- Node2
6992 function Else_Actions
6993 (N
: Node_Id
) return List_Id
; -- List3
6995 function Else_Statements
6996 (N
: Node_Id
) return List_Id
; -- List4
6998 function Elsif_Parts
6999 (N
: Node_Id
) return List_Id
; -- List3
7001 function Enclosing_Variant
7002 (N
: Node_Id
) return Node_Id
; -- Node2
7005 (N
: Node_Id
) return Node_Id
; -- Node4
7008 (N
: Node_Id
) return Uint
; -- Uint5
7011 (N
: Node_Id
) return Node_Id
; -- Node4
7013 function Entry_Body_Formal_Part
7014 (N
: Node_Id
) return Node_Id
; -- Node5
7016 function Entry_Call_Alternative
7017 (N
: Node_Id
) return Node_Id
; -- Node1
7019 function Entry_Call_Statement
7020 (N
: Node_Id
) return Node_Id
; -- Node1
7022 function Entry_Direct_Name
7023 (N
: Node_Id
) return Node_Id
; -- Node1
7025 function Entry_Index
7026 (N
: Node_Id
) return Node_Id
; -- Node5
7028 function Entry_Index_Specification
7029 (N
: Node_Id
) return Node_Id
; -- Node4
7032 (N
: Node_Id
) return Node_Id
; -- Node5
7034 function Exception_Choices
7035 (N
: Node_Id
) return List_Id
; -- List4
7037 function Exception_Handlers
7038 (N
: Node_Id
) return List_Id
; -- List5
7040 function Exception_Junk
7041 (N
: Node_Id
) return Boolean; -- Flag11
7043 function Explicit_Actual_Parameter
7044 (N
: Node_Id
) return Node_Id
; -- Node3
7046 function Expansion_Delayed
7047 (N
: Node_Id
) return Boolean; -- Flag11
7049 function Explicit_Generic_Actual_Parameter
7050 (N
: Node_Id
) return Node_Id
; -- Node1
7053 (N
: Node_Id
) return Node_Id
; -- Node3
7055 function Expressions
7056 (N
: Node_Id
) return List_Id
; -- List1
7059 (N
: Node_Id
) return Node_Id
; -- Node3
7061 function First_Inlined_Subprogram
7062 (N
: Node_Id
) return Entity_Id
; -- Node3
7065 (N
: Node_Id
) return Boolean; -- Flag5
7067 function First_Named_Actual
7068 (N
: Node_Id
) return Node_Id
; -- Node4
7070 function First_Real_Statement
7071 (N
: Node_Id
) return Node_Id
; -- Node2
7073 function First_Subtype_Link
7074 (N
: Node_Id
) return Entity_Id
; -- Node5
7076 function Float_Truncate
7077 (N
: Node_Id
) return Boolean; -- Flag11
7079 function Formal_Type_Definition
7080 (N
: Node_Id
) return Node_Id
; -- Node3
7082 function Forwards_OK
7083 (N
: Node_Id
) return Boolean; -- Flag5
7085 function From_At_Mod
7086 (N
: Node_Id
) return Boolean; -- Flag4
7088 function Generic_Associations
7089 (N
: Node_Id
) return List_Id
; -- List3
7091 function Generic_Formal_Declarations
7092 (N
: Node_Id
) return List_Id
; -- List2
7094 function Generic_Parent
7095 (N
: Node_Id
) return Node_Id
; -- Node5
7097 function Generic_Parent_Type
7098 (N
: Node_Id
) return Node_Id
; -- Node4
7100 function Handled_Statement_Sequence
7101 (N
: Node_Id
) return Node_Id
; -- Node4
7103 function Handler_List_Entry
7104 (N
: Node_Id
) return Node_Id
; -- Node2
7106 function Has_Created_Identifier
7107 (N
: Node_Id
) return Boolean; -- Flag15
7109 function Has_Dynamic_Length_Check
7110 (N
: Node_Id
) return Boolean; -- Flag10
7112 function Has_Dynamic_Range_Check
7113 (N
: Node_Id
) return Boolean; -- Flag12
7115 function Has_No_Elaboration_Code
7116 (N
: Node_Id
) return Boolean; -- Flag17
7118 function Has_Priority_Pragma
7119 (N
: Node_Id
) return Boolean; -- Flag6
7121 function Has_Private_View
7122 (N
: Node_Id
) return Boolean; -- Flag11
7124 function Has_Storage_Size_Pragma
7125 (N
: Node_Id
) return Boolean; -- Flag5
7127 function Has_Task_Info_Pragma
7128 (N
: Node_Id
) return Boolean; -- Flag7
7130 function Has_Task_Name_Pragma
7131 (N
: Node_Id
) return Boolean; -- Flag8
7133 function Has_Wide_Character
7134 (N
: Node_Id
) return Boolean; -- Flag11
7136 function Hidden_By_Use_Clause
7137 (N
: Node_Id
) return Elist_Id
; -- Elist4
7140 (N
: Node_Id
) return Node_Id
; -- Node2
7143 (N
: Node_Id
) return Node_Id
; -- Node1
7145 function Implicit_With
7146 (N
: Node_Id
) return Boolean; -- Flag17
7149 (N
: Node_Id
) return Boolean; -- Flag15
7151 function Includes_Infinities
7152 (N
: Node_Id
) return Boolean; -- Flag11
7154 function Instance_Spec
7155 (N
: Node_Id
) return Node_Id
; -- Node5
7158 (N
: Node_Id
) return Uint
; -- Uint3
7160 function Is_Asynchronous_Call_Block
7161 (N
: Node_Id
) return Boolean; -- Flag7
7163 function Is_Component_Left_Opnd
7164 (N
: Node_Id
) return Boolean; -- Flag13
7166 function Is_Component_Right_Opnd
7167 (N
: Node_Id
) return Boolean; -- Flag14
7169 function Is_Controlling_Actual
7170 (N
: Node_Id
) return Boolean; -- Flag16
7172 function Is_Machine_Number
7173 (N
: Node_Id
) return Boolean; -- Flag11
7175 function Is_Overloaded
7176 (N
: Node_Id
) return Boolean; -- Flag5
7178 function Is_Power_Of_2_For_Shift
7179 (N
: Node_Id
) return Boolean; -- Flag13
7181 function Is_Protected_Subprogram_Body
7182 (N
: Node_Id
) return Boolean; -- Flag7
7184 function Is_Static_Expression
7185 (N
: Node_Id
) return Boolean; -- Flag6
7187 function Is_Subprogram_Descriptor
7188 (N
: Node_Id
) return Boolean; -- Flag16
7190 function Is_Task_Allocation_Block
7191 (N
: Node_Id
) return Boolean; -- Flag6
7193 function Is_Task_Master
7194 (N
: Node_Id
) return Boolean; -- Flag5
7196 function Iteration_Scheme
7197 (N
: Node_Id
) return Node_Id
; -- Node2
7200 (N
: Node_Id
) return Entity_Id
; -- Node1
7202 function Kill_Range_Check
7203 (N
: Node_Id
) return Boolean; -- Flag11
7205 function Label_Construct
7206 (N
: Node_Id
) return Node_Id
; -- Node2
7209 (N
: Node_Id
) return Node_Id
; -- Node2
7212 (N
: Node_Id
) return Node_Id
; -- Node4
7215 (N
: Node_Id
) return Boolean; -- Flag6
7217 function Library_Unit
7218 (N
: Node_Id
) return Node_Id
; -- Node4
7220 function Limited_Present
7221 (N
: Node_Id
) return Boolean; -- Flag17
7224 (N
: Node_Id
) return List_Id
; -- List1
7226 function Loop_Actions
7227 (N
: Node_Id
) return List_Id
; -- List2
7229 function Loop_Parameter_Specification
7230 (N
: Node_Id
) return Node_Id
; -- Node4
7233 (N
: Node_Id
) return Node_Id
; -- Node1
7236 (N
: Node_Id
) return Node_Id
; -- Node2
7239 (N
: Node_Id
) return Boolean; -- Flag5
7241 function Must_Be_Byte_Aligned
7242 (N
: Node_Id
) return Boolean; -- Flag14
7244 function Must_Not_Freeze
7245 (N
: Node_Id
) return Boolean; -- Flag8
7248 (N
: Node_Id
) return Node_Id
; -- Node2
7251 (N
: Node_Id
) return List_Id
; -- List2
7253 function Next_Entity
7254 (N
: Node_Id
) return Node_Id
; -- Node2
7256 function Next_Named_Actual
7257 (N
: Node_Id
) return Node_Id
; -- Node4
7259 function Next_Rep_Item
7260 (N
: Node_Id
) return Node_Id
; -- Node4
7262 function Next_Use_Clause
7263 (N
: Node_Id
) return Node_Id
; -- Node3
7265 function No_Ctrl_Actions
7266 (N
: Node_Id
) return Boolean; -- Flag7
7268 function No_Entities_Ref_In_Spec
7269 (N
: Node_Id
) return Boolean; -- Flag8
7271 function No_Initialization
7272 (N
: Node_Id
) return Boolean; -- Flag13
7274 function Null_Present
7275 (N
: Node_Id
) return Boolean; -- Flag13
7277 function Null_Record_Present
7278 (N
: Node_Id
) return Boolean; -- Flag17
7280 function Object_Definition
7281 (N
: Node_Id
) return Node_Id
; -- Node4
7283 function OK_For_Stream
7284 (N
: Node_Id
) return Boolean; -- Flag4
7286 function Original_Discriminant
7287 (N
: Node_Id
) return Node_Id
; -- Node2
7289 function Others_Discrete_Choices
7290 (N
: Node_Id
) return List_Id
; -- List1
7292 function Out_Present
7293 (N
: Node_Id
) return Boolean; -- Flag17
7295 function Parameter_Associations
7296 (N
: Node_Id
) return List_Id
; -- List3
7298 function Parameter_List_Truncated
7299 (N
: Node_Id
) return Boolean; -- Flag17
7301 function Parameter_Specifications
7302 (N
: Node_Id
) return List_Id
; -- List3
7304 function Parameter_Type
7305 (N
: Node_Id
) return Node_Id
; -- Node2
7307 function Parent_Spec
7308 (N
: Node_Id
) return Node_Id
; -- Node4
7311 (N
: Node_Id
) return Node_Id
; -- Node2
7313 function Pragma_Argument_Associations
7314 (N
: Node_Id
) return List_Id
; -- List2
7316 function Pragmas_After
7317 (N
: Node_Id
) return List_Id
; -- List5
7319 function Pragmas_Before
7320 (N
: Node_Id
) return List_Id
; -- List4
7323 (N
: Node_Id
) return Node_Id
; -- Node3
7325 function Present_Expr
7326 (N
: Node_Id
) return Uint
; -- Uint3
7329 (N
: Node_Id
) return Boolean; -- Flag6
7331 function Print_In_Hex
7332 (N
: Node_Id
) return Boolean; -- Flag13
7334 function Private_Declarations
7335 (N
: Node_Id
) return List_Id
; -- List3
7337 function Private_Present
7338 (N
: Node_Id
) return Boolean; -- Flag15
7340 function Procedure_To_Call
7341 (N
: Node_Id
) return Node_Id
; -- Node4
7343 function Proper_Body
7344 (N
: Node_Id
) return Node_Id
; -- Node1
7346 function Protected_Definition
7347 (N
: Node_Id
) return Node_Id
; -- Node3
7349 function Protected_Present
7350 (N
: Node_Id
) return Boolean; -- Flag15
7352 function Raises_Constraint_Error
7353 (N
: Node_Id
) return Boolean; -- Flag7
7355 function Range_Constraint
7356 (N
: Node_Id
) return Node_Id
; -- Node4
7358 function Range_Expression
7359 (N
: Node_Id
) return Node_Id
; -- Node4
7361 function Real_Range_Specification
7362 (N
: Node_Id
) return Node_Id
; -- Node4
7365 (N
: Node_Id
) return Ureal
; -- Ureal3
7368 (N
: Node_Id
) return Uint
; -- Uint3
7370 function Record_Extension_Part
7371 (N
: Node_Id
) return Node_Id
; -- Node3
7373 function Redundant_Use
7374 (N
: Node_Id
) return Boolean; -- Flag13
7376 function Return_Type
7377 (N
: Node_Id
) return Node_Id
; -- Node2
7379 function Reverse_Present
7380 (N
: Node_Id
) return Boolean; -- Flag15
7383 (N
: Node_Id
) return Node_Id
; -- Node3
7385 function Rounded_Result
7386 (N
: Node_Id
) return Boolean; -- Flag18
7389 (N
: Node_Id
) return Node_Id
; -- Node3
7391 function Select_Alternatives
7392 (N
: Node_Id
) return List_Id
; -- List1
7394 function Selector_Name
7395 (N
: Node_Id
) return Node_Id
; -- Node2
7397 function Selector_Names
7398 (N
: Node_Id
) return List_Id
; -- List1
7400 function Shift_Count_OK
7401 (N
: Node_Id
) return Boolean; -- Flag4
7403 function Source_Type
7404 (N
: Node_Id
) return Entity_Id
; -- Node1
7406 function Specification
7407 (N
: Node_Id
) return Node_Id
; -- Node1
7410 (N
: Node_Id
) return List_Id
; -- List3
7412 function Static_Processing_OK
7413 (N
: Node_Id
) return Boolean; -- Flag4
7415 function Storage_Pool
7416 (N
: Node_Id
) return Node_Id
; -- Node1
7419 (N
: Node_Id
) return String_Id
; -- Str3
7421 function Subtype_Indication
7422 (N
: Node_Id
) return Node_Id
; -- Node5
7424 function Subtype_Mark
7425 (N
: Node_Id
) return Node_Id
; -- Node4
7427 function Subtype_Marks
7428 (N
: Node_Id
) return List_Id
; -- List2
7430 function Tagged_Present
7431 (N
: Node_Id
) return Boolean; -- Flag15
7433 function Target_Type
7434 (N
: Node_Id
) return Entity_Id
; -- Node2
7436 function Task_Body_Procedure
7437 (N
: Node_Id
) return Entity_Id
; -- Node2
7439 function Task_Definition
7440 (N
: Node_Id
) return Node_Id
; -- Node3
7442 function Then_Actions
7443 (N
: Node_Id
) return List_Id
; -- List2
7445 function Then_Statements
7446 (N
: Node_Id
) return List_Id
; -- List2
7448 function Treat_Fixed_As_Integer
7449 (N
: Node_Id
) return Boolean; -- Flag14
7451 function Triggering_Alternative
7452 (N
: Node_Id
) return Node_Id
; -- Node1
7454 function Triggering_Statement
7455 (N
: Node_Id
) return Node_Id
; -- Node1
7458 (N
: Node_Id
) return Elist_Id
; -- Elist3
7460 function Type_Definition
7461 (N
: Node_Id
) return Node_Id
; -- Node3
7464 (N
: Node_Id
) return Node_Id
; -- Node2
7466 function Unknown_Discriminants_Present
7467 (N
: Node_Id
) return Boolean; -- Flag13
7469 function Unreferenced_In_Spec
7470 (N
: Node_Id
) return Boolean; -- Flag7
7472 function Variant_Part
7473 (N
: Node_Id
) return Node_Id
; -- Node4
7476 (N
: Node_Id
) return List_Id
; -- List1
7478 function Visible_Declarations
7479 (N
: Node_Id
) return List_Id
; -- List2
7481 function Was_Originally_Stub
7482 (N
: Node_Id
) return Boolean; -- Flag13
7484 function Zero_Cost_Handling
7485 (N
: Node_Id
) return Boolean; -- Flag5
7487 -- End functions (note used by xsinfo utility program to end processing)
7489 ----------------------------
7490 -- Node Update Procedures --
7491 ----------------------------
7493 -- These are the corresponding node update routines, which again provide
7494 -- a high level logical access with type checking. In addition to setting
7495 -- the indicated field of the node N to the given Val, in the case of
7496 -- tree pointers (List1-4), the parent pointer of the Val node is set to
7497 -- point back to node N. This automates the setting of the parent pointer.
7499 procedure Set_ABE_Is_Certain
7500 (N
: Node_Id
; Val
: Boolean := True); -- Flag18
7502 procedure Set_Abort_Present
7503 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7505 procedure Set_Abortable_Part
7506 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7508 procedure Set_Abstract_Present
7509 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7511 procedure Set_Accept_Handler_Records
7512 (N
: Node_Id
; Val
: List_Id
); -- List5
7514 procedure Set_Accept_Statement
7515 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7517 procedure Set_Access_Types_To_Process
7518 (N
: Node_Id
; Val
: Elist_Id
); -- Elist2
7520 procedure Set_Actions
7521 (N
: Node_Id
; Val
: List_Id
); -- List1
7523 procedure Set_Activation_Chain_Entity
7524 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7526 procedure Set_Acts_As_Spec
7527 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7529 procedure Set_Aggregate_Bounds
7530 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7532 procedure Set_Aliased_Present
7533 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7535 procedure Set_All_Others
7536 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7538 procedure Set_All_Present
7539 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7541 procedure Set_Alternatives
7542 (N
: Node_Id
; Val
: List_Id
); -- List4
7544 procedure Set_Ancestor_Part
7545 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7547 procedure Set_Array_Aggregate
7548 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7550 procedure Set_Assignment_OK
7551 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7553 procedure Set_Associated_Node
7554 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7556 procedure Set_Attribute_Name
7557 (N
: Node_Id
; Val
: Name_Id
); -- Name2
7559 procedure Set_At_End_Proc
7560 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7562 procedure Set_Aux_Decls_Node
7563 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7565 procedure Set_Backwards_OK
7566 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
7568 procedure Set_Bad_Is_Detected
7569 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7571 procedure Set_Body_Required
7572 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7574 procedure Set_Body_To_Inline
7575 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7577 procedure Set_Box_Present
7578 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7580 procedure Set_By_Ref
7581 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7583 procedure Set_Char_Literal_Value
7584 (N
: Node_Id
; Val
: Char_Code
); -- Char_Code2
7587 (N
: Node_Id
; Val
: Name_Id
); -- Name1
7589 procedure Set_Choice_Parameter
7590 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7592 procedure Set_Choices
7593 (N
: Node_Id
; Val
: List_Id
); -- List1
7595 procedure Set_Compile_Time_Known_Aggregate
7596 (N
: Node_Id
; Val
: Boolean := True); -- Flag18
7598 procedure Set_Component_Associations
7599 (N
: Node_Id
; Val
: List_Id
); -- List2
7601 procedure Set_Component_Clauses
7602 (N
: Node_Id
; Val
: List_Id
); -- List3
7604 procedure Set_Component_Items
7605 (N
: Node_Id
; Val
: List_Id
); -- List3
7607 procedure Set_Component_List
7608 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7610 procedure Set_Component_Name
7611 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7613 procedure Set_Condition
7614 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7616 procedure Set_Condition_Actions
7617 (N
: Node_Id
; Val
: List_Id
); -- List3
7619 procedure Set_Constant_Present
7620 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7622 procedure Set_Constraint
7623 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7625 procedure Set_Constraints
7626 (N
: Node_Id
; Val
: List_Id
); -- List1
7628 procedure Set_Context_Installed
7629 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7631 procedure Set_Context_Items
7632 (N
: Node_Id
; Val
: List_Id
); -- List1
7634 procedure Set_Controlling_Argument
7635 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7637 procedure Set_Conversion_OK
7638 (N
: Node_Id
; Val
: Boolean := True); -- Flag14
7640 procedure Set_Corresponding_Body
7641 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7643 procedure Set_Corresponding_Generic_Association
7644 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7646 procedure Set_Corresponding_Integer_Value
7647 (N
: Node_Id
; Val
: Uint
); -- Uint4
7649 procedure Set_Corresponding_Spec
7650 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7652 procedure Set_Corresponding_Stub
7653 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7655 procedure Set_Dcheck_Function
7656 (N
: Node_Id
; Val
: Entity_Id
); -- Node5
7658 procedure Set_Debug_Statement
7659 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7661 procedure Set_Declarations
7662 (N
: Node_Id
; Val
: List_Id
); -- List2
7664 procedure Set_Default_Expression
7665 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7667 procedure Set_Default_Name
7668 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7670 procedure Set_Defining_Identifier
7671 (N
: Node_Id
; Val
: Entity_Id
); -- Node1
7673 procedure Set_Defining_Unit_Name
7674 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7676 procedure Set_Delay_Alternative
7677 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7679 procedure Set_Delay_Finalize_Attach
7680 (N
: Node_Id
; Val
: Boolean := True); -- Flag14
7682 procedure Set_Delay_Statement
7683 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7685 procedure Set_Delta_Expression
7686 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7688 procedure Set_Digits_Expression
7689 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7691 procedure Set_Discr_Check_Funcs_Built
7692 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7694 procedure Set_Discrete_Choices
7695 (N
: Node_Id
; Val
: List_Id
); -- List4
7697 procedure Set_Discrete_Range
7698 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7700 procedure Set_Discrete_Subtype_Definition
7701 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7703 procedure Set_Discrete_Subtype_Definitions
7704 (N
: Node_Id
; Val
: List_Id
); -- List2
7706 procedure Set_Discriminant_Specifications
7707 (N
: Node_Id
; Val
: List_Id
); -- List4
7709 procedure Set_Discriminant_Type
7710 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7712 procedure Set_Do_Access_Check
7713 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7715 procedure Set_Do_Accessibility_Check
7716 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7718 procedure Set_Do_Discriminant_Check
7719 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7721 procedure Set_Do_Division_Check
7722 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7724 procedure Set_Do_Length_Check
7725 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7727 procedure Set_Do_Overflow_Check
7728 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7730 procedure Set_Do_Range_Check
7731 (N
: Node_Id
; Val
: Boolean := True); -- Flag9
7733 procedure Set_Do_Storage_Check
7734 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7736 procedure Set_Do_Tag_Check
7737 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7739 procedure Set_Elaborate_All_Present
7740 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7742 procedure Set_Elaborate_Present
7743 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7745 procedure Set_Elaboration_Boolean
7746 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7748 procedure Set_Else_Actions
7749 (N
: Node_Id
; Val
: List_Id
); -- List3
7751 procedure Set_Else_Statements
7752 (N
: Node_Id
; Val
: List_Id
); -- List4
7754 procedure Set_Elsif_Parts
7755 (N
: Node_Id
; Val
: List_Id
); -- List3
7757 procedure Set_Enclosing_Variant
7758 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7760 procedure Set_End_Label
7761 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7763 procedure Set_End_Span
7764 (N
: Node_Id
; Val
: Uint
); -- Uint5
7766 procedure Set_Entity
7767 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7769 procedure Set_Entry_Body_Formal_Part
7770 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7772 procedure Set_Entry_Call_Alternative
7773 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7775 procedure Set_Entry_Call_Statement
7776 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7778 procedure Set_Entry_Direct_Name
7779 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7781 procedure Set_Entry_Index
7782 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7784 procedure Set_Entry_Index_Specification
7785 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7788 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7790 procedure Set_Exception_Choices
7791 (N
: Node_Id
; Val
: List_Id
); -- List4
7793 procedure Set_Exception_Handlers
7794 (N
: Node_Id
; Val
: List_Id
); -- List5
7796 procedure Set_Exception_Junk
7797 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7799 procedure Set_Expansion_Delayed
7800 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7802 procedure Set_Explicit_Actual_Parameter
7803 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7805 procedure Set_Explicit_Generic_Actual_Parameter
7806 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7808 procedure Set_Expression
7809 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7811 procedure Set_Expressions
7812 (N
: Node_Id
; Val
: List_Id
); -- List1
7814 procedure Set_First_Bit
7815 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7817 procedure Set_First_Inlined_Subprogram
7818 (N
: Node_Id
; Val
: Entity_Id
); -- Node3
7820 procedure Set_First_Name
7821 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7823 procedure Set_First_Named_Actual
7824 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7826 procedure Set_First_Real_Statement
7827 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7829 procedure Set_First_Subtype_Link
7830 (N
: Node_Id
; Val
: Entity_Id
); -- Node5
7832 procedure Set_Float_Truncate
7833 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7835 procedure Set_Formal_Type_Definition
7836 (N
: Node_Id
; Val
: Node_Id
); -- Node3
7838 procedure Set_Forwards_OK
7839 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7841 procedure Set_From_At_Mod
7842 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
7844 procedure Set_Generic_Associations
7845 (N
: Node_Id
; Val
: List_Id
); -- List3
7847 procedure Set_Generic_Formal_Declarations
7848 (N
: Node_Id
; Val
: List_Id
); -- List2
7850 procedure Set_Generic_Parent
7851 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7853 procedure Set_Generic_Parent_Type
7854 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7856 procedure Set_Handled_Statement_Sequence
7857 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7859 procedure Set_Handler_List_Entry
7860 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7862 procedure Set_Has_Created_Identifier
7863 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7865 procedure Set_Has_Dynamic_Length_Check
7866 (N
: Node_Id
; Val
: Boolean := True); -- Flag10
7868 procedure Set_Has_Dynamic_Range_Check
7869 (N
: Node_Id
; Val
: Boolean := True); -- Flag12
7871 procedure Set_Has_No_Elaboration_Code
7872 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7874 procedure Set_Has_Priority_Pragma
7875 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
7877 procedure Set_Has_Private_View
7878 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7880 procedure Set_Has_Storage_Size_Pragma
7881 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7883 procedure Set_Has_Task_Info_Pragma
7884 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
7886 procedure Set_Has_Task_Name_Pragma
7887 (N
: Node_Id
; Val
: Boolean := True); -- Flag8
7889 procedure Set_Has_Wide_Character
7890 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7892 procedure Set_Hidden_By_Use_Clause
7893 (N
: Node_Id
; Val
: Elist_Id
); -- Elist4
7895 procedure Set_High_Bound
7896 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7898 procedure Set_Identifier
7899 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7901 procedure Set_Implicit_With
7902 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7904 procedure Set_In_Present
7905 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
7907 procedure Set_Includes_Infinities
7908 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7910 procedure Set_Instance_Spec
7911 (N
: Node_Id
; Val
: Node_Id
); -- Node5
7913 procedure Set_Intval
7914 (N
: Node_Id
; Val
: Uint
); -- Uint3
7916 procedure Set_Is_Asynchronous_Call_Block
7917 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
7919 procedure Set_Is_Component_Left_Opnd
7920 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7922 procedure Set_Is_Component_Right_Opnd
7923 (N
: Node_Id
; Val
: Boolean := True); -- Flag14
7925 procedure Set_Is_Controlling_Actual
7926 (N
: Node_Id
; Val
: Boolean := True); -- Flag16
7928 procedure Set_Is_Machine_Number
7929 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7931 procedure Set_Is_Overloaded
7932 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7934 procedure Set_Is_Power_Of_2_For_Shift
7935 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
7937 procedure Set_Is_Protected_Subprogram_Body
7938 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
7940 procedure Set_Is_Static_Expression
7941 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
7943 procedure Set_Is_Subprogram_Descriptor
7944 (N
: Node_Id
; Val
: Boolean := True); -- Flag16
7946 procedure Set_Is_Task_Allocation_Block
7947 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
7949 procedure Set_Is_Task_Master
7950 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7952 procedure Set_Iteration_Scheme
7953 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7956 (N
: Node_Id
; Val
: Entity_Id
); -- Node1
7958 procedure Set_Kill_Range_Check
7959 (N
: Node_Id
; Val
: Boolean := True); -- Flag11
7961 procedure Set_Last_Bit
7962 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7964 procedure Set_Last_Name
7965 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
7967 procedure Set_Library_Unit
7968 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7970 procedure Set_Label_Construct
7971 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7973 procedure Set_Left_Opnd
7974 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7976 procedure Set_Limited_Present
7977 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
7979 procedure Set_Literals
7980 (N
: Node_Id
; Val
: List_Id
); -- List1
7982 procedure Set_Loop_Actions
7983 (N
: Node_Id
; Val
: List_Id
); -- List2
7985 procedure Set_Loop_Parameter_Specification
7986 (N
: Node_Id
; Val
: Node_Id
); -- Node4
7988 procedure Set_Low_Bound
7989 (N
: Node_Id
; Val
: Node_Id
); -- Node1
7991 procedure Set_Mod_Clause
7992 (N
: Node_Id
; Val
: Node_Id
); -- Node2
7994 procedure Set_More_Ids
7995 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
7997 procedure Set_Must_Be_Byte_Aligned
7998 (N
: Node_Id
; Val
: Boolean := True); -- Flag14
8000 procedure Set_Must_Not_Freeze
8001 (N
: Node_Id
; Val
: Boolean := True); -- Flag8
8004 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8007 (N
: Node_Id
; Val
: List_Id
); -- List2
8009 procedure Set_Next_Entity
8010 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8012 procedure Set_Next_Named_Actual
8013 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8015 procedure Set_Next_Rep_Item
8016 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8018 procedure Set_Next_Use_Clause
8019 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8021 procedure Set_No_Ctrl_Actions
8022 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
8024 procedure Set_No_Entities_Ref_In_Spec
8025 (N
: Node_Id
; Val
: Boolean := True); -- Flag8
8027 procedure Set_No_Initialization
8028 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8030 procedure Set_Null_Present
8031 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8033 procedure Set_Null_Record_Present
8034 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
8036 procedure Set_Object_Definition
8037 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8039 procedure Set_OK_For_Stream
8040 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
8042 procedure Set_Original_Discriminant
8043 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8045 procedure Set_Others_Discrete_Choices
8046 (N
: Node_Id
; Val
: List_Id
); -- List1
8048 procedure Set_Out_Present
8049 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
8051 procedure Set_Parameter_Associations
8052 (N
: Node_Id
; Val
: List_Id
); -- List3
8054 procedure Set_Parameter_List_Truncated
8055 (N
: Node_Id
; Val
: Boolean := True); -- Flag17
8057 procedure Set_Parameter_Specifications
8058 (N
: Node_Id
; Val
: List_Id
); -- List3
8060 procedure Set_Parameter_Type
8061 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8063 procedure Set_Parent_Spec
8064 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8066 procedure Set_Position
8067 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8069 procedure Set_Pragma_Argument_Associations
8070 (N
: Node_Id
; Val
: List_Id
); -- List2
8072 procedure Set_Pragmas_After
8073 (N
: Node_Id
; Val
: List_Id
); -- List5
8075 procedure Set_Pragmas_Before
8076 (N
: Node_Id
; Val
: List_Id
); -- List4
8078 procedure Set_Prefix
8079 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8081 procedure Set_Present_Expr
8082 (N
: Node_Id
; Val
: Uint
); -- Uint3
8084 procedure Set_Prev_Ids
8085 (N
: Node_Id
; Val
: Boolean := True); -- Flag6
8087 procedure Set_Print_In_Hex
8088 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8090 procedure Set_Private_Declarations
8091 (N
: Node_Id
; Val
: List_Id
); -- List3
8093 procedure Set_Private_Present
8094 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
8096 procedure Set_Procedure_To_Call
8097 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8099 procedure Set_Proper_Body
8100 (N
: Node_Id
; Val
: Node_Id
); -- Node1
8102 procedure Set_Protected_Definition
8103 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8105 procedure Set_Protected_Present
8106 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
8108 procedure Set_Raises_Constraint_Error
8109 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
8111 procedure Set_Range_Constraint
8112 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8114 procedure Set_Range_Expression
8115 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8117 procedure Set_Real_Range_Specification
8118 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8120 procedure Set_Realval
8121 (N
: Node_Id
; Val
: Ureal
); -- Ureal3
8123 procedure Set_Reason
8124 (N
: Node_Id
; Val
: Uint
); -- Uint3
8126 procedure Set_Record_Extension_Part
8127 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8129 procedure Set_Redundant_Use
8130 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8132 procedure Set_Return_Type
8133 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8135 procedure Set_Reverse_Present
8136 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
8138 procedure Set_Right_Opnd
8139 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8141 procedure Set_Rounded_Result
8142 (N
: Node_Id
; Val
: Boolean := True); -- Flag18
8145 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8147 procedure Set_Select_Alternatives
8148 (N
: Node_Id
; Val
: List_Id
); -- List1
8150 procedure Set_Selector_Name
8151 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8153 procedure Set_Selector_Names
8154 (N
: Node_Id
; Val
: List_Id
); -- List1
8156 procedure Set_Shift_Count_OK
8157 (N
: Node_Id
; Val
: Boolean := True); -- Flag4
8159 procedure Set_Source_Type
8160 (N
: Node_Id
; Val
: Entity_Id
); -- Node1
8162 procedure Set_Specification
8163 (N
: Node_Id
; Val
: Node_Id
); -- Node1
8165 procedure Set_Statements
8166 (N
: Node_Id
; Val
: List_Id
); -- List3
8168 procedure Set_Static_Processing_OK
8169 (N
: Node_Id
; Val
: Boolean); -- Flag4
8171 procedure Set_Storage_Pool
8172 (N
: Node_Id
; Val
: Node_Id
); -- Node1
8174 procedure Set_Strval
8175 (N
: Node_Id
; Val
: String_Id
); -- Str3
8177 procedure Set_Subtype_Indication
8178 (N
: Node_Id
; Val
: Node_Id
); -- Node5
8180 procedure Set_Subtype_Mark
8181 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8183 procedure Set_Subtype_Marks
8184 (N
: Node_Id
; Val
: List_Id
); -- List2
8186 procedure Set_Tagged_Present
8187 (N
: Node_Id
; Val
: Boolean := True); -- Flag15
8189 procedure Set_Target_Type
8190 (N
: Node_Id
; Val
: Entity_Id
); -- Node2
8192 procedure Set_Task_Body_Procedure
8193 (N
: Node_Id
; Val
: Entity_Id
); -- Node2
8195 procedure Set_Task_Definition
8196 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8198 procedure Set_Then_Actions
8199 (N
: Node_Id
; Val
: List_Id
); -- List2
8201 procedure Set_Then_Statements
8202 (N
: Node_Id
; Val
: List_Id
); -- List2
8204 procedure Set_Treat_Fixed_As_Integer
8205 (N
: Node_Id
; Val
: Boolean := True); -- Flag14
8207 procedure Set_Triggering_Alternative
8208 (N
: Node_Id
; Val
: Node_Id
); -- Node1
8210 procedure Set_Triggering_Statement
8211 (N
: Node_Id
; Val
: Node_Id
); -- Node1
8213 procedure Set_TSS_Elist
8214 (N
: Node_Id
; Val
: Elist_Id
); -- Elist3
8216 procedure Set_Type_Definition
8217 (N
: Node_Id
; Val
: Node_Id
); -- Node3
8220 (N
: Node_Id
; Val
: Node_Id
); -- Node2
8222 procedure Set_Unknown_Discriminants_Present
8223 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8225 procedure Set_Unreferenced_In_Spec
8226 (N
: Node_Id
; Val
: Boolean := True); -- Flag7
8228 procedure Set_Variant_Part
8229 (N
: Node_Id
; Val
: Node_Id
); -- Node4
8231 procedure Set_Variants
8232 (N
: Node_Id
; Val
: List_Id
); -- List1
8234 procedure Set_Visible_Declarations
8235 (N
: Node_Id
; Val
: List_Id
); -- List2
8237 procedure Set_Was_Originally_Stub
8238 (N
: Node_Id
; Val
: Boolean := True); -- Flag13
8240 procedure Set_Zero_Cost_Handling
8241 (N
: Node_Id
; Val
: Boolean := True); -- Flag5
8243 -------------------------
8244 -- Iterator Procedures --
8245 -------------------------
8247 -- The call to Next_xxx (N) is equivalent to N := Next_xxx (N)
8249 procedure Next_Entity
(N
: in out Node_Id
);
8250 procedure Next_Named_Actual
(N
: in out Node_Id
);
8251 procedure Next_Rep_Item
(N
: in out Node_Id
);
8252 procedure Next_Use_Clause
(N
: in out Node_Id
);
8254 --------------------------------------
8255 -- Logical Access to End_Span Field --
8256 --------------------------------------
8258 function End_Location
(N
: Node_Id
) return Source_Ptr
;
8259 -- N is an N_If_Statement or N_Case_Statement node, and this
8260 -- function returns the location of the IF token in the END IF
8261 -- sequence by translating the value of the End_Span field.
8263 procedure Set_End_Location
(N
: Node_Id
; S
: Source_Ptr
);
8264 -- N is an N_If_Statement or N_Case_Statement node. This procedure
8265 -- sets the End_Span field to correspond to the given value S. In
8266 -- other words, End_Span is set to the difference between S and
8267 -- Sloc (N), the starting location.
8269 --------------------
8270 -- Inline Pragmas --
8271 --------------------
8273 pragma Inline
(ABE_Is_Certain
);
8274 pragma Inline
(Abort_Present
);
8275 pragma Inline
(Abortable_Part
);
8276 pragma Inline
(Abstract_Present
);
8277 pragma Inline
(Accept_Handler_Records
);
8278 pragma Inline
(Accept_Statement
);
8279 pragma Inline
(Access_Types_To_Process
);
8280 pragma Inline
(Actions
);
8281 pragma Inline
(Activation_Chain_Entity
);
8282 pragma Inline
(Acts_As_Spec
);
8283 pragma Inline
(Aggregate_Bounds
);
8284 pragma Inline
(Aliased_Present
);
8285 pragma Inline
(All_Others
);
8286 pragma Inline
(All_Present
);
8287 pragma Inline
(Alternatives
);
8288 pragma Inline
(Ancestor_Part
);
8289 pragma Inline
(Array_Aggregate
);
8290 pragma Inline
(Assignment_OK
);
8291 pragma Inline
(Associated_Node
);
8292 pragma Inline
(At_End_Proc
);
8293 pragma Inline
(Attribute_Name
);
8294 pragma Inline
(Aux_Decls_Node
);
8295 pragma Inline
(Backwards_OK
);
8296 pragma Inline
(Bad_Is_Detected
);
8297 pragma Inline
(Body_To_Inline
);
8298 pragma Inline
(Body_Required
);
8299 pragma Inline
(By_Ref
);
8300 pragma Inline
(Box_Present
);
8301 pragma Inline
(Char_Literal_Value
);
8302 pragma Inline
(Chars
);
8303 pragma Inline
(Choice_Parameter
);
8304 pragma Inline
(Choices
);
8305 pragma Inline
(Compile_Time_Known_Aggregate
);
8306 pragma Inline
(Component_Associations
);
8307 pragma Inline
(Component_Clauses
);
8308 pragma Inline
(Component_Items
);
8309 pragma Inline
(Component_List
);
8310 pragma Inline
(Component_Name
);
8311 pragma Inline
(Condition
);
8312 pragma Inline
(Condition_Actions
);
8313 pragma Inline
(Constant_Present
);
8314 pragma Inline
(Constraint
);
8315 pragma Inline
(Constraints
);
8316 pragma Inline
(Context_Installed
);
8317 pragma Inline
(Context_Items
);
8318 pragma Inline
(Controlling_Argument
);
8319 pragma Inline
(Conversion_OK
);
8320 pragma Inline
(Corresponding_Body
);
8321 pragma Inline
(Corresponding_Generic_Association
);
8322 pragma Inline
(Corresponding_Integer_Value
);
8323 pragma Inline
(Corresponding_Spec
);
8324 pragma Inline
(Corresponding_Stub
);
8325 pragma Inline
(Dcheck_Function
);
8326 pragma Inline
(Debug_Statement
);
8327 pragma Inline
(Declarations
);
8328 pragma Inline
(Default_Expression
);
8329 pragma Inline
(Default_Name
);
8330 pragma Inline
(Defining_Identifier
);
8331 pragma Inline
(Defining_Unit_Name
);
8332 pragma Inline
(Delay_Alternative
);
8333 pragma Inline
(Delay_Finalize_Attach
);
8334 pragma Inline
(Delay_Statement
);
8335 pragma Inline
(Delta_Expression
);
8336 pragma Inline
(Digits_Expression
);
8337 pragma Inline
(Discr_Check_Funcs_Built
);
8338 pragma Inline
(Discrete_Choices
);
8339 pragma Inline
(Discrete_Range
);
8340 pragma Inline
(Discrete_Subtype_Definition
);
8341 pragma Inline
(Discrete_Subtype_Definitions
);
8342 pragma Inline
(Discriminant_Specifications
);
8343 pragma Inline
(Discriminant_Type
);
8344 pragma Inline
(Do_Access_Check
);
8345 pragma Inline
(Do_Accessibility_Check
);
8346 pragma Inline
(Do_Discriminant_Check
);
8347 pragma Inline
(Do_Length_Check
);
8348 pragma Inline
(Do_Division_Check
);
8349 pragma Inline
(Do_Overflow_Check
);
8350 pragma Inline
(Do_Range_Check
);
8351 pragma Inline
(Do_Storage_Check
);
8352 pragma Inline
(Do_Tag_Check
);
8353 pragma Inline
(Elaborate_Present
);
8354 pragma Inline
(Elaborate_All_Present
);
8355 pragma Inline
(Elaboration_Boolean
);
8356 pragma Inline
(Else_Actions
);
8357 pragma Inline
(Else_Statements
);
8358 pragma Inline
(Elsif_Parts
);
8359 pragma Inline
(Enclosing_Variant
);
8360 pragma Inline
(End_Label
);
8361 pragma Inline
(End_Span
);
8362 pragma Inline
(Entity
);
8363 pragma Inline
(Entry_Body_Formal_Part
);
8364 pragma Inline
(Entry_Call_Alternative
);
8365 pragma Inline
(Entry_Call_Statement
);
8366 pragma Inline
(Entry_Direct_Name
);
8367 pragma Inline
(Entry_Index
);
8368 pragma Inline
(Entry_Index_Specification
);
8369 pragma Inline
(Etype
);
8370 pragma Inline
(Exception_Choices
);
8371 pragma Inline
(Exception_Junk
);
8372 pragma Inline
(Exception_Handlers
);
8373 pragma Inline
(Expansion_Delayed
);
8374 pragma Inline
(Explicit_Actual_Parameter
);
8375 pragma Inline
(Explicit_Generic_Actual_Parameter
);
8376 pragma Inline
(Expression
);
8377 pragma Inline
(Expressions
);
8378 pragma Inline
(First_Bit
);
8379 pragma Inline
(First_Inlined_Subprogram
);
8380 pragma Inline
(First_Name
);
8381 pragma Inline
(First_Named_Actual
);
8382 pragma Inline
(First_Real_Statement
);
8383 pragma Inline
(First_Subtype_Link
);
8384 pragma Inline
(Float_Truncate
);
8385 pragma Inline
(Formal_Type_Definition
);
8386 pragma Inline
(Forwards_OK
);
8387 pragma Inline
(From_At_Mod
);
8388 pragma Inline
(Generic_Associations
);
8389 pragma Inline
(Generic_Formal_Declarations
);
8390 pragma Inline
(Generic_Parent
);
8391 pragma Inline
(Generic_Parent_Type
);
8392 pragma Inline
(Handled_Statement_Sequence
);
8393 pragma Inline
(Handler_List_Entry
);
8394 pragma Inline
(Has_Created_Identifier
);
8395 pragma Inline
(Has_Dynamic_Length_Check
);
8396 pragma Inline
(Has_Dynamic_Range_Check
);
8397 pragma Inline
(Has_No_Elaboration_Code
);
8398 pragma Inline
(Has_Priority_Pragma
);
8399 pragma Inline
(Has_Private_View
);
8400 pragma Inline
(Has_Storage_Size_Pragma
);
8401 pragma Inline
(Has_Task_Info_Pragma
);
8402 pragma Inline
(Has_Task_Name_Pragma
);
8403 pragma Inline
(Has_Wide_Character
);
8404 pragma Inline
(Hidden_By_Use_Clause
);
8405 pragma Inline
(High_Bound
);
8406 pragma Inline
(Identifier
);
8407 pragma Inline
(Implicit_With
);
8408 pragma Inline
(Includes_Infinities
);
8409 pragma Inline
(In_Present
);
8410 pragma Inline
(Instance_Spec
);
8411 pragma Inline
(Intval
);
8412 pragma Inline
(Is_Asynchronous_Call_Block
);
8413 pragma Inline
(Is_Component_Left_Opnd
);
8414 pragma Inline
(Is_Component_Right_Opnd
);
8415 pragma Inline
(Is_Controlling_Actual
);
8416 pragma Inline
(Is_Machine_Number
);
8417 pragma Inline
(Is_Overloaded
);
8418 pragma Inline
(Is_Power_Of_2_For_Shift
);
8419 pragma Inline
(Is_Protected_Subprogram_Body
);
8420 pragma Inline
(Is_Static_Expression
);
8421 pragma Inline
(Is_Subprogram_Descriptor
);
8422 pragma Inline
(Is_Task_Allocation_Block
);
8423 pragma Inline
(Is_Task_Master
);
8424 pragma Inline
(Iteration_Scheme
);
8425 pragma Inline
(Itype
);
8426 pragma Inline
(Kill_Range_Check
);
8427 pragma Inline
(Last_Bit
);
8428 pragma Inline
(Last_Name
);
8429 pragma Inline
(Library_Unit
);
8430 pragma Inline
(Label_Construct
);
8431 pragma Inline
(Left_Opnd
);
8432 pragma Inline
(Limited_Present
);
8433 pragma Inline
(Literals
);
8434 pragma Inline
(Loop_Actions
);
8435 pragma Inline
(Loop_Parameter_Specification
);
8436 pragma Inline
(Low_Bound
);
8437 pragma Inline
(Mod_Clause
);
8438 pragma Inline
(More_Ids
);
8439 pragma Inline
(Must_Be_Byte_Aligned
);
8440 pragma Inline
(Must_Not_Freeze
);
8441 pragma Inline
(Name
);
8442 pragma Inline
(Names
);
8443 pragma Inline
(Next_Entity
);
8444 pragma Inline
(Next_Named_Actual
);
8445 pragma Inline
(Next_Rep_Item
);
8446 pragma Inline
(Next_Use_Clause
);
8447 pragma Inline
(No_Ctrl_Actions
);
8448 pragma Inline
(No_Entities_Ref_In_Spec
);
8449 pragma Inline
(No_Initialization
);
8450 pragma Inline
(Null_Present
);
8451 pragma Inline
(Null_Record_Present
);
8452 pragma Inline
(Object_Definition
);
8453 pragma Inline
(OK_For_Stream
);
8454 pragma Inline
(Original_Discriminant
);
8455 pragma Inline
(Others_Discrete_Choices
);
8456 pragma Inline
(Out_Present
);
8457 pragma Inline
(Parameter_Associations
);
8458 pragma Inline
(Parameter_Specifications
);
8459 pragma Inline
(Parameter_List_Truncated
);
8460 pragma Inline
(Parameter_Type
);
8461 pragma Inline
(Parent_Spec
);
8462 pragma Inline
(Position
);
8463 pragma Inline
(Pragma_Argument_Associations
);
8464 pragma Inline
(Pragmas_After
);
8465 pragma Inline
(Pragmas_Before
);
8466 pragma Inline
(Prefix
);
8467 pragma Inline
(Present_Expr
);
8468 pragma Inline
(Prev_Ids
);
8469 pragma Inline
(Print_In_Hex
);
8470 pragma Inline
(Private_Declarations
);
8471 pragma Inline
(Private_Present
);
8472 pragma Inline
(Procedure_To_Call
);
8473 pragma Inline
(Proper_Body
);
8474 pragma Inline
(Protected_Definition
);
8475 pragma Inline
(Protected_Present
);
8476 pragma Inline
(Raises_Constraint_Error
);
8477 pragma Inline
(Range_Constraint
);
8478 pragma Inline
(Range_Expression
);
8479 pragma Inline
(Real_Range_Specification
);
8480 pragma Inline
(Realval
);
8481 pragma Inline
(Reason
);
8482 pragma Inline
(Record_Extension_Part
);
8483 pragma Inline
(Redundant_Use
);
8484 pragma Inline
(Return_Type
);
8485 pragma Inline
(Reverse_Present
);
8486 pragma Inline
(Right_Opnd
);
8487 pragma Inline
(Rounded_Result
);
8488 pragma Inline
(Scope
);
8489 pragma Inline
(Select_Alternatives
);
8490 pragma Inline
(Selector_Name
);
8491 pragma Inline
(Selector_Names
);
8492 pragma Inline
(Shift_Count_OK
);
8493 pragma Inline
(Source_Type
);
8494 pragma Inline
(Specification
);
8495 pragma Inline
(Statements
);
8496 pragma Inline
(Static_Processing_OK
);
8497 pragma Inline
(Storage_Pool
);
8498 pragma Inline
(Strval
);
8499 pragma Inline
(Subtype_Indication
);
8500 pragma Inline
(Subtype_Mark
);
8501 pragma Inline
(Subtype_Marks
);
8502 pragma Inline
(Tagged_Present
);
8503 pragma Inline
(Target_Type
);
8504 pragma Inline
(Task_Body_Procedure
);
8505 pragma Inline
(Task_Definition
);
8506 pragma Inline
(Then_Actions
);
8507 pragma Inline
(Then_Statements
);
8508 pragma Inline
(Triggering_Alternative
);
8509 pragma Inline
(Triggering_Statement
);
8510 pragma Inline
(Treat_Fixed_As_Integer
);
8511 pragma Inline
(TSS_Elist
);
8512 pragma Inline
(Type_Definition
);
8513 pragma Inline
(Unit
);
8514 pragma Inline
(Unknown_Discriminants_Present
);
8515 pragma Inline
(Unreferenced_In_Spec
);
8516 pragma Inline
(Variant_Part
);
8517 pragma Inline
(Variants
);
8518 pragma Inline
(Visible_Declarations
);
8519 pragma Inline
(Was_Originally_Stub
);
8520 pragma Inline
(Zero_Cost_Handling
);
8522 pragma Inline
(Set_ABE_Is_Certain
);
8523 pragma Inline
(Set_Abort_Present
);
8524 pragma Inline
(Set_Abortable_Part
);
8525 pragma Inline
(Set_Abstract_Present
);
8526 pragma Inline
(Set_Accept_Handler_Records
);
8527 pragma Inline
(Set_Accept_Statement
);
8528 pragma Inline
(Set_Access_Types_To_Process
);
8529 pragma Inline
(Set_Actions
);
8530 pragma Inline
(Set_Activation_Chain_Entity
);
8531 pragma Inline
(Set_Acts_As_Spec
);
8532 pragma Inline
(Set_Aggregate_Bounds
);
8533 pragma Inline
(Set_Aliased_Present
);
8534 pragma Inline
(Set_All_Others
);
8535 pragma Inline
(Set_All_Present
);
8536 pragma Inline
(Set_Alternatives
);
8537 pragma Inline
(Set_Ancestor_Part
);
8538 pragma Inline
(Set_Array_Aggregate
);
8539 pragma Inline
(Set_Assignment_OK
);
8540 pragma Inline
(Set_Associated_Node
);
8541 pragma Inline
(Set_At_End_Proc
);
8542 pragma Inline
(Set_Attribute_Name
);
8543 pragma Inline
(Set_Aux_Decls_Node
);
8544 pragma Inline
(Set_Backwards_OK
);
8545 pragma Inline
(Set_Bad_Is_Detected
);
8546 pragma Inline
(Set_Body_To_Inline
);
8547 pragma Inline
(Set_Body_Required
);
8548 pragma Inline
(Set_By_Ref
);
8549 pragma Inline
(Set_Box_Present
);
8550 pragma Inline
(Set_Char_Literal_Value
);
8551 pragma Inline
(Set_Chars
);
8552 pragma Inline
(Set_Choice_Parameter
);
8553 pragma Inline
(Set_Choices
);
8554 pragma Inline
(Set_Compile_Time_Known_Aggregate
);
8555 pragma Inline
(Set_Component_Associations
);
8556 pragma Inline
(Set_Component_Clauses
);
8557 pragma Inline
(Set_Component_Items
);
8558 pragma Inline
(Set_Component_List
);
8559 pragma Inline
(Set_Component_Name
);
8560 pragma Inline
(Set_Condition
);
8561 pragma Inline
(Set_Condition_Actions
);
8562 pragma Inline
(Set_Constant_Present
);
8563 pragma Inline
(Set_Constraint
);
8564 pragma Inline
(Set_Constraints
);
8565 pragma Inline
(Set_Context_Installed
);
8566 pragma Inline
(Set_Context_Items
);
8567 pragma Inline
(Set_Controlling_Argument
);
8568 pragma Inline
(Set_Conversion_OK
);
8569 pragma Inline
(Set_Corresponding_Body
);
8570 pragma Inline
(Set_Corresponding_Generic_Association
);
8571 pragma Inline
(Set_Corresponding_Integer_Value
);
8572 pragma Inline
(Set_Corresponding_Spec
);
8573 pragma Inline
(Set_Corresponding_Stub
);
8574 pragma Inline
(Set_Dcheck_Function
);
8575 pragma Inline
(Set_Debug_Statement
);
8576 pragma Inline
(Set_Declarations
);
8577 pragma Inline
(Set_Default_Expression
);
8578 pragma Inline
(Set_Default_Name
);
8579 pragma Inline
(Set_Defining_Identifier
);
8580 pragma Inline
(Set_Defining_Unit_Name
);
8581 pragma Inline
(Set_Delay_Alternative
);
8582 pragma Inline
(Set_Delay_Finalize_Attach
);
8583 pragma Inline
(Set_Delay_Statement
);
8584 pragma Inline
(Set_Delta_Expression
);
8585 pragma Inline
(Set_Digits_Expression
);
8586 pragma Inline
(Set_Discr_Check_Funcs_Built
);
8587 pragma Inline
(Set_Discrete_Choices
);
8588 pragma Inline
(Set_Discrete_Range
);
8589 pragma Inline
(Set_Discrete_Subtype_Definition
);
8590 pragma Inline
(Set_Discrete_Subtype_Definitions
);
8591 pragma Inline
(Set_Discriminant_Specifications
);
8592 pragma Inline
(Set_Discriminant_Type
);
8593 pragma Inline
(Set_Do_Access_Check
);
8594 pragma Inline
(Set_Do_Accessibility_Check
);
8595 pragma Inline
(Set_Do_Discriminant_Check
);
8596 pragma Inline
(Set_Do_Length_Check
);
8597 pragma Inline
(Set_Do_Division_Check
);
8598 pragma Inline
(Set_Do_Overflow_Check
);
8599 pragma Inline
(Set_Do_Range_Check
);
8600 pragma Inline
(Set_Do_Storage_Check
);
8601 pragma Inline
(Set_Do_Tag_Check
);
8602 pragma Inline
(Set_Elaborate_Present
);
8603 pragma Inline
(Set_Elaborate_All_Present
);
8604 pragma Inline
(Set_Elaboration_Boolean
);
8605 pragma Inline
(Set_Else_Actions
);
8606 pragma Inline
(Set_Else_Statements
);
8607 pragma Inline
(Set_Elsif_Parts
);
8608 pragma Inline
(Set_Enclosing_Variant
);
8609 pragma Inline
(Set_End_Label
);
8610 pragma Inline
(Set_End_Span
);
8611 pragma Inline
(Set_Entity
);
8612 pragma Inline
(Set_Entry_Body_Formal_Part
);
8613 pragma Inline
(Set_Entry_Call_Alternative
);
8614 pragma Inline
(Set_Entry_Call_Statement
);
8615 pragma Inline
(Set_Entry_Direct_Name
);
8616 pragma Inline
(Set_Entry_Index
);
8617 pragma Inline
(Set_Entry_Index_Specification
);
8618 pragma Inline
(Set_Etype
);
8619 pragma Inline
(Set_Exception_Choices
);
8620 pragma Inline
(Set_Exception_Junk
);
8621 pragma Inline
(Set_Exception_Handlers
);
8622 pragma Inline
(Set_Expansion_Delayed
);
8623 pragma Inline
(Set_Explicit_Actual_Parameter
);
8624 pragma Inline
(Set_Explicit_Generic_Actual_Parameter
);
8625 pragma Inline
(Set_Expression
);
8626 pragma Inline
(Set_Expressions
);
8627 pragma Inline
(Set_First_Bit
);
8628 pragma Inline
(Set_First_Inlined_Subprogram
);
8629 pragma Inline
(Set_First_Name
);
8630 pragma Inline
(Set_First_Named_Actual
);
8631 pragma Inline
(Set_First_Real_Statement
);
8632 pragma Inline
(Set_First_Subtype_Link
);
8633 pragma Inline
(Set_Float_Truncate
);
8634 pragma Inline
(Set_Formal_Type_Definition
);
8635 pragma Inline
(Set_Forwards_OK
);
8636 pragma Inline
(Set_From_At_Mod
);
8637 pragma Inline
(Set_Generic_Associations
);
8638 pragma Inline
(Set_Generic_Formal_Declarations
);
8639 pragma Inline
(Set_Generic_Parent
);
8640 pragma Inline
(Set_Generic_Parent_Type
);
8641 pragma Inline
(Set_Handled_Statement_Sequence
);
8642 pragma Inline
(Set_Handler_List_Entry
);
8643 pragma Inline
(Set_Has_Created_Identifier
);
8644 pragma Inline
(Set_Has_Dynamic_Length_Check
);
8645 pragma Inline
(Set_Has_Dynamic_Range_Check
);
8646 pragma Inline
(Set_Has_No_Elaboration_Code
);
8647 pragma Inline
(Set_Has_Priority_Pragma
);
8648 pragma Inline
(Set_Has_Private_View
);
8649 pragma Inline
(Set_Has_Storage_Size_Pragma
);
8650 pragma Inline
(Set_Has_Task_Info_Pragma
);
8651 pragma Inline
(Set_Has_Task_Name_Pragma
);
8652 pragma Inline
(Set_Has_Wide_Character
);
8653 pragma Inline
(Set_Hidden_By_Use_Clause
);
8654 pragma Inline
(Set_High_Bound
);
8655 pragma Inline
(Set_Identifier
);
8656 pragma Inline
(Set_Implicit_With
);
8657 pragma Inline
(Set_Includes_Infinities
);
8658 pragma Inline
(Set_In_Present
);
8659 pragma Inline
(Set_Instance_Spec
);
8660 pragma Inline
(Set_Intval
);
8661 pragma Inline
(Set_Is_Asynchronous_Call_Block
);
8662 pragma Inline
(Set_Is_Component_Left_Opnd
);
8663 pragma Inline
(Set_Is_Component_Right_Opnd
);
8664 pragma Inline
(Set_Is_Controlling_Actual
);
8665 pragma Inline
(Set_Is_Machine_Number
);
8666 pragma Inline
(Set_Is_Overloaded
);
8667 pragma Inline
(Set_Is_Power_Of_2_For_Shift
);
8668 pragma Inline
(Set_Is_Protected_Subprogram_Body
);
8669 pragma Inline
(Set_Is_Static_Expression
);
8670 pragma Inline
(Set_Is_Subprogram_Descriptor
);
8671 pragma Inline
(Set_Is_Task_Allocation_Block
);
8672 pragma Inline
(Set_Is_Task_Master
);
8673 pragma Inline
(Set_Iteration_Scheme
);
8674 pragma Inline
(Set_Itype
);
8675 pragma Inline
(Set_Kill_Range_Check
);
8676 pragma Inline
(Set_Last_Bit
);
8677 pragma Inline
(Set_Last_Name
);
8678 pragma Inline
(Set_Library_Unit
);
8679 pragma Inline
(Set_Label_Construct
);
8680 pragma Inline
(Set_Left_Opnd
);
8681 pragma Inline
(Set_Limited_Present
);
8682 pragma Inline
(Set_Literals
);
8683 pragma Inline
(Set_Loop_Actions
);
8684 pragma Inline
(Set_Loop_Parameter_Specification
);
8685 pragma Inline
(Set_Low_Bound
);
8686 pragma Inline
(Set_Mod_Clause
);
8687 pragma Inline
(Set_More_Ids
);
8688 pragma Inline
(Set_Must_Be_Byte_Aligned
);
8689 pragma Inline
(Set_Must_Not_Freeze
);
8690 pragma Inline
(Set_Name
);
8691 pragma Inline
(Set_Names
);
8692 pragma Inline
(Set_Next_Entity
);
8693 pragma Inline
(Set_Next_Named_Actual
);
8694 pragma Inline
(Set_Next_Use_Clause
);
8695 pragma Inline
(Set_No_Ctrl_Actions
);
8696 pragma Inline
(Set_No_Entities_Ref_In_Spec
);
8697 pragma Inline
(Set_No_Initialization
);
8698 pragma Inline
(Set_Null_Present
);
8699 pragma Inline
(Set_Null_Record_Present
);
8700 pragma Inline
(Set_Object_Definition
);
8701 pragma Inline
(Set_OK_For_Stream
);
8702 pragma Inline
(Set_Original_Discriminant
);
8703 pragma Inline
(Set_Others_Discrete_Choices
);
8704 pragma Inline
(Set_Out_Present
);
8705 pragma Inline
(Set_Parameter_Associations
);
8706 pragma Inline
(Set_Parameter_Specifications
);
8707 pragma Inline
(Set_Parameter_List_Truncated
);
8708 pragma Inline
(Set_Parameter_Type
);
8709 pragma Inline
(Set_Parent_Spec
);
8710 pragma Inline
(Set_Position
);
8711 pragma Inline
(Set_Pragma_Argument_Associations
);
8712 pragma Inline
(Set_Pragmas_After
);
8713 pragma Inline
(Set_Pragmas_Before
);
8714 pragma Inline
(Set_Prefix
);
8715 pragma Inline
(Set_Present_Expr
);
8716 pragma Inline
(Set_Prev_Ids
);
8717 pragma Inline
(Set_Print_In_Hex
);
8718 pragma Inline
(Set_Private_Declarations
);
8719 pragma Inline
(Set_Private_Present
);
8720 pragma Inline
(Set_Procedure_To_Call
);
8721 pragma Inline
(Set_Proper_Body
);
8722 pragma Inline
(Set_Protected_Definition
);
8723 pragma Inline
(Set_Protected_Present
);
8724 pragma Inline
(Set_Raises_Constraint_Error
);
8725 pragma Inline
(Set_Range_Constraint
);
8726 pragma Inline
(Set_Range_Expression
);
8727 pragma Inline
(Set_Real_Range_Specification
);
8728 pragma Inline
(Set_Realval
);
8729 pragma Inline
(Set_Reason
);
8730 pragma Inline
(Set_Record_Extension_Part
);
8731 pragma Inline
(Set_Redundant_Use
);
8732 pragma Inline
(Set_Return_Type
);
8733 pragma Inline
(Set_Reverse_Present
);
8734 pragma Inline
(Set_Right_Opnd
);
8735 pragma Inline
(Set_Rounded_Result
);
8736 pragma Inline
(Set_Scope
);
8737 pragma Inline
(Set_Select_Alternatives
);
8738 pragma Inline
(Set_Selector_Name
);
8739 pragma Inline
(Set_Selector_Names
);
8740 pragma Inline
(Set_Shift_Count_OK
);
8741 pragma Inline
(Set_Source_Type
);
8742 pragma Inline
(Set_Specification
);
8743 pragma Inline
(Set_Statements
);
8744 pragma Inline
(Set_Static_Processing_OK
);
8745 pragma Inline
(Set_Storage_Pool
);
8746 pragma Inline
(Set_Strval
);
8747 pragma Inline
(Set_Subtype_Indication
);
8748 pragma Inline
(Set_Subtype_Mark
);
8749 pragma Inline
(Set_Subtype_Marks
);
8750 pragma Inline
(Set_Tagged_Present
);
8751 pragma Inline
(Set_Target_Type
);
8752 pragma Inline
(Set_Task_Body_Procedure
);
8753 pragma Inline
(Set_Task_Definition
);
8754 pragma Inline
(Set_Then_Actions
);
8755 pragma Inline
(Set_Then_Statements
);
8756 pragma Inline
(Set_Triggering_Alternative
);
8757 pragma Inline
(Set_Triggering_Statement
);
8758 pragma Inline
(Set_Treat_Fixed_As_Integer
);
8759 pragma Inline
(Set_TSS_Elist
);
8760 pragma Inline
(Set_Type_Definition
);
8761 pragma Inline
(Set_Unit
);
8762 pragma Inline
(Set_Unknown_Discriminants_Present
);
8763 pragma Inline
(Set_Unreferenced_In_Spec
);
8764 pragma Inline
(Set_Variant_Part
);
8765 pragma Inline
(Set_Variants
);
8766 pragma Inline
(Set_Visible_Declarations
);
8767 pragma Inline
(Set_Was_Originally_Stub
);
8768 pragma Inline
(Set_Zero_Cost_Handling
);