Skip several gcc.dg/builtin-dynamic-object-size tests on hppa*-*-hpux*
[official-gcc.git] / gcc / ada / sinfo.ads
blobfc4589d2087211752e5c165ce8720316ff1a55e2
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S I N F O --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2023, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This package documents the structure of the abstract syntax tree. The Atree
27 -- package provides a basic tree structure. Sinfo describes how this structure
28 -- is used to represent the syntax of an Ada program.
30 -- The grammar in the RM is followed very closely in the tree design, and is
31 -- repeated as part of this source file.
33 -- The tree contains not only the full syntactic representation of the
34 -- program, but also the results of semantic analysis. In particular, the
35 -- nodes for defining identifiers, defining character literals, and defining
36 -- operator symbols, collectively referred to as entities, represent what
37 -- would normally be regarded as the symbol table information. In addition a
38 -- number of the tree nodes contain semantic information.
40 -- See the spec of Gen_IL.Gen for instructions on making changes to this file.
41 -- Note that the official definition of what nodes have what fields is in
42 -- Gen_IL.Gen.Gen_Nodes; if there is a discrepancy between that and the
43 -- comments here, Gen_IL.Gen.Gen_Nodes wins.
45 pragma Warnings (Off); -- with/use clauses for children
46 with Namet; use Namet;
47 with Types; use Types;
48 with Uintp; use Uintp;
49 with Urealp; use Urealp;
50 pragma Warnings (On);
52 package Sinfo is
54 ----------------------------------------
55 -- Definitions of fields in tree node --
56 ----------------------------------------
58 -- The following fields are common to all nodes:
60 -- Nkind Indicates the kind of the node. This field is present
61 -- in all nodes.
63 -- Sloc Location (Source_Ptr) of the corresponding token
64 -- in the Source buffer. The individual node definitions
65 -- show which token is referenced by this pointer.
67 -- In_List A flag used to indicate if the node is a member
68 -- of a node list (see package Nlists).
70 -- Rewrite_Ins A flag set if a node is marked as a rewrite inserted
71 -- node as a result of a call to Mark_Rewrite_Insertion.
73 -- Small_Paren_Count
74 -- A 2-bit count used in subexpression nodes to indicate
75 -- the level of parentheses. The settings are 0,1,2 and
76 -- 3 for many. If the value is 3, then an auxiliary table
77 -- is used to indicate the real value, which is computed by
78 -- Paren_Count. Set to zero for nonsubexpression nodes.
80 -- Note: the required parentheses surrounding conditional
81 -- and quantified expressions count as a level of parens
82 -- for this purpose, so e.g. in X := (if A then B else C);
83 -- Paren_Count for the right side will be 1.
85 -- Comes_From_Source
86 -- This flag is present in all nodes. It is set if the
87 -- node is built by the scanner or parser, and clear if
88 -- the node is built by the analyzer or expander. It
89 -- indicates that the node corresponds to a construct
90 -- that appears in the original source program.
92 -- Analyzed This flag is present in all nodes. It is set when
93 -- a node is analyzed, and is used to avoid analyzing
94 -- the same node twice. Analysis includes expansion if
95 -- expansion is active, so in this case if the flag is
96 -- set it means the node has been analyzed and expanded.
98 -- Error_Posted This flag is present in all nodes. It is set when
99 -- an error message is posted which is associated with
100 -- the flagged node. This is used to avoid posting more
101 -- than one message on the same node.
103 -- Link For a node, points to the Parent. For a list, points
104 -- to the list header. Note that in the latter case, a
105 -- client cannot modify the link field. This field is
106 -- private to the Atree package (but is also modified
107 -- by the Nlists package).
109 -- The following additional fields are common to all entities (that is,
110 -- nodes whose Nkind is in N_Entity):
112 -- Ekind Entity type.
114 -- Convention Entity convention (Convention_Id value)
116 --------------------------------
117 -- Implicit Nodes in the Tree --
118 --------------------------------
120 -- Generally the structure of the tree very closely follows the grammar as
121 -- defined in the RM. However, certain nodes are omitted to save space and
122 -- simplify semantic processing. Two general classes of such omitted nodes
123 -- are as follows:
125 -- If the only possibilities for a non-terminal are one or more other
126 -- non-terminals (i.e. the rule is a "skinny" rule), then usually the
127 -- corresponding node is omitted from the tree, and the target construct
128 -- appears directly. For example, a real type definition is either
129 -- floating point definition or a fixed point definition. No explicit node
130 -- appears for real type definition. Instead either the floating point
131 -- definition or fixed point definition appears directly.
133 -- If a non-terminal corresponds to a list of some other non-terminal
134 -- (possibly with separating punctuation), then usually it is omitted from
135 -- the tree, and a list of components appears instead. For example,
136 -- sequence of statements does not appear explicitly in the tree. Instead
137 -- a list of statements appears directly.
139 -- Some additional cases of omitted nodes occur and are documented
140 -- individually. In particular, many nodes are omitted in the tree
141 -- generated for an expression.
143 -------------------------------------------
144 -- Handling of Defining Identifier Lists --
145 -------------------------------------------
147 -- In several declarative forms in the syntax, lists of defining
148 -- identifiers appear (object declarations, component declarations, number
149 -- declarations etc.)
151 -- The semantics of such statements are equivalent to a series of identical
152 -- declarations of single defining identifiers (except that conformance
153 -- checks require the same grouping of identifiers in the parameter case).
155 -- To simplify semantic processing, the parser breaks down such multiple
156 -- declaration cases into sequences of single declarations, duplicating
157 -- type and initialization information as required. The flags More_Ids and
158 -- Prev_Ids are used to record the original form of the source in the case
159 -- where the original source used a list of names, More_Ids being set on
160 -- all but the last name and Prev_Ids being set on all but the first name.
161 -- These flags are used to reconstruct the original source (e.g. in the
162 -- Sprint package), and also are included in the conformance checks, but
163 -- otherwise have no semantic significance.
165 -- Note: the reason that we use More_Ids and Prev_Ids rather than
166 -- First_Name and Last_Name flags is so that the flags are off in the
167 -- normal one identifier case, which minimizes tree print output.
169 -----------------------
170 -- Use of Node Lists --
171 -----------------------
173 -- With a few exceptions, if a construction of the form {non-terminal}
174 -- appears in the tree, lists are used in the corresponding tree node (see
175 -- package Nlists for handling of node lists). In this case a field of the
176 -- parent node points to a list of nodes for the non-terminal. The field
177 -- name for such fields has a plural name which always ends in "s". For
178 -- example, a case statement has a field Alternatives pointing to list of
179 -- case statement alternative nodes.
181 -- Only fields pointing to lists have names ending in "s", so generally the
182 -- structure is strongly typed, fields not ending in s point to single
183 -- nodes, and fields ending in s point to lists.
185 -- The following example shows how a traversal of a list is written. We
186 -- suppose here that Stmt points to a N_Case_Statement node which has a
187 -- list field called Alternatives:
189 -- Alt := First (Alternatives (Stmt));
190 -- while Present (Alt) loop
191 -- ..
192 -- -- processing for case statement alternative Alt
193 -- ..
194 -- Alt := Next (Alt);
195 -- end loop;
197 -- The Present function tests for Empty, which in this case signals the end
198 -- of the list. First returns Empty immediately if the list is empty.
199 -- Present is defined in Atree; First and Next are defined in Nlists.
201 -- The exceptions to this rule occur with {DEFINING_IDENTIFIERS} in all
202 -- contexts, which is handled as described in the previous section, and
203 -- with {,library_unit_NAME} in the N_With_Clause node, which is handled
204 -- using the First_Name and Last_Name flags, as further detailed in the
205 -- description of the N_With_Clause node.
207 -------------
208 -- Pragmas --
209 -------------
211 -- Pragmas can appear in many different context, but are not included in
212 -- the grammar. Still they must appear in the tree, so they can be properly
213 -- processed.
215 -- Two approaches are used. In some cases, an extra field is defined in an
216 -- appropriate node that contains a list of pragmas appearing in the
217 -- expected context. For example pragmas can appear before an
218 -- Accept_Alternative in a Selective_Accept_Statement, and these pragmas
219 -- appear in the Pragmas_Before field of the N_Accept_Alternative node.
221 -- The other approach is to simply allow pragmas to appear in syntactic
222 -- lists where the grammar (of course) does not include the possibility.
223 -- For example, the Variants field of an N_Variant_Part node points to a
224 -- list that can contain both N_Pragma and N_Variant nodes.
226 -- To make processing easier in the latter case, the Nlists package
227 -- provides a set of routines (First_Non_Pragma, Last_Non_Pragma,
228 -- Next_Non_Pragma, Prev_Non_Pragma) that allow such lists to be handled
229 -- ignoring all pragmas.
231 -- In the case of the variants list, we can either write:
233 -- Variant := First (Variants (N));
234 -- while Present (Variant) loop
235 -- ...
236 -- Variant := Next (Variant);
237 -- end loop;
239 -- or
241 -- Variant := First_Non_Pragma (Variants (N));
242 -- while Present (Variant) loop
243 -- ...
244 -- Variant := Next_Non_Pragma (Variant);
245 -- end loop;
247 -- In the first form of the loop, Variant can either be an N_Pragma or an
248 -- N_Variant node. In the second form, Variant can only be N_Variant since
249 -- all pragmas are skipped.
251 ---------------------
252 -- Optional Fields --
253 ---------------------
255 -- Fields which correspond to a section of the syntax enclosed in square
256 -- brackets are generally omitted (and the corresponding field set to Empty
257 -- for a node, or No_List for a list). The documentation of such fields
258 -- notes these cases. One exception to this rule occurs in the case of
259 -- possibly empty statement sequences (such as the sequence of statements
260 -- in an entry call alternative). Such cases appear in the syntax rules as
261 -- [SEQUENCE_OF_STATEMENTS] and the fields corresponding to such optional
262 -- statement sequences always contain an empty list (not No_List) if no
263 -- statements are present.
265 -- Note: the utility program that constructs the body and spec of the Nmake
266 -- package relies on the format of the comments to determine if a field
267 -- should have a default value in the corresponding make routine. The rule
268 -- is that if the first line of the description of the field contains the
269 -- string "(set to xxx if", then a default value of xxx is provided for
270 -- this field in the corresponding Make_yyy routine.
272 -----------------------------------
273 -- Note on Body/Spec Terminology --
274 -----------------------------------
276 -- In informal discussions about Ada, it is customary to refer to package
277 -- and subprogram specs and bodies. However, this is not technically
278 -- correct, what is normally referred to as a spec or specification is in
279 -- fact a package declaration or subprogram declaration. We are careful in
280 -- GNAT to use the correct terminology and in particular, the full word
281 -- specification is never used as an incorrect substitute for declaration.
282 -- The structure and terminology used in the tree also reflects the grammar
283 -- and thus uses declaration and specification in the technically correct
284 -- manner.
286 -- However, there are contexts in which the informal terminology is useful.
287 -- We have the word "body" to refer to the Interp_Etype declared by the
288 -- declaration of a unit body, and in some contexts we need similar term to
289 -- refer to the entity declared by the package or subprogram declaration,
290 -- and simply using declaration can be confusing since the body also has a
291 -- declaration.
293 -- An example of such a context is the link between the package body and
294 -- its declaration. With_Declaration is confusing, since the package body
295 -- itself is a declaration.
297 -- To deal with this problem, we reserve the informal term Spec, i.e. the
298 -- popular abbreviation used in this context, to refer to the entity
299 -- declared by the package or subprogram declaration. So in the above
300 -- example case, the field in the body is called With_Spec.
302 -- Another important context for the use of the word Spec is in error
303 -- messages, where a hyper-correct use of declaration would be confusing to
304 -- a typical Ada programmer, and even for an expert programmer can cause
305 -- confusion since the body has a declaration as well.
307 -- So, to summarize:
309 -- Declaration always refers to the syntactic entity that is called
310 -- a declaration. In particular, subprogram declaration
311 -- and package declaration are used to describe the
312 -- syntactic entity that includes the semicolon.
314 -- Specification always refers to the syntactic entity that is called
315 -- a specification. In particular, the terms procedure
316 -- specification, function specification, package
317 -- specification, subprogram specification always refer
318 -- to the syntactic entity that has no semicolon.
320 -- Spec is an informal term, used to refer to the entity
321 -- that is declared by a task declaration, protected
322 -- declaration, generic declaration, subprogram
323 -- declaration or package declaration.
325 -- This convention is followed throughout the GNAT documentation
326 -- both internal and external, and in all error message text.
328 ------------------------
329 -- Internal Use Nodes --
330 ------------------------
332 -- These are Node_Kind settings used in the internal implementation which
333 -- are not logically part of the specification.
335 -- N_Unused_At_Start
336 -- Completely unused entry at the start of the enumeration type. This
337 -- is inserted so that no legitimate value is zero, which helps to get
338 -- better debugging behavior, since zero is a likely uninitialized value).
340 -- N_Unused_At_End
341 -- Completely unused entry at the end of the enumeration type. This is
342 -- handy so that arrays with Node_Kind as the index type have an extra
343 -- entry at the end (see for example the use of the Pchar_Pos_Array in
344 -- Treepr, where the extra entry provides the limit value when dealing with
345 -- the last used entry in the array).
347 -----------------------------------------
348 -- Note on the settings of Sloc fields --
349 -----------------------------------------
351 -- The Sloc field of nodes that come from the source is set by the parser.
352 -- For internal nodes, and nodes generated during expansion the Sloc is
353 -- usually set in the call to the constructor for the node. In general the
354 -- Sloc value chosen for an internal node is the Sloc of the source node
355 -- whose processing is responsible for the expansion. For example, the Sloc
356 -- of an inherited primitive operation is the Sloc of the corresponding
357 -- derived type declaration.
359 -- For the nodes of a generic instantiation, the Sloc value is encoded to
360 -- represent both the original Sloc in the generic unit, and the Sloc of
361 -- the instantiation itself. See Sinput.ads for details.
363 -- Subprogram instances create two callable entities: one is the visible
364 -- subprogram instance, and the other is an anonymous subprogram nested
365 -- within a wrapper package that contains the renamings for the actuals.
366 -- Both of these entities have the Sloc of the defining entity in the
367 -- instantiation node. This simplified for instance in the past some ASIS
368 -- queries.
370 -----------------------
371 -- Field Definitions --
372 -----------------------
374 -- In the following node definitions, all fields, both syntactic and
375 -- semantic, are documented. The one exception is in the case of entities
376 -- (defining identifiers, character literals, and operator symbols), where
377 -- the usage of the fields depends on the entity kind. Entity fields are
378 -- fully documented in the separate package Einfo.
380 -- In the node definitions, three common sets of fields are abbreviated to
381 -- save both space in the documentation, and also space in the string
382 -- (defined in Tree_Print_Strings) used to print trees. The following
383 -- abbreviations are used:
385 -- "plus fields for binary operator"
386 -- Chars Name_Id for the operator
387 -- Left_Opnd left operand expression
388 -- Right_Opnd right operand expression
389 -- Entity defining entity for operator
390 -- Associated_Node for generic processing
391 -- Do_Overflow_Check set if overflow check needed
392 -- Has_Private_View set in generic units
393 -- Has_Secondary_Private_View set in generic units
395 -- "plus fields for unary operator"
396 -- Chars Name_Id for the operator
397 -- Right_Opnd right operand expression
398 -- Entity defining entity for operator
399 -- Associated_Node for generic processing
400 -- Do_Overflow_Check set if overflow check needed
401 -- Has_Private_View set in generic units
402 -- Has_Secondary_Private_View set in generic units
404 -- "plus fields for expression"
405 -- Paren_Count number of parentheses levels
406 -- Etype type of the expression
407 -- Is_Overloaded >1 type interpretation exists
408 -- Is_Static_Expression set for static expression
409 -- Raises_Constraint_Error evaluation raises CE
410 -- Must_Not_Freeze set if must not freeze
411 -- Do_Range_Check set if a range check needed
412 -- Has_Dynamic_Length_Check set if length check inserted
413 -- Assignment_OK set if modification is OK
414 -- Is_Controlling_Actual set for controlling argument
416 -- Note: see under (EXPRESSION) for further details on the use of
417 -- the Paren_Count field to record the number of parentheses levels.
419 -- Node_Kind is the type used in the Nkind field to indicate the node kind.
420 -- The actual definition of this type is given later (the reason for this
421 -- is that we want the descriptions ordered by logical chapter in the RM,
422 -- but the type definition is reordered to facilitate the definition of
423 -- some subtype ranges. The individual descriptions of the nodes show how
424 -- the various fields are used in each node kind, as well as providing
425 -- logical names for the fields. Functions and procedures are provided for
426 -- accessing and setting these fields using these logical names.
428 -----------------------
429 -- Gigi Restrictions --
430 -----------------------
432 -- The tree passed to Gigi is more restricted than the general tree form.
433 -- For example, as a result of expansion, most of the tasking nodes can
434 -- never appear. For each node to which either a complete or partial
435 -- restriction applies, a note entitled "Gigi restriction" appears which
436 -- documents the restriction.
438 -- Note that most of these restrictions apply only to trees generated when
439 -- code is being generated, since they involve expander actions that
440 -- destroy the tree.
442 ----------------
443 -- Ghost Mode --
444 ----------------
446 -- The SPARK RM 6.9 defines two classes of constructs - Ghost entities and
447 -- Ghost statements. The intent of the feature is to treat Ghost constructs
448 -- as non-existent when Ghost assertion policy Ignore is in effect.
450 -- The corresponding nodes which map to Ghost constructs are:
452 -- Ghost entities
453 -- Declaration nodes
454 -- N_Package_Body
455 -- N_Subprogram_Body
457 -- Ghost statements
458 -- N_Assignment_Statement
459 -- N_Procedure_Call_Statement
460 -- N_Pragma
462 -- In addition, the compiler treats instantiations as Ghost entities
464 -- To achieve the removal of ignored Ghost constructs, the compiler relies
465 -- on global variables Ghost_Mode and Ignored_Ghost_Region, which comprise
466 -- a mechanism called "Ghost regions".
468 -- The values of Ghost_Mode are as follows:
470 -- 1. Check - All static semantics as defined in SPARK RM 6.9 are in
471 -- effect. The Ghost region has mode Check.
473 -- 2. Ignore - Same as Check, ignored Ghost code is not present in ALI
474 -- files, object files, and the final executable. The Ghost region
475 -- has mode Ignore.
477 -- 3. None - No Ghost region is in effect
479 -- The value of Ignored_Ghost_Region captures the node which initiates an
480 -- ignored Ghost region.
482 -- A Ghost region is a compiler operating mode, similar to Check_Syntax,
483 -- however a region is much more finely grained and depends on the policy
484 -- in effect. The region starts prior to the analysis of a Ghost construct
485 -- and ends immediately after its expansion. The region is established as
486 -- follows:
488 -- 1. Declarations - Prior to analysis, if the declaration is subject to
489 -- pragma Ghost.
491 -- 2. Renaming declarations - Same as 1) or when the renamed entity is
492 -- Ghost.
494 -- 3. Completing declarations - Same as 1) or when the declaration is
495 -- partially analyzed and the declaration completes a Ghost entity.
497 -- 4. N_Package_Body, N_Subprogram_Body - Same as 1) or when the body is
498 -- partially analyzed and completes a Ghost entity.
500 -- 5. N_Assignment_Statement - After the left hand side is analyzed and
501 -- references a Ghost entity.
503 -- 6. N_Procedure_Call_Statement - After the name is analyzed and denotes
504 -- a Ghost procedure.
506 -- 7. N_Pragma - During analysis, when the related entity is Ghost or the
507 -- pragma encloses a Ghost entity.
509 -- 8. Instantiations - Save as 1) or when the instantiation is partially
510 -- analyzed and the generic template is Ghost.
512 -- The following routines install a new Ghost region:
514 -- Install_Ghost_Region
515 -- Mark_And_Set_Ghost_xxx
516 -- Set_Ghost_Mode
518 -- The following routine ends a Ghost region:
520 -- Restore_Ghost_Region
522 -- A region may be reinstalled similarly to scopes for decoupled expansion
523 -- such as the generation of dispatch tables or the creation of a predicate
524 -- function.
526 -- If the mode of a Ghost region is Ignore, any newly created nodes as well
527 -- as source entities are marked as ignored Ghost. In addition, the marking
528 -- process signals all enclosing scopes that an ignored Ghost node resides
529 -- within. The compilation unit where the node resides is also added to an
530 -- auxiliary table for post processing.
532 -- After the analysis and expansion of all compilation units takes place
533 -- as well as the instantiation of all inlined [generic] bodies, the GNAT
534 -- driver initiates a separate pass which removes all ignored Ghost nodes
535 -- from all units stored in the auxiliary table.
537 --------------------
538 -- GNATprove Mode --
539 --------------------
541 -- When a file is compiled in GNATprove mode (-gnatd.F), a very light
542 -- expansion is performed and the analysis must generate a tree in a
543 -- form that meets additional requirements.
545 -- This light expansion does two transformations of the tree that cannot
546 -- be postponed till after semantic analysis:
548 -- 1. Replace object renamings by renamed object. This requires the
549 -- introduction of temporaries at the point of the renaming, which
550 -- must be properly analyzed.
552 -- 2. Fully qualify entity names. This is needed to generate suitable
553 -- local effects and call-graphs in ALI files, with the completely
554 -- qualified names (in particular the suffix to distinguish homonyms).
556 -- The tree after this light expansion should be fully analyzed
557 -- semantically, which sometimes requires the insertion of semantic
558 -- preanalysis, for example for subprogram contracts and pragma
559 -- check/assert. In particular, all expressions must have their proper
560 -- type, and semantic links should be set between tree nodes (partial to
561 -- full view, etc.). Some kinds of nodes should be either absent, or can be
562 -- ignored by the formal verification backend:
564 -- N_Object_Renaming_Declaration: can be ignored safely
565 -- N_Expression_Function: absent (rewritten)
566 -- N_Expression_With_Actions: absent (not generated)
568 -- SPARK cross-references are generated from the regular cross-references
569 -- (used for browsing and code understanding) and additional references
570 -- collected during semantic analysis, in particular on all dereferences.
571 -- These SPARK cross-references are output in a separate section of ALI
572 -- files, as described in spark_xrefs.adb. They are the basis for the
573 -- computation of data dependences in GNATprove. This implies that all
574 -- cross-references should be generated in this mode, even those that would
575 -- not make sense from a user point-of-view, and that cross-references that
576 -- do not lead to data dependences for subprograms can be safely ignored.
578 -- GNATprove relies on the following front end behaviors:
580 -- 1. The first declarations in the list of visible declarations of
581 -- a package declaration for a generic instance, up to the first
582 -- declaration which comes from source, should correspond to
583 -- the "mappings nodes" between formal and actual generic parameters.
585 -- 2. In addition pragma Debug statements are removed from the tree
586 -- (rewritten to NULL stmt), since they should be ignored in formal
587 -- verification.
589 -- 3. An error is also issued for missing subunits, similar to the
590 -- warning issued when generating code, to avoid formal verification
591 -- of a partial unit.
593 -- 4. Unconstrained types are not replaced by constrained types whose
594 -- bounds are generated from an expression: Expand_Subtype_From_Expr
595 -- should be a no-op.
597 -- 5. Errors (instead of warnings) are issued on compile-time-known
598 -- constraint errors even though such cases do not correspond to
599 -- illegalities in the Ada RM (this is simply another case where
600 -- GNATprove implements a subset of the full language).
602 -- However, there are a few exceptions to this rule for cases where
603 -- we want to allow the GNATprove analysis to proceed (e.g. range
604 -- checks on empty ranges, which typically appear in deactivated
605 -- code in a particular configuration).
607 -- 6. Subtypes should match in the AST, even after a generic is
608 -- instantiated. In particular, GNATprove relies on the fact that,
609 -- on a selected component, the type of the selected component is
610 -- the type of the corresponding component in the prefix of the
611 -- selected component.
613 -- Note that, in some cases, we know that this rule is broken by the
614 -- frontend. In particular, if the selected component is a packed
615 -- array depending on a discriminant of a unconstrained formal object
616 -- parameter of a generic.
618 ----------------
619 -- SPARK Mode --
620 ----------------
622 -- The SPARK RM 1.6.5 defines a mode of operation called "SPARK mode" which
623 -- starts a scope where the SPARK language semantics are either On, Off, or
624 -- Auto, where Auto leaves the choice to the tools. A SPARK mode may be
625 -- specified by means of an aspect or a pragma.
627 -- The following entities may be subject to a SPARK mode. Entities marked
628 -- with * may possess two different SPARK modes.
630 -- E_Entry
631 -- E_Entry_Family
632 -- E_Function
633 -- E_Generic_Function
634 -- E_Generic_Package *
635 -- E_Generic_Procedure
636 -- E_Operator
637 -- E_Package *
638 -- E_Package_Body *
639 -- E_Procedure
640 -- E_Protected_Body
641 -- E_Protected_Subtype
642 -- E_Protected_Type *
643 -- E_Subprogram_Body
644 -- E_Task_Body
645 -- E_Task_Subtype
646 -- E_Task_Type *
647 -- E_Variable
649 -- In order to manage SPARK scopes, the compiler relies on global variables
650 -- SPARK_Mode and SPARK_Mode_Pragma and a mechanism called "SPARK regions."
651 -- Routines Install_SPARK_Mode and Set_SPARK_Mode create a new SPARK region
652 -- and routine Restore_SPARK_Mode ends a SPARK region. A region may be
653 -- reinstalled similarly to scopes.
655 -----------------------
656 -- Check Flag Fields --
657 -----------------------
659 -- The following flag fields appear in expression nodes:
661 -- Do_Division_Check
662 -- Do_Overflow_Check
663 -- Do_Range_Check
665 -- These three flags are always set by the front end during semantic
666 -- analysis, on expression nodes that may trigger the corresponding
667 -- check. The front end then inserts or not the check during expansion. In
668 -- particular, these flags should also be correctly set in GNATprove mode.
669 -- As a special case, the front end does not insert a Do_Division_Check
670 -- flag on float exponentiation expressions, for the case where the value
671 -- is 0.0 and the exponent is negative, although this case does lead to a
672 -- division check failure. As another special case, the front end does not
673 -- insert a Do_Range_Check on an allocator where the designated type is
674 -- scalar, and the designated type is more constrained than the type of the
675 -- initialized allocator value or the type of the default value for an
676 -- uninitialized allocator.
678 -- Note that the expander always takes care of the Do_Range_Check case, so
679 -- this flag will never be set in the expanded tree passed to the back end.
680 -- For the other two flags, the check can be generated either by the back
681 -- end or by the front end, depending on the setting of a target parameter.
683 -- Note that this accounts for all nodes that trigger the corresponding
684 -- checks, except for range checks on subtype_indications, which may be
685 -- required to check that a range_constraint is compatible with the given
686 -- subtype (RM 3.2.2(11)).
688 -- The following flag fields appear in various nodes:
690 -- Do_Discriminant_Check
691 -- Do_Length_Check
692 -- Do_Storage_Check
694 -- These flags are used in some specific cases by the front end, either
695 -- during semantic analysis or during expansion, and cannot be expected
696 -- to be set on all nodes that trigger the corresponding check.
698 ------------------------
699 -- Common Flag Fields --
700 ------------------------
702 -- The following flag fields appear in all nodes:
704 -- Analyzed
705 -- This flag is used to indicate that a node (and all its children) have
706 -- been analyzed. It is used to avoid reanalysis of a node that has
707 -- already been analyzed, both for efficiency and functional correctness
708 -- reasons.
710 -- Comes_From_Source
711 -- This flag is set if the node comes directly from an explicit construct
712 -- in the source. It is normally on for any nodes built by the scanner or
713 -- parser from the source program, with the exception that in a few cases
714 -- the parser adds nodes to normalize the representation (in particular,
715 -- a null statement is added to a package body if there is no begin/end
716 -- initialization section).
718 -- Most nodes inserted by the analyzer or expander are not considered
719 -- as coming from source, so the flag is off for such nodes. In a few
720 -- cases, the expander constructs nodes closely equivalent to nodes
721 -- from the source program (e.g. the allocator built for build-in-place
722 -- case), and the Comes_From_Source flag is deliberately set.
724 -- Error_Posted
725 -- This flag is used to avoid multiple error messages being posted on or
726 -- referring to the same node. This flag is set if an error message
727 -- refers to a node or is posted on its source location, and has the
728 -- effect of inhibiting further messages involving this same node.
730 -----------------------
731 -- Modify_Tree_For_C --
732 -----------------------
734 -- If the flag Opt.Modify_Tree_For_C is set True, then the tree is modified
735 -- in ways that help match the semantics better with C, easing the task of
736 -- interfacing to C code generators (other than GCC, where the work is done
737 -- in gigi, and there is no point in changing that), and also making life
738 -- easier for Cprint in generating C source code.
740 -- The current modifications implemented are as follows:
742 -- N_Op_Rotate_Left, N_Op_Rotate_Right, N_Shift_Right_Arithmetic nodes
743 -- are eliminated from the tree (since these operations do not exist in
744 -- C), and the operations are rewritten in terms of logical shifts and
745 -- other logical operations that do exist in C. See Exp_Ch4 expansion
746 -- routines for these operators for details of the transformations made.
748 -- The right operand of N_Op_Shift_Right and N_Op_Shift_Left is always
749 -- less than the word size (since other values are not well-defined in
750 -- C). This is done using an explicit test if necessary.
752 -- Min and Max attributes are expanded into equivalent if expressions,
753 -- dealing properly with side effect issues.
755 -- Mod for signed integer types is expanded into equivalent expressions
756 -- using Rem (which is % in C) and other C-available operators.
758 -- Functions returning bounded arrays are transformed into procedures
759 -- with an extra out parameter, and the calls updated accordingly.
761 -- Aggregates are only kept unexpanded for object declarations, otherwise
762 -- they are systematically expanded into loops (for arrays) and
763 -- individual assignments (for records).
765 -- Unconstrained array types are handled by means of fat pointers.
767 -- Postconditions are inlined by the frontend since their body may have
768 -- references to itypes defined in the enclosing subprogram.
770 ------------------------------------
771 -- Description of Semantic Fields --
772 ------------------------------------
774 -- The meaning of the syntactic fields is generally clear from their names
775 -- without any further description, since the names are chosen to
776 -- correspond very closely to the syntax in the reference manual. This
777 -- section describes the usage of the semantic fields, which are used to
778 -- contain additional information determined during semantic analysis.
780 -- Accept_Handler_Records
781 -- This field is present only in an N_Accept_Alternative node. It is used
782 -- to temporarily hold the exception handler records from an accept
783 -- statement in a selective accept. These exception handlers will
784 -- eventually be placed in the Handler_Records list of the procedure
785 -- built for this accept (see Expand_N_Selective_Accept procedure in
786 -- Exp_Ch9 for further details).
788 -- Access_Types_To_Process
789 -- Present in N_Freeze_Entity nodes for Incomplete or private types.
790 -- Contains the list of access types which may require specific treatment
791 -- when the nature of the type completion is completely known. An example
792 -- of such treatment is the generation of the associated_final_chain.
794 -- Actions
795 -- This field contains a sequence of actions that are associated with the
796 -- node holding the field. See the individual node types for details of
797 -- how this field is used, as well as the description of the specific use
798 -- for a particular node type.
800 -- Activation_Chain_Entity
801 -- This is used in tree nodes representing task activators (blocks,
802 -- subprogram bodies, package declarations, and task bodies). It is
803 -- initially Empty, and then gets set to point to the entity for the
804 -- declared Activation_Chain variable when the first task is declared.
805 -- When tasks are declared in the corresponding declarative region this
806 -- entity is located by name (its name is always _Chain) and the declared
807 -- tasks are added to the chain. Note that N_Extended_Return_Statement
808 -- does not have this attribute, although it does have an activation
809 -- chain. This chain is used to store the tasks temporarily, and is not
810 -- used for activating them. On successful completion of the return
811 -- statement, the tasks are moved to the caller's chain, and the caller
812 -- activates them.
814 -- Acts_As_Spec
815 -- A flag set in the N_Subprogram_Body node for a subprogram body which
816 -- is acting as its own spec. In the case of a library-level subprogram
817 -- the flag is set as well on the parent compilation unit node.
819 -- Actual_Designated_Subtype
820 -- Present in N_Free_Statement and N_Explicit_Dereference nodes. If gigi
821 -- needs to know the dynamic constrained subtype of the designated
822 -- object, this attribute is set to that subtype. This is done for
823 -- N_Free_Statements for access-to-classwide types and access-to-
824 -- unconstrained packed array types. For N_Explicit_Dereference,
825 -- this is done in two circumstances: 1) when the designated type is
826 -- an unconstrained packed array and the dereference is the prefix of
827 -- a 'Size attribute reference, or 2) when the dereference node is
828 -- created for the expansion of an allocator with a subtype_indication
829 -- and the designated subtype is an unconstrained composite type.
831 -- Address_Warning_Posted
832 -- Present in N_Attribute_Definition nodes. Set to indicate that we have
833 -- posted a warning for the address clause regarding size or alignment
834 -- issues. Used to inhibit multiple redundant messages.
836 -- Aggregate_Bounds
837 -- Present in array N_Aggregate nodes. If the bounds of the aggregate are
838 -- known at compile time, this field points to an N_Range node with those
839 -- bounds. Otherwise Empty.
841 -- All_Others
842 -- Present in an N_Others_Choice node. This flag is set for an others
843 -- exception where all exceptions are to be caught, even those that are
844 -- not normally handled (in particular the tasking abort signal). This
845 -- is used for translation of the at end handler into a normal exception
846 -- handler.
848 -- Ancestor_Type
849 -- Present in record N_Aggregate nodes. Used to store the first global
850 -- ancestor of the type of the aggregate in a generic context, if any,
851 -- when the type is a derived tagged type. Otherwise Empty.
853 -- Aspect_On_Partial_View
854 -- Present on an N_Aspect_Specification node. For an aspect that applies
855 -- to a type entity, indicates whether the specification appears on the
856 -- partial view of a private type or extension. Undefined for aspects
857 -- that apply to other entities.
859 -- Aspect_Rep_Item
860 -- Present in N_Aspect_Specification nodes. Points to the corresponding
861 -- pragma/attribute definition node used to process the aspect.
863 -- Assignment_OK
864 -- This flag is set in a subexpression node for an object, indicating
865 -- that the associated object can be modified, even if this would not
866 -- normally be permissible (either by direct assignment, or by being
867 -- passed as an out or in-out parameter). This is used by the expander
868 -- for a number of purposes, including initialization of constants and
869 -- limited type objects (such as tasks), setting discriminant fields,
870 -- setting tag values, etc. N_Object_Declaration nodes also have this
871 -- flag defined. Here it is used to indicate that an initialization
872 -- expression is valid, even where it would normally not be allowed
873 -- (e.g. where the type involved is limited). It is also used to stop
874 -- a Force_Evaluation call for an unchecked conversion, but this usage
875 -- is unclear and not documented ???
877 -- Associated_Node
878 -- Present in nodes that can denote an entity: identifiers, character
879 -- literals, operator symbols, expanded names, operator nodes, and
880 -- attribute reference nodes (all these nodes have an Entity field).
881 -- This field is also present in N_Aggregate, N_Selected_Component, and
882 -- N_Extension_Aggregate nodes. This field is used in generic processing
883 -- to create links between the generic template and the generic copy.
884 -- See Sem_Ch12.Get_Associated_Node for full details. Note that this
885 -- field overlaps Entity, which is fine, since, as explained in Sem_Ch12,
886 -- the normal function of Entity is not required at the point where the
887 -- Associated_Node is set. Note also, that in generic templates, this
888 -- means that the Entity field does not necessarily point to an Entity.
889 -- Since the back end is expected to ignore generic templates, this is
890 -- harmless.
892 -- Atomic_Sync_Required
893 -- This flag is set on a node for which atomic synchronization is
894 -- required for the corresponding reference or modification.
896 -- At_End_Proc
897 -- This field is present in N_Handled_Sequence_Of_Statements,
898 -- N_Package_Body, N_Subprogram_Body, N_Task_Body, N_Block_Statement,
899 -- and N_Entry_Body.
900 -- It contains an identifier reference for the cleanup procedure to be
901 -- called. See description of N_Handled_Sequence_Of_Statements node
902 -- for further details.
904 -- Backwards_OK
905 -- A flag present in the N_Assignment_Statement node. It is used only
906 -- if the type being assigned is an array type, and is set if analysis
907 -- determines that it is definitely safe to do the copy backwards, i.e.
908 -- starting at the highest addressed element. This is the case if either
909 -- the operands do not overlap, or they may overlap, but if they do,
910 -- then the left operand is at a higher address than the right operand.
912 -- Note: If neither of the flags Forwards_OK or Backwards_OK is set, it
913 -- means that the front end could not determine that either direction is
914 -- definitely safe, and a runtime check may be required if the backend
915 -- cannot figure it out. If both flags Forwards_OK and Backwards_OK are
916 -- set, it means that the front end can assure no overlap of operands.
918 -- Body_To_Inline
919 -- Present in subprogram declarations. Denotes analyzed but unexpanded
920 -- body of subprogram, to be used when inlining calls. Present when the
921 -- subprogram has an Inline pragma and inlining is enabled. If the
922 -- declaration is completed by a renaming_as_body, and the renamed entity
923 -- is a subprogram, the Body_To_Inline is the name of that entity, which
924 -- is used directly in later calls to the original subprogram.
926 -- Body_Required
927 -- A flag that appears in the N_Compilation_Unit node indicating that
928 -- the corresponding unit requires a body. For the package case, this
929 -- indicates that a completion is required. In Ada 95, if the flag is not
930 -- set for the package case, then a body may not be present. In Ada 83,
931 -- if the flag is not set for the package case, then body is optional.
932 -- For a subprogram declaration, the flag is set except in the case where
933 -- a pragma Import or Interface applies, in which case no body is
934 -- permitted (in Ada 83 or Ada 95).
936 -- Cannot_Be_Superflat
937 -- This flag is present in N_Range nodes. It is set if the range is of a
938 -- discrete type and cannot be superflat, i.e. it is guaranteed that the
939 -- inequality High_Bound >= Low_Bound - 1 is true. At the time of this
940 -- writing, it is only used by the code generator to streamline things.
942 -- Cleanup_Actions
943 -- Present in block statements created for transient blocks, contains
944 -- additional cleanup actions carried over from the transient scope.
946 -- Check_Address_Alignment
947 -- A flag present in N_Attribute_Definition clause for a 'Address
948 -- attribute definition. This flag is set if a dynamic check should be
949 -- generated at the freeze point for the entity to which this address
950 -- clause applies. The reason that we need this flag is that we want to
951 -- check for range checks being suppressed at the point where the
952 -- attribute definition clause is given, rather than testing this at the
953 -- freeze point.
955 -- Comes_From_Check_Or_Contract
956 -- This flag is present in all N_If_Statement nodes and
957 -- gets set when an N_If_Statement is generated as part of
958 -- the expansion of a Check, Assert, or contract-related
959 -- pragma.
961 -- Comes_From_Extended_Return_Statement
962 -- Present in N_Simple_Return_Statement nodes. True if this node was
963 -- constructed as part of the N_Extended_Return_Statement expansion.
965 -- Comes_From_Iterator
966 -- Present in N_Object_Renaming_Declaration nodes. True if this node was
967 -- was constructed as part of the expansion of an iterator
968 -- specification.
970 -- Compare_Type
971 -- Present in N_Op_Compare nodes. Set during resolution to the type of
972 -- the operands. It is used to propagate the type of the operands from
973 -- a N_Op_Compare node in a generic construct to the nodes created from
974 -- it in the various instances, when this type is global to the generic
975 -- construct. Resolution for global types cannot be redone in instances
976 -- because the instantiation can be done out of context, e.g. for bodies,
977 -- and the visibility of global types is incorrect in this case; that is
978 -- why the result of the resolution done in the generic construct needs
979 -- to be available in the instances but, unlike for arithmetic operators,
980 -- the Etype cannot be used to that effect for comparison operators. It
981 -- is also used as the type subject to the Has_Private_View processing on
982 -- the nodes instead of the Etype.
984 -- Compile_Time_Known_Aggregate
985 -- Present in N_Aggregate nodes. Set for aggregates which can be fully
986 -- evaluated at compile time without raising constraint error. Such
987 -- aggregates can be passed as is to the back end without any expansion.
988 -- See Exp_Aggr for specific conditions under which this flag gets set.
990 -- Componentwise_Assignment
991 -- Present in N_Assignment_Statement nodes. Set for a record assignment
992 -- where all that needs doing is to expand it into component-by-component
993 -- assignments. This is used internally for the case of tagged types with
994 -- rep clauses, where we need to avoid recursion (we don't want to try to
995 -- generate a call to the primitive operation, because this is the case
996 -- where we are compiling the primitive operation). Note that when we are
997 -- expanding component assignments in this case, we never assign the _tag
998 -- field, but we recursively assign components of the parent type.
1000 -- Condition_Actions
1001 -- This field appears in else-if nodes and in the iteration scheme node
1002 -- for while loops. This field is only used during semantic processing to
1003 -- temporarily hold actions inserted into the tree. In the tree passed
1004 -- to gigi, the condition actions field is always set to No_List. For
1005 -- details on how this field is used, see the routine Insert_Actions in
1006 -- package Exp_Util, and also the expansion routines for the relevant
1007 -- nodes.
1009 -- Context_Pending
1010 -- This field appears in Compilation_Unit nodes, to indicate that the
1011 -- context of the unit is being compiled. Used to detect circularities
1012 -- that are not otherwise detected by the loading mechanism. Such
1013 -- circularities can occur in the presence of limited and non-limited
1014 -- with_clauses that mention the same units.
1016 -- Controlling_Argument
1017 -- This field is set in procedure and function call nodes if the call
1018 -- is a dispatching call (it is Empty for a non-dispatching call). It
1019 -- indicates the source of the call's controlling tag. For procedure
1020 -- calls, the Controlling_Argument is one of the actuals. For function
1021 -- that has a dispatching result, it is an entity in the context of the
1022 -- call that can provide a tag, or else it is the tag of the root type
1023 -- of the class. It can also specify a tag directly rather than being a
1024 -- tagged object. The latter is needed by the implementations of AI-239
1025 -- and AI-260.
1027 -- Conversion_OK
1028 -- A flag set on type conversion nodes to indicate that the conversion
1029 -- is to be considered as being valid, even though it is the case that
1030 -- the conversion is not valid Ada. This is used for attributes Enum_Rep,
1031 -- Pos, Val, Fixed_Value and Integer_Value, for internal conversions done
1032 -- for fixed-point operations, and for certain conversions for calls to
1033 -- initialization procedures. If Conversion_OK is set, then Etype must be
1034 -- set (the analyzer assumes that Etype has been set). For the case of
1035 -- fixed-point operands, it also indicates that the conversion is to be
1036 -- direct conversion of the underlying integer result, with no regard to
1037 -- the small operand.
1039 -- Corresponding_Aspect
1040 -- Present in N_Pragma node. Used to point back to the source aspect from
1041 -- the corresponding pragma. This field is Empty for source pragmas.
1043 -- Corresponding_Body
1044 -- This field is set in subprogram declarations, package declarations,
1045 -- entry declarations of protected types, and in generic units. It points
1046 -- to the defining entity for the corresponding body (NOT the node for
1047 -- the body itself).
1049 -- Corresponding_Entry_Body
1050 -- Defined in N_Subprogram_Body. Set for subprogram bodies that implement
1051 -- a protected type entry; points to the body for the entry.
1053 -- Corresponding_Formal_Spec
1054 -- This field is set in subprogram renaming declarations, where it points
1055 -- to the defining entity for a formal subprogram in the case where the
1056 -- renaming corresponds to a generic formal subprogram association in an
1057 -- instantiation. The field is Empty if the renaming does not correspond
1058 -- to such a formal association.
1060 -- Corresponding_Generic_Association
1061 -- This field is defined for object declarations and object renaming
1062 -- declarations. It is set for the declarations within an instance that
1063 -- map generic formals to their actuals. If set, the field points either
1064 -- to a copy of a default expression for an actual of mode IN or to a
1065 -- generic_association which is the original parent of the expression or
1066 -- name appearing in the declaration. This simplifies GNATprove queries.
1068 -- Corresponding_Integer_Value
1069 -- This field is set in real literals of fixed-point types (it is not
1070 -- used for floating-point types). It contains the integer value used
1071 -- to represent the fixed-point value. It is also set on the universal
1072 -- real literals used to represent bounds of fixed-point base types
1073 -- and their first named subtypes.
1075 -- Corresponding_Spec
1076 -- This field is set in subprogram, package, task, entry and protected
1077 -- body nodes where it points to the defining entity in the corresponding
1078 -- spec. The attribute is also set in N_With_Clause nodes where it points
1079 -- to the defining entity for the with'ed spec, and in a subprogram
1080 -- renaming declaration when it is a Renaming_As_Body. The field is Empty
1081 -- if there is no corresponding spec, as in the case of a subprogram body
1082 -- that serves as its own spec.
1084 -- In Ada 2012, Corresponding_Spec is set on expression functions that
1085 -- complete a subprogram declaration.
1087 -- Corresponding_Spec_Of_Stub
1088 -- This field is present in subprogram, package, task, and protected body
1089 -- stubs where it points to the corresponding spec of the stub. Due to
1090 -- clashes in the structure of nodes, we cannot use Corresponding_Spec.
1092 -- Corresponding_Stub
1093 -- This field is present in an N_Subunit node. It holds the node in
1094 -- the parent unit that is the stub declaration for the subunit. It is
1095 -- set when analysis of the stub forces loading of the proper body. If
1096 -- expansion of the proper body creates new declarative nodes, they are
1097 -- inserted at the point of the corresponding_stub.
1099 -- Dcheck_Function
1100 -- This field is present in an N_Variant node, It references the entity
1101 -- for the discriminant checking function for the variant.
1103 -- Default_Expression
1104 -- This field is Empty if there is no default expression. If there is a
1105 -- simple default expression (one with no side effects), then this field
1106 -- simply contains a copy of the Expression field (both point to the tree
1107 -- for the default expression). Default_Expression is used for
1108 -- conformance checking.
1110 -- Default_Storage_Pool
1111 -- This field is present in N_Compilation_Unit_Aux nodes. It is set to a
1112 -- copy of Opt.Default_Pool at the end of the compilation unit. See
1113 -- package Opt for details. This is used for inheriting the
1114 -- Default_Storage_Pool in child units.
1116 -- Discr_Check_Funcs_Built
1117 -- This flag is present in N_Full_Type_Declaration nodes. It is set when
1118 -- discriminant checking functions are constructed. The purpose is to
1119 -- avoid attempting to set these functions more than once.
1121 -- Do_Discriminant_Check
1122 -- This flag is set on N_Selected_Component nodes to indicate that a
1123 -- discriminant check is required using the discriminant check routine
1124 -- associated with the selector. The actual check is generated by the
1125 -- expander when processing selected components. In the case of
1126 -- Unchecked_Union, the flag is also set, but no discriminant check
1127 -- routine is associated with the selector, and the expander does not
1128 -- generate a check. This flag is also present in assignment statements
1129 -- (and set if the assignment requires a discriminant check), and in type
1130 -- conversion nodes (and set if the conversion requires a check).
1132 -- Do_Division_Check
1133 -- This flag is set on a division operator (/ mod rem) to indicate that
1134 -- a zero divide check is required. The actual check is either dealt with
1135 -- by the back end if Backend_Divide_Checks is set to true, or by the
1136 -- front end itself if it is set to false.
1138 -- Do_Length_Check
1139 -- This flag is set in an N_Assignment_Statement, N_Op_And, N_Op_Or,
1140 -- N_Op_Xor, or N_Type_Conversion node to indicate that a length check
1141 -- is required. It is not determined who deals with this flag (???).
1143 -- Do_Overflow_Check
1144 -- This flag is set on an operator where an overflow check is required on
1145 -- the operation. The actual check is either dealt with by the back end
1146 -- if Backend_Overflow_Checks is set to true, or by the front end itself
1147 -- if it is set to false. The other cases where this flag is used is on a
1148 -- Type_Conversion node as well on if and case expression nodes.
1149 -- For a type conversion, it means that the conversion is from one base
1150 -- type to another, and the value may not fit in the target base type.
1151 -- See also the description of Do_Range_Check for this case. This flag is
1152 -- also set on if and case expression nodes if we are operating in either
1153 -- MINIMIZED or ELIMINATED overflow checking mode (to make sure that we
1154 -- properly process overflow checking for dependent expressions).
1156 -- Do_Range_Check
1157 -- This flag is set on an expression which appears in a context where a
1158 -- range check is required. The target type is clear from the context.
1159 -- The contexts in which this flag can appear are the following:
1161 -- Right side of an assignment. In this case the target type is taken
1162 -- from the left side of the assignment, which is referenced by the
1163 -- Name of the N_Assignment_Statement node.
1165 -- Subscript expressions in an indexed component. In this case the
1166 -- target type is determined from the type of the array, which is
1167 -- referenced by the Prefix of the N_Indexed_Component node.
1169 -- Argument expression for a parameter, appearing either directly in
1170 -- the Parameter_Associations list of a call or as the Expression of an
1171 -- N_Parameter_Association node that appears in this list. In either
1172 -- case, the check is against the type of the formal. Note that the
1173 -- flag is relevant only in IN and IN OUT parameters, and will be
1174 -- ignored for OUT parameters, where no check is required in the call,
1175 -- and if a check is required on the return, it is generated explicitly
1176 -- with a type conversion.
1178 -- Initialization expression for the initial value in an object
1179 -- declaration. In this case the Do_Range_Check flag is set on
1180 -- the initialization expression, and the check is against the
1181 -- range of the type of the object being declared. This includes the
1182 -- cases of expressions providing default discriminant values, and
1183 -- expressions used to initialize record components.
1185 -- The expression of a type conversion. In this case the range check is
1186 -- against the target type of the conversion. See also the use of
1187 -- Do_Overflow_Check on a type conversion. The distinction is that the
1188 -- overflow check protects against a value that is outside the range of
1189 -- the target base type, whereas a range check checks that the
1190 -- resulting value (which is a value of the base type of the target
1191 -- type), satisfies the range constraint of the target type.
1193 -- Note: when a range check is required in contexts other than those
1194 -- listed above (e.g. in a return statement), an additional type
1195 -- conversion node is introduced to represent the required check.
1197 -- Do_Storage_Check
1198 -- This flag is set in an N_Allocator node to indicate that a storage
1199 -- check is required for the allocation, or in an N_Subprogram_Body node
1200 -- to indicate that a stack check is required in the subprogram prologue.
1201 -- The N_Allocator case is handled by the routine that expands the call
1202 -- to the runtime routine. The N_Subprogram_Body case is handled by the
1203 -- backend, and all the semantics does is set the flag.
1205 -- Elaborate_Present
1206 -- This flag is set in the N_With_Clause node to indicate that pragma
1207 -- Elaborate pragma appears for the with'ed units.
1209 -- Elaborate_All_Desirable
1210 -- This flag is set in the N_With_Clause mode to indicate that the static
1211 -- elaboration processing has determined that an Elaborate_All pragma is
1212 -- desirable for correct elaboration for this unit.
1214 -- Elaborate_All_Present
1215 -- This flag is set in the N_With_Clause node to indicate that a
1216 -- pragma Elaborate_All pragma appears for the with'ed units.
1218 -- Elaborate_Desirable
1219 -- This flag is set in the N_With_Clause mode to indicate that the static
1220 -- elaboration processing has determined that an Elaborate pragma is
1221 -- desirable for correct elaboration for this unit.
1223 -- Else_Actions
1224 -- This field is present in if expression nodes. During code
1225 -- expansion we use the Insert_Actions procedure (in Exp_Util) to insert
1226 -- actions at an appropriate place in the tree to get elaborated at the
1227 -- right time. For if expressions, we have to be sure that the actions
1228 -- for the Else branch are only elaborated if the condition is False.
1229 -- The Else_Actions field is used as a temporary parking place for
1230 -- these actions. The final tree is always rewritten to eliminate the
1231 -- need for this field, so in the tree passed to Gigi, this field is
1232 -- always set to No_List.
1234 -- Enclosing_Variant
1235 -- This field is present in the N_Variant node and identifies the Node_Id
1236 -- corresponding to the immediately enclosing variant when the variant is
1237 -- nested, and N_Empty otherwise. Set during semantic processing of the
1238 -- variant part of a record type.
1240 -- Entity
1241 -- Appears in all direct names (identifiers, character literals, and
1242 -- operator symbols), as well as expanded names, and attributes that
1243 -- denote entities, such as 'Class. Points to entity for corresponding
1244 -- defining occurrence. Set after name resolution. For identifiers in a
1245 -- WITH list, the corresponding defining occurrence is in a separately
1246 -- compiled file, and Entity must be set by the library Load procedure.
1248 -- Note: During name resolution, the value in Entity may be temporarily
1249 -- incorrect (e.g. during overload resolution, Entity is initially set to
1250 -- the first possible correct interpretation, and then later modified if
1251 -- necessary to contain the correct value after resolution).
1253 -- Note: This field overlaps Associated_Node, which is used during
1254 -- generic processing (see Sem_Ch12 for details). Note also that in
1255 -- generic templates, this means that the Entity field does not always
1256 -- point to an Entity. Since the back end is expected to ignore generic
1257 -- templates, this is harmless.
1259 -- Note: This field also appears in N_Attribute_Definition_Clause nodes.
1260 -- It is used only for stream attributes definition clauses. In this
1261 -- case, it denotes a (possibly dummy) subprogram entity that is declared
1262 -- conceptually at the point of the clause. Thus the visibility of the
1263 -- attribute definition clause (in the sense of 8.3(23) as amended by
1264 -- AI-195) can be checked by testing the visibility of that subprogram.
1266 -- Note: Normally the Entity field of an identifier points to the entity
1267 -- for the corresponding defining identifier, and hence the Chars field
1268 -- of an identifier will match the Chars field of the entity. However,
1269 -- there is no requirement that these match, and there are obscure cases
1270 -- of generated code where they do not match.
1272 -- Note: Ada 2012 aspect specifications require additional links between
1273 -- identifiers and various attributes. These attributes can be of
1274 -- arbitrary types, and the entity field of identifiers that denote
1275 -- aspects must be used to store arbitrary expressions for later semantic
1276 -- checks. See section on aspect specifications for details.
1278 -- Entity_Or_Associated_Node
1279 -- A synonym for both Entity and Associated_Node. Used by convention in
1280 -- the code when referencing this field in cases where it is not known
1281 -- whether the field contains an Entity or an Associated_Node.
1283 -- Etype
1284 -- Appears in all expression nodes, all direct names, and all entities.
1285 -- Points to the entity for the related type. Set after type resolution.
1286 -- Normally this is the actual subtype of the expression. However, in
1287 -- certain contexts such as the right side of an assignment, subscripts,
1288 -- arguments to calls, returned value in a function, initial value etc.
1289 -- it is the desired target type. In the event that this is different
1290 -- from the actual type, the Do_Range_Check flag will be set if a range
1291 -- check is required. Note: if the Is_Overloaded flag is set, then Etype
1292 -- points to an essentially arbitrary choice from the possible set of
1293 -- types.
1295 -- Exception_Junk
1296 -- This flag is set in a various nodes appearing in a statement sequence
1297 -- to indicate that the corresponding node is an artifact of the
1298 -- generated code for exception handling, and should be ignored when
1299 -- analyzing the control flow of the relevant sequence of statements
1300 -- (e.g. to check that it does not end with a bad return statement).
1302 -- Exception_Label
1303 -- Appears in N_Push_xxx_Label nodes. Points to the entity of the label
1304 -- to be used for transforming the corresponding exception into a goto,
1305 -- or contains Empty, if this exception is not to be transformed. Also
1306 -- appears in N_Exception_Handler nodes, where, if set, it indicates
1307 -- that there may be a local raise for the handler, so that expansion
1308 -- to allow a goto is required (and this field contains the label for
1309 -- this goto). See Exp_Ch11.Expand_Local_Exception_Handlers for details.
1311 -- Expansion_Delayed
1312 -- Set on aggregates and extension aggregates that need a top-down rather
1313 -- than bottom-up expansion. Typically aggregate expansion happens bottom
1314 -- up. For nested aggregates the expansion is delayed until the enclosing
1315 -- aggregate itself is expanded, e.g. in the context of a declaration. To
1316 -- delay it we set this flag. This is done to avoid creating a temporary
1317 -- for each level of a nested aggregate, and also to prevent the
1318 -- premature generation of constraint checks. This is also a requirement
1319 -- if we want to generate the proper attachment to the internal
1320 -- finalization lists (for record with controlled components). Top down
1321 -- expansion of aggregates is also used for in-place array aggregate
1322 -- assignment or initialization. When the full context is known, the
1323 -- target of the assignment or initialization is used to generate the
1324 -- left-hand side of individual assignment to each subcomponent.
1326 -- Expression_Copy
1327 -- Present in N_Pragma_Argument_Association nodes. Contains a copy of the
1328 -- original expression. This field is best used to store pragma-dependent
1329 -- modifications performed on the original expression such as replacement
1330 -- of the current type instance or substitutions of primitives.
1332 -- First_Inlined_Subprogram
1333 -- Present in the N_Compilation_Unit node for the main program. Points
1334 -- to a chain of entities for subprograms that are to be inlined. The
1335 -- Next_Inlined_Subprogram field of these entities is used as a link
1336 -- pointer with Empty marking the end of the list. This field is Empty
1337 -- if there are no inlined subprograms or inlining is not active.
1339 -- First_Named_Actual
1340 -- Present in procedure call statement and function call nodes, and also
1341 -- in Intrinsic nodes. Set during semantic analysis to point to the first
1342 -- named parameter where parameters are ordered by declaration order (as
1343 -- opposed to the actual order in the call which may be different due to
1344 -- named associations). Note: this field points to the explicit actual
1345 -- parameter itself, not the N_Parameter_Association node (its parent).
1347 -- First_Subtype_Link
1348 -- Present in N_Freeze_Entity node for an anonymous base type that is
1349 -- implicitly created by the declaration of a first subtype. It points
1350 -- to the entity for the first subtype.
1352 -- Float_Truncate
1353 -- A flag present in type conversion nodes. It is used for floating-point
1354 -- to fixed-point or integer conversions, where truncation is required
1355 -- rather than rounding.
1357 -- Forwards_OK
1358 -- A flag present in the N_Assignment_Statement node. It is used only
1359 -- if the type being assigned is an array type, and is set if analysis
1360 -- determines that it is definitely safe to do the copy forwards, i.e.
1361 -- starting at the lowest addressed element. This is the case if either
1362 -- the operands do not overlap, or they may overlap, but if they do,
1363 -- then the left operand is at a lower address than the right operand.
1365 -- Note: If neither of the flags Forwards_OK or Backwards_OK is set, it
1366 -- means that the front end could not determine that either direction is
1367 -- definitely safe, and a runtime check may be required if the backend
1368 -- cannot figure it out. If both flags Forwards_OK and Backwards_OK are
1369 -- set, it means that the front end can assure no overlap of operands.
1371 -- For_Special_Return_Object
1372 -- Present in N_Allocator nodes. True if the allocator is generated for
1373 -- the initialization of a special return object.
1375 -- From_Aspect_Specification
1376 -- Processing of aspect specifications typically results in insertion in
1377 -- the tree of corresponding pragma or attribute definition clause nodes.
1378 -- These generated nodes have the From_Aspect_Specification flag set to
1379 -- indicate that they came from aspect specifications originally.
1381 -- From_At_Mod
1382 -- This flag is set on the attribute definition clause node that is
1383 -- generated by a transformation of an at mod phrase in a record
1384 -- representation clause. This is used to give slightly different (Ada 83
1385 -- compatible) semantics to such a clause, namely it is used to specify a
1386 -- minimum acceptable alignment for the base type and all subtypes. In
1387 -- Ada 95 terms, the actual alignment of the base type and all subtypes
1388 -- must be a multiple of the given value, and the representation clause
1389 -- is considered to be type specific instead of subtype specific.
1391 -- From_Conditional_Expression
1392 -- This flag is set on if and case statements generated by the expansion
1393 -- of if and case expressions respectively. The flag is used to suppress
1394 -- any finalization of controlled objects found within these statements.
1396 -- From_Default
1397 -- This flag is set on the subprogram renaming declaration created in an
1398 -- instance for a formal subprogram, when the formal is declared with a
1399 -- box, and there is no explicit actual. If the flag is present, the
1400 -- declaration is treated as an implicit reference to the formal in the
1401 -- ali file.
1403 -- Generalized_Indexing
1404 -- Present in N_Indexed_Component nodes. Set for Indexed_Component nodes
1405 -- that are Ada 2012 container indexing operations. The value of the
1406 -- attribute is a function call (possibly dereferenced) that corresponds
1407 -- to the proper expansion of the source indexing operation. Before
1408 -- expansion, the source node is rewritten as the resolved generalized
1409 -- indexing.
1411 -- Generic_Parent
1412 -- Generic_Parent is defined on declaration nodes that are instances. The
1413 -- value of Generic_Parent is the generic entity from which the instance
1414 -- is obtained.
1416 -- Generic_Parent_Type
1417 -- Generic_Parent_Type is defined on Subtype_Declaration nodes for the
1418 -- actuals of formal private and derived types. Within the instance, the
1419 -- operations on the actual are those inherited from the parent. For a
1420 -- formal private type, the parent type is the generic type itself. The
1421 -- Generic_Parent_Type is also used in an instance to determine whether a
1422 -- private operation overrides an inherited one.
1424 -- Handler_List_Entry
1425 -- This field is present in N_Object_Declaration nodes. It is set only
1426 -- for the Handler_Record entry generated for an exception in zero cost
1427 -- exception handling mode. It references the corresponding item in the
1428 -- handler list, and is used to delete this entry if the corresponding
1429 -- handler is deleted during optimization. For further details on why
1430 -- this is required, see Exp_Ch11.Remove_Handler_Entries.
1432 -- Has_Dereference_Action
1433 -- This flag is present in N_Explicit_Dereference nodes. It is set to
1434 -- indicate that the expansion has aready produced a call to primitive
1435 -- Dereference of a System.Checked_Pools.Checked_Pool implementation.
1436 -- Such dereference actions are produced for debugging purposes.
1438 -- Has_Dynamic_Length_Check
1439 -- This flag is present in all expression nodes. It is set to indicate
1440 -- that one of the routines in unit Checks has generated a length check
1441 -- action which has been inserted at the flagged node. This is used to
1442 -- avoid the generation of duplicate checks.
1444 -- Has_Local_Raise
1445 -- Present in exception handler nodes. Set if the handler can be entered
1446 -- via a local raise that gets transformed to a goto statement. This will
1447 -- always be set if Local_Raise_Statements is non-empty, but can also be
1448 -- set as a result of generation of N_Raise_xxx nodes, or flags set in
1449 -- nodes requiring generation of back end checks.
1451 -- Has_No_Elaboration_Code
1452 -- A flag that appears in the N_Compilation_Unit node to indicate whether
1453 -- or not elaboration code is present for this unit. It is initially set
1454 -- true for subprogram specs and bodies and for all generic units and
1455 -- false for non-generic package specs and bodies. Gigi may set the flag
1456 -- in the non-generic package case if it determines that no elaboration
1457 -- code is generated. Note that this flag is not related to the
1458 -- Is_Preelaborated status, there can be preelaborated packages that
1459 -- generate elaboration code, and non-preelaborated packages which do
1460 -- not generate elaboration code.
1462 -- Has_Pragma_Suppress_All
1463 -- This flag is set in an N_Compilation_Unit node if the Suppress_All
1464 -- pragma appears anywhere in the unit. This accommodates the rather
1465 -- strange placement rules of other compilers (DEC permits it at the
1466 -- end of a unit, and Rational allows it as a program unit pragma). We
1467 -- allow it anywhere at all, and consider it equivalent to a pragma
1468 -- Suppress (All_Checks) appearing at the start of the configuration
1469 -- pragmas for the unit.
1471 -- Has_Private_View
1472 -- A flag present in generic nodes that have an entity, to indicate that
1473 -- the node has a private type. Used to exchange private and full
1474 -- declarations if the visibility at instantiation is different from the
1475 -- visibility at generic definition.
1477 -- Has_Relative_Deadline_Pragma
1478 -- A flag present in N_Subprogram_Body and N_Task_Definition nodes to
1479 -- flag the presence of a pragma Relative_Deadline.
1481 -- Has_Secondary_Private_View
1482 -- A flag present in generic nodes that have an entity, to indicate that
1483 -- the node is either of an access type whose Designated_Type is private
1484 -- or of an array type whose Component_Type is private. Used to exchange
1485 -- private and full declarations if the visibility at instantiation is
1486 -- different from the visibility at generic definition.
1488 -- Has_Self_Reference
1489 -- Present in N_Aggregate and N_Extension_Aggregate. Indicates that one
1490 -- of the expressions contains an access attribute reference to the
1491 -- enclosing type. Such a self-reference can only appear in default-
1492 -- initialized aggregate for a record type.
1494 -- Has_SP_Choice
1495 -- Present in all nodes containing a Discrete_Choices field (N_Variant,
1496 -- N_Case_Expression_Alternative, N_Case_Statement_Alternative). Set to
1497 -- True if the Discrete_Choices list has at least one occurrence of a
1498 -- statically predicated subtype.
1500 -- Has_Storage_Size_Pragma
1501 -- A flag present in an N_Task_Definition node to flag the presence of a
1502 -- Storage_Size pragma.
1504 -- Has_Target_Names
1505 -- Present in assignment statements. Indicates that the RHS contains
1506 -- target names (see AI12-0125-3) and must be expanded accordingly.
1508 -- Has_Wide_Character
1509 -- Present in string literals, set if any wide character (i.e. character
1510 -- code outside the Character range but within Wide_Character range)
1511 -- appears in the string. Used to implement pragma preference rules.
1513 -- Has_Wide_Wide_Character
1514 -- Present in string literals, set if any wide character (i.e. character
1515 -- code outside the Wide_Character range) appears in the string. Used to
1516 -- implement pragma preference rules.
1518 -- Header_Size_Added
1519 -- Present in N_Attribute_Reference nodes, set only for attribute
1520 -- Max_Size_In_Storage_Elements. The flag indicates that the size of the
1521 -- hidden list header used by the runtime finalization support has been
1522 -- added to the size of the prefix. The flag also prevents the infinite
1523 -- expansion of the same attribute in the said context.
1525 -- Hidden_By_Use_Clause
1526 -- An entity list present in use clauses that appear within
1527 -- instantiations. For the resolution of local entities, entities
1528 -- introduced by these use clauses have priority over global ones,
1529 -- and outer entities must be explicitly hidden/restored on exit.
1531 -- Implicit_With
1532 -- Present in N_With_Clause nodes. The flag indicates that the clause
1533 -- does not comes from source and introduces an implicit dependency on
1534 -- a particular unit. Such implicit with clauses are generated by:
1536 -- * ABE mechanism - The static elaboration model of both the default
1537 -- and the legacy ABE mechanism use with clauses to encode implicit
1538 -- Elaborate[_All] pragmas.
1540 -- * Analysis - A with clause for child unit A.B.C is equivalent to
1541 -- a series of clauses that with A, A.B, and A.B.C. Manipulation of
1542 -- contexts utilizes implicit with clauses to emulate the visibility
1543 -- of a particular unit.
1545 -- * RTSfind - The compiler generates code which references entities
1546 -- from the runtime.
1548 -- Import_Interface_Present
1549 -- This flag is set in an Interface or Import pragma if a matching
1550 -- pragma of the other kind is also present. This is used to avoid
1551 -- generating some unwanted error messages.
1553 -- Includes_Infinities
1554 -- This flag is present in N_Range nodes. It is set for the range of
1555 -- unconstrained float types defined in Standard, which include not only
1556 -- the given range of values, but also legitimately can include infinite
1557 -- values. This flag is false for any float type for which an explicit
1558 -- range is given by the programmer, even if that range is identical to
1559 -- the range for Float.
1561 -- Incomplete_View
1562 -- Present in full type declarations that are completions of incomplete
1563 -- type declarations. Denotes the corresponding incomplete view declared
1564 -- by the incomplete declaration.
1566 -- Inherited_Discriminant
1567 -- This flag is present in N_Component_Association nodes. It indicates
1568 -- that a given component association in an extension aggregate is the
1569 -- value obtained from a constraint on an ancestor. Used to prevent
1570 -- double expansion when the aggregate has expansion delayed.
1572 -- Instance_Spec
1573 -- This field is present in generic instantiation nodes, and also in
1574 -- formal package declaration nodes (formal package declarations are
1575 -- treated in a manner very similar to package instantiations). It points
1576 -- to the node for the spec of the instance, inserted as part of the
1577 -- semantic processing for instantiations in Sem_Ch12.
1579 -- Is_Abort_Block
1580 -- Present in N_Block_Statement nodes. True if the block protects a list
1581 -- of statements with an Abort_Defer / Abort_Undefer_Direct pair.
1583 -- Is_Accessibility_Actual
1584 -- Present in N_Parameter_Association nodes. True if the parameter is
1585 -- an extra actual that carries the accessibility level of the actual
1586 -- for an access parameter, in a function that dispatches on result and
1587 -- is called in a dispatching context. Used to prevent a formal/actual
1588 -- mismatch when the call is rewritten as a dispatching call.
1590 -- Is_Analyzed_Pragma
1591 -- Present in N_Pragma nodes. Set for delayed pragmas that require a two
1592 -- step analysis. The initial step is performed by routine Analyze_Pragma
1593 -- and verifies the overall legality of the pragma. The second step takes
1594 -- place in the various Analyze_xxx_In_Decl_Part routines which perform
1595 -- full analysis. The flag prevents the reanalysis of a delayed pragma.
1597 -- Is_Asynchronous_Call_Block
1598 -- A flag set in a Block_Statement node to indicate that it is the
1599 -- expansion of an asynchronous entry call. Such a block needs cleanup
1600 -- handler to assure that the call is cancelled.
1602 -- Is_Boolean_Aspect
1603 -- Present in N_Aspect_Specification node. Set if the aspect is for a
1604 -- boolean aspect (i.e. Aspect_Id is in Boolean_Aspect subtype).
1606 -- Is_Checked
1607 -- Present in N_Aspect_Specification and N_Pragma nodes. Set for an
1608 -- assertion aspect or pragma, or check pragma for an assertion, that
1609 -- is to be checked at run time. If either Is_Checked or Is_Ignored
1610 -- is set (they cannot both be set), then this means that the status of
1611 -- the pragma has been checked at the appropriate point and should not
1612 -- be further modified (in some cases these flags are copied when a
1613 -- pragma is rewritten).
1615 -- Is_Checked_Ghost_Pragma
1616 -- This flag is present in N_Pragma nodes. It is set when the pragma is
1617 -- related to a checked Ghost entity or encloses a checked Ghost entity.
1618 -- This flag has no relation to Is_Checked.
1620 -- Is_Component_Left_Opnd
1621 -- Is_Component_Right_Opnd
1622 -- Present in concatenation nodes, to indicate that the corresponding
1623 -- operand is of the component type of the result. Used in resolving
1624 -- concatenation nodes in instances.
1626 -- Is_Controlling_Actual
1627 -- This flag is set on an expression that is a controlling argument in
1628 -- a dispatching call. It is off in all other cases. See Sem_Disp for
1629 -- details of its use.
1631 -- Is_Declaration_Level_Node
1632 -- Present in call marker and instantiation nodes. Set when the constuct
1633 -- appears within the declarations of a block statement, an entry body,
1634 -- a subprogram body, or a task body. The flag aids the ABE Processing
1635 -- phase to catch certain forms of guaranteed ABEs.
1637 -- Is_Delayed_Aspect
1638 -- Present in N_Pragma and N_Attribute_Definition_Clause nodes which
1639 -- come from aspect specifications, where the evaluation of the aspect
1640 -- must be delayed to the freeze point. This flag is also set True in
1641 -- the corresponding N_Aspect_Specification node.
1643 -- Is_Disabled
1644 -- A flag set in an N_Aspect_Specification or N_Pragma node if there was
1645 -- a Check_Policy or Assertion_Policy (or in the case of a Debug_Pragma)
1646 -- a Debug_Policy pragma that resulted in totally disabling the flagged
1647 -- aspect or policy as a result of using the GNAT-defined policy DISABLE.
1648 -- If this flag is set, the aspect or policy is not analyzed for semantic
1649 -- correctness, so any expressions etc will not be marked as analyzed.
1651 -- Is_Dispatching_Call
1652 -- Present in call marker nodes. Set when the related call which prompted
1653 -- the creation of the marker is dispatching.
1655 -- Is_Dynamic_Coextension
1656 -- Present in allocator nodes, to indicate that this is an allocator
1657 -- for an access discriminant of a dynamically allocated object. The
1658 -- coextension must be deallocated and finalized at the same time as
1659 -- the enclosing object. The partner flag Is_Static_Coextension must
1660 -- be cleared before setting this flag to True.
1662 -- Is_Effective_Use_Clause
1663 -- Present in both N_Use_Type_Clause and N_Use_Package_Clause to indicate
1664 -- a use clause is "used" in the current source.
1666 -- Is_Elaboration_Checks_OK_Node
1667 -- Present in the following nodes:
1669 -- assignment statement
1670 -- attribute reference
1671 -- call marker
1672 -- entry call statement
1673 -- expanded name
1674 -- function call
1675 -- function instantiation
1676 -- identifier
1677 -- package instantiation
1678 -- procedure call statement
1679 -- procedure instantiation
1680 -- requeue statement
1681 -- variable reference marker
1683 -- Set when the node appears within a context which allows the generation
1684 -- of run-time ABE checks. This flag determines whether the ABE
1685 -- Processing phase generates conditional ABE checks and guaranteed ABE
1686 -- failures.
1688 -- Is_Elaboration_Code
1689 -- Present in assignment statements. Set for an assignment which updates
1690 -- the elaboration flag of a package or subprogram when the corresponding
1691 -- body is successfully elaborated.
1693 -- Is_Elaboration_Warnings_OK_Node
1694 -- Present in the following nodes:
1696 -- attribute reference
1697 -- call marker
1698 -- entry call statement
1699 -- expanded name
1700 -- function call
1701 -- function instantiation
1702 -- identifier
1703 -- package instantiation
1704 -- procedure call statement
1705 -- procedure instantiation
1706 -- requeue statement
1707 -- variable reference marker
1709 -- Set when the node appears within a context where elaboration warnings
1710 -- are enabled. This flag determines whether the ABE processing phase
1711 -- generates diagnostics on various elaboration issues.
1713 -- Is_Entry_Barrier_Function
1714 -- This flag is set on N_Subprogram_Declaration and N_Subprogram_Body
1715 -- nodes which emulate the barrier function of a protected entry body.
1716 -- The flag is used when checking for incorrect use of Current_Task.
1718 -- Is_Enum_Array_Aggregate
1719 -- A flag set on an aggregate created internally while building the
1720 -- images tables for enumerations.
1722 -- Is_Expanded_Build_In_Place_Call
1723 -- This flag is set in an N_Function_Call node to indicate that the extra
1724 -- actuals to support a build-in-place style of call have been added to
1725 -- the call.
1727 -- Is_Expanded_Contract
1728 -- Present in N_Contract nodes. Set if the contract has already undergone
1729 -- expansion activities.
1731 -- Is_Generic_Contract_Pragma
1732 -- This flag is present in N_Pragma nodes. It is set when the pragma is
1733 -- a source construct, applies to a generic unit or its body, and denotes
1734 -- one of the following contract-related annotations:
1735 -- Abstract_State
1736 -- Always_Terminates
1737 -- Contract_Cases
1738 -- Depends
1739 -- Exceptional_Cases
1740 -- Extensions_Visible
1741 -- Global
1742 -- Initial_Condition
1743 -- Initializes
1744 -- Post
1745 -- Post_Class
1746 -- Postcondition
1747 -- Pre
1748 -- Pre_Class
1749 -- Precondition
1750 -- Refined_Depends
1751 -- Refined_Global
1752 -- Refined_Post
1753 -- Refined_State
1754 -- Subprogram_Variant
1755 -- Test_Case
1757 -- Is_Homogeneous_Aggregate
1758 -- A flag set on an Ada 2022 aggregate that uses square brackets as
1759 -- delimiters, and thus denotes an array or container aggregate, or
1760 -- the prefix of a reduction attribute.
1762 -- Is_Ignored
1763 -- A flag set in an N_Aspect_Specification or N_Pragma node if there was
1764 -- a Check_Policy or Assertion_Policy (or in the case of a Debug_Pragma)
1765 -- a Debug_Policy pragma that specified a policy of IGNORE, DISABLE, or
1766 -- OFF, for the pragma/aspect. If there was a Policy pragma specifying
1767 -- a Policy of ON or CHECK, then this flag is reset. If no Policy pragma
1768 -- gives a policy for the aspect or pragma, then there are two cases. For
1769 -- an assertion aspect or pragma (one of the assertion kinds allowed in
1770 -- an Assertion_Policy pragma), then Is_Ignored is set if assertions are
1771 -- ignored because of the absence of a -gnata switch. For any other
1772 -- aspects or pragmas, the flag is off. If this flag is set, the
1773 -- aspect/pragma is fully analyzed and checked for other syntactic
1774 -- and semantic errors, but it does not have any semantic effect.
1776 -- Is_Ignored_Ghost_Pragma
1777 -- This flag is present in N_Pragma nodes. It is set when the pragma is
1778 -- related to an ignored Ghost entity or encloses ignored Ghost entity.
1779 -- This flag has no relation to Is_Ignored.
1781 -- Is_In_Discriminant_Check
1782 -- This flag is present in a selected component, and is used to indicate
1783 -- that the reference occurs within a discriminant check. The
1784 -- significance is that optimizations based on assuming that the
1785 -- discriminant check has a correct value cannot be performed in this
1786 -- case (or the discriminant check may be optimized away).
1788 -- Is_Inherited_Pragma
1789 -- This flag is set in an N_Pragma node that appears in a N_Contract node
1790 -- to indicate that the pragma has been inherited from a parent context.
1792 -- Is_Initialization_Block
1793 -- Defined in block nodes. Set when the block statement was created by
1794 -- the finalization machinery to wrap initialization statements. This
1795 -- flag aids the ABE Processing phase to suppress the diagnostics of
1796 -- finalization actions in initialization contexts.
1798 -- Is_Known_Guaranteed_ABE
1799 -- NOTE: this flag is shared between the legacy ABE mechanism and the
1800 -- default ABE mechanism.
1802 -- Present in the following nodes:
1804 -- call marker
1805 -- formal package declaration
1806 -- function call
1807 -- function instantiation
1808 -- package instantiation
1809 -- procedure call statement
1810 -- procedure instantiation
1812 -- Set when the elaboration or evaluation of the scenario results in
1813 -- a guaranteed ABE. The flag is used to suppress the instantiation of
1814 -- generic bodies because gigi cannot handle certain forms of premature
1815 -- instantiation, as well as to prevent the reexamination of the node by
1816 -- the ABE Processing phase.
1818 -- Is_Machine_Number
1819 -- This flag is set in an N_Real_Literal node to indicate that the value
1820 -- is a machine number. This avoids some unnecessary cases of converting
1821 -- real literals to machine numbers.
1823 -- Is_Null_Loop
1824 -- This flag is set in an N_Loop_Statement node if the corresponding loop
1825 -- can be determined to be null at compile time. This is used to remove
1826 -- the loop entirely at expansion time.
1828 -- Is_Overloaded
1829 -- A flag present in all expression nodes. Used temporarily during
1830 -- overloading determination. The setting of this flag is not relevant
1831 -- once overloading analysis is complete.
1833 -- Is_Parenthesis_Aggregate
1834 -- A flag set on an aggregate that uses parentheses as delimiters
1836 -- Is_Power_Of_2_For_Shift
1837 -- A flag present only in N_Op_Expon nodes. It is set when the
1838 -- exponentiation is of the form 2 ** N, where the type of N is an
1839 -- unsigned integral subtype whose size does not exceed the size of
1840 -- Standard_Integer (i.e. a type that can be safely converted to
1841 -- Natural), and the exponentiation appears as the right operand of an
1842 -- integer multiplication or an integer division where the dividend is
1843 -- unsigned. It is also required that overflow checking is off for both
1844 -- the exponentiation and the multiply/divide node. If this set of
1845 -- conditions holds, and the flag is set, then the division or
1846 -- multiplication can be (and is) converted to a shift.
1848 -- Is_Preelaborable_Call
1849 -- Present in call marker nodes. Set when the related call is non-static
1850 -- but preelaborable.
1852 -- Is_Prefixed_Call
1853 -- This flag is set in a selected component within a generic unit, if
1854 -- it resolves to a prefixed call to a primitive operation. The flag
1855 -- is used to prevent accidental overloadings in an instance, when a
1856 -- primitive operation and a private record component may be homographs.
1858 -- Is_Protected_Subprogram_Body
1859 -- A flag set in a Subprogram_Body block to indicate that it is the
1860 -- implementation of a protected subprogram. Such a body needs cleanup
1861 -- handler to make sure that the associated protected object is unlocked
1862 -- when the subprogram completes.
1864 -- Is_Qualified_Universal_Literal
1865 -- Present in N_Qualified_Expression nodes. Set when the qualification is
1866 -- converting a universal literal to a specific type. Such qualifiers aid
1867 -- the resolution of accidental overloading of binary or unary operators
1868 -- which may occur in instances.
1870 -- Is_Read
1871 -- Present in variable reference markers. Set when the original variable
1872 -- reference constitutes a read of the variable.
1874 -- Is_Source_Call
1875 -- Present in call marker nodes. Set when the related call came from
1876 -- source.
1878 -- Is_SPARK_Mode_On_Node
1879 -- Present in the following nodes:
1881 -- assignment statement
1882 -- attribute reference
1883 -- call marker
1884 -- entry call statement
1885 -- expanded name
1886 -- function call
1887 -- function instantiation
1888 -- identifier
1889 -- package instantiation
1890 -- procedure call statement
1891 -- procedure instantiation
1892 -- requeue statement
1893 -- variable reference marker
1895 -- Set when the node appears within a context subject to SPARK_Mode On.
1896 -- This flag determines when the SPARK model of elaboration be activated
1897 -- by the ABE Processing phase.
1899 -- Is_Static_Coextension
1900 -- Present in N_Allocator nodes. Set if the allocator is a coextension
1901 -- of an object allocated on the stack rather than the heap. The partner
1902 -- flag Is_Dynamic_Coextension must be cleared before setting this flag
1903 -- to True.
1905 -- Is_Static_Expression
1906 -- Indicates that an expression is a static expression according to the
1907 -- rules in RM-4.9. See Sem_Eval for details.
1909 -- Is_Subprogram_Descriptor
1910 -- Present in N_Object_Declaration, and set only for the object
1911 -- declaration generated for a subprogram descriptor in fast exception
1912 -- mode. See Exp_Ch11 for details of use.
1914 -- Is_Task_Allocation_Block
1915 -- A flag set in a Block_Statement node to indicate that it is the
1916 -- expansion of a task allocator, or the allocator of an object
1917 -- containing tasks. Such a block requires a cleanup handler to call
1918 -- Expunge_Unactivated_Tasks to complete any tasks that have been
1919 -- allocated but not activated when the allocator completes abnormally.
1921 -- Is_Task_Body_Procedure
1922 -- This flag is set on N_Subprogram_Declaration and N_Subprogram_Body
1923 -- nodes which emulate the body of a task unit.
1925 -- Is_Task_Master
1926 -- A flag set in a Subprogram_Body, Block_Statement, or Task_Body node to
1927 -- indicate that the construct is a task master (i.e. has declared tasks
1928 -- or declares an access to a task type).
1930 -- Is_Write
1931 -- Present in variable reference markers. Set when the original variable
1932 -- reference constitutes a write of the variable.
1934 -- Iterator_Filter
1935 -- Present in N_Loop_Parameter_Specification and N_Iterator_Specification
1936 -- nodes for Ada 2022. It is used to store the condition present in the
1937 -- eponymous Ada 2022 construct.
1939 -- Itype
1940 -- Used in N_Itype_Reference node to reference an itype for which it is
1941 -- important to ensure that it is defined. See description of this node
1942 -- for further details.
1944 -- Kill_Range_Check
1945 -- Used in an N_Unchecked_Type_Conversion node to indicate that the
1946 -- result should not be subjected to range checks. This is used for the
1947 -- implementation of Normalize_Scalars.
1949 -- Label_Construct
1950 -- Used in an N_Implicit_Label_Declaration node. Refers to an N_Label,
1951 -- N_Block_Statement or N_Loop_Statement node to which the label
1952 -- declaration applies. The field is left empty for the special labels
1953 -- generated as part of expanding raise statements with a local exception
1954 -- handler.
1956 -- Library_Unit
1957 -- In a stub node, Library_Unit points to the compilation unit node of
1958 -- the corresponding subunit.
1960 -- In a with clause node, Library_Unit points to the spec of the with'ed
1961 -- unit.
1963 -- In a compilation unit node, the usage depends on the unit type:
1965 -- For a library unit body, Library_Unit points to the compilation unit
1966 -- node of the corresponding spec, unless it's a subprogram body with
1967 -- Acts_As_Spec set, in which case it points to itself.
1969 -- For a spec, Library_Unit points to the compilation unit node of the
1970 -- corresponding body, if present. The body will be present if the spec
1971 -- is or contains generics that we needed to instantiate. Similarly, the
1972 -- body will be present if we needed it for inlining purposes. Thus, if
1973 -- we have a spec/body pair, both of which are present, they point to
1974 -- each other via Library_Unit.
1976 -- For a subunit, Library_Unit points to the compilation unit node of
1977 -- the parent body.
1978 -- ??? not (always) true, in (at least some, maybe all?) cases it points
1979 -- to the corresponding spec for the parent body.
1981 -- Note that this field is not used to hold the parent pointer for child
1982 -- unit (which might in any case need to use it for some other purpose as
1983 -- described above). Instead for a child unit, implicit with's are
1984 -- generated for all parents.
1986 -- Local_Raise_Statements
1987 -- This field is present in exception handler nodes. It is set to
1988 -- No_Elist in the normal case. If there is at least one raise statement
1989 -- which can potentially be handled as a local raise, then this field
1990 -- points to a list of raise nodes, which are calls to a routine to raise
1991 -- an exception. These are raise nodes which can be optimized into gotos
1992 -- if the handler turns out to meet the conditions which permit this
1993 -- transformation. Note that this does NOT include instances of the
1994 -- N_Raise_xxx_Error nodes since the transformation of these nodes is
1995 -- handled by the back end (using the N_Push/N_Pop mechanism).
1997 -- Loop_Actions
1998 -- A list present in Component_Association nodes in array aggregates.
1999 -- Used to collect actions that must be executed within the loop because
2000 -- they may need to be evaluated anew each time through.
2002 -- Limited_View_Installed
2003 -- Present in With_Clauses and in package specifications. If set on
2004 -- with_clause, it indicates that this clause has created the current
2005 -- limited view of the designated package. On a package specification, it
2006 -- indicates that the limited view has already been created because the
2007 -- package is mentioned in a limited_with_clause in the closure of the
2008 -- unit being compiled.
2010 -- Local_Raise_Not_OK
2011 -- Present in N_Exception_Handler nodes. Set if the handler contains
2012 -- a construct (reraise statement, or call to subprogram in package
2013 -- GNAT.Current_Exception) that makes the handler unsuitable as a target
2014 -- for a local raise (one that could otherwise be converted to a goto).
2016 -- Must_Be_Byte_Aligned
2017 -- This flag is present in N_Attribute_Reference nodes. It can be set
2018 -- only for the Address and Unrestricted_Access attributes. If set it
2019 -- means that the object for which the address/access is given must be on
2020 -- a byte (more accurately a storage unit) boundary. If necessary, a copy
2021 -- of the object is to be made before taking the address (this copy is in
2022 -- the current scope on the stack frame). This is used for certain cases
2023 -- of code generated by the expander that passes parameters by address.
2025 -- The reason the copy is not made by the front end is that the back end
2026 -- has more information about type layout and may be able to (but is not
2027 -- guaranteed to) prevent making unnecessary copies.
2029 -- Must_Not_Freeze
2030 -- A flag present in all expression nodes. Normally expressions cause
2031 -- freezing as described in the RM. If this flag is set, then this is
2032 -- inhibited. This is used by the analyzer and expander to label nodes
2033 -- that are created by semantic analysis or expansion and which must not
2034 -- cause freezing even though they normally would. This flag is also
2035 -- present in an N_Subtype_Indication node, since we also use these in
2036 -- calls to Freeze_Expression.
2038 -- Next_Entity
2039 -- Present in defining identifiers, defining character literals, and
2040 -- defining operator symbols (i.e. in all entities). The entities of a
2041 -- scope are chained, and this field is used as the forward pointer for
2042 -- this list. See Einfo for further details.
2044 -- Next_Exit_Statement
2045 -- Present in N_Exit_Statement nodes. The exit statements for a loop are
2046 -- chained (in reverse order of appearance) from the First_Exit_Statement
2047 -- field of the E_Loop entity for the loop. Next_Exit_Statement points to
2048 -- the next entry on this chain (Empty = end of list).
2050 -- Next_Implicit_With
2051 -- Present in N_With_Clause. Part of a chain of with_clauses generated
2052 -- in rtsfind to indicate implicit dependencies on predefined units. Used
2053 -- to prevent multiple with_clauses for the same unit in a given context.
2054 -- A postorder traversal of the tree whose nodes are units and whose
2055 -- links are with_clauses defines the order in which CodePeer must
2056 -- examine a compiled unit and its full context. This ordering ensures
2057 -- that any subprogram call is examined after the subprogram declaration
2058 -- has been seen.
2060 -- Next_Named_Actual
2061 -- Present in parameter association nodes. Set during semantic analysis
2062 -- to point to the next named parameter, where parameters are ordered by
2063 -- declaration order (as opposed to the actual order in the call, which
2064 -- may be different due to named associations). Not that this field
2065 -- points to the explicit actual parameter itself, not to the
2066 -- N_Parameter_Association node (its parent).
2068 -- Next_Pragma
2069 -- Present in N_Pragma nodes. Used to create a linked list of pragma
2070 -- nodes. Currently used for two purposes:
2072 -- Create a list of linked Check_Policy pragmas. The head of this list
2073 -- is stored in Opt.Check_Policy_List (which has further details).
2075 -- Used by processing for Pre/Postcondition pragmas to store a list of
2076 -- pragmas associated with the spec of a subprogram (see Sem_Prag for
2077 -- details).
2079 -- Used by processing for pragma SPARK_Mode to store multiple pragmas
2080 -- the apply to the same construct. These are visible/private mode for
2081 -- a package spec and declarative/statement mode for package body.
2083 -- Next_Rep_Item
2084 -- Present in pragma nodes, attribute definition nodes, enumeration rep
2085 -- clauses, record rep clauses, aspect specification and null statement
2086 -- nodes. Used to link representation items that apply to an entity. See
2087 -- full description of First_Rep_Item field in Einfo for further details.
2089 -- Next_Use_Clause
2090 -- While use clauses are active during semantic processing, they are
2091 -- chained from the scope stack entry, using Next_Use_Clause as a link
2092 -- pointer, with Empty marking the end of the list. The head pointer is
2093 -- in the scope stack entry (First_Use_Clause). At the end of semantic
2094 -- processing (i.e. when Gigi sees the tree, the contents of this field
2095 -- is undefined and should not be read).
2097 -- No_Ctrl_Actions
2098 -- Present in N_Assignment_Statement to indicate that neither Finalize
2099 -- nor Adjust should take place on this assignment even though the LHS
2100 -- and RHS are controlled. Also to indicate that the primitive _assign
2101 -- should not be used for a tagged assignment. This flag is used in init
2102 -- proc and aggregate expansion where the generated assignments are
2103 -- initializations, not real assignments. Note that it also suppresses
2104 -- the creation of transient scopes around the N_Assignment_Statement,
2105 -- in other words it disables all controlled actions for the assignment.
2107 -- No_Elaboration_Check
2108 -- NOTE: this flag is relevant only for the legacy ABE mechanism and
2109 -- should not be used outside of that context.
2111 -- Present in N_Function_Call and N_Procedure_Call_Statement. Indicates
2112 -- that no elaboration check is needed on the call, because it appears in
2113 -- the context of a local Suppress pragma. This is used on calls within
2114 -- task bodies, where the actual elaboration checks are applied after
2115 -- analysis, when the local scope stack is not present.
2117 -- No_Entities_Ref_In_Spec
2118 -- Present in N_With_Clause nodes. Set if the with clause is on the
2119 -- package or subprogram spec where the main unit is the corresponding
2120 -- body, and no entities of the with'ed unit are referenced by the spec
2121 -- (an entity may still be referenced in the body, so this flag is used
2122 -- to generate the proper message (see Sem_Util.Check_Unused_Withs for
2123 -- full details).
2125 -- No_Finalize_Actions
2126 -- Present in N_Assignment_Statement to indicate that no Finalize should
2127 -- take place on this assignment even though the LHS is controlled. Also
2128 -- to indicate that the primitive _assign should not be used for a tagged
2129 -- assignment. This flag is only used in aggregates expansion where the
2130 -- generated assignments are initializations, not real assignments. Note
2131 -- that, unlike the No_Ctrl_Actions flag, it does *not* suppress the
2132 -- creation of transient scopes around the N_Assignment_Statement.
2134 -- No_Initialization
2135 -- Present in N_Object_Declaration and N_Allocator to indicate that the
2136 -- object must not be initialized (by Initialize or call to an init
2137 -- proc). This is needed for controlled aggregates. When the Object
2138 -- declaration has an expression, this flag means that this expression
2139 -- should not be taken into account (needed for in place initialization
2140 -- with aggregates, and for object with an address clause, which are
2141 -- initialized with an assignment at freeze time).
2143 -- No_Minimize_Eliminate
2144 -- This flag is present in membership operator nodes (N_In/N_Not_In).
2145 -- It is used to indicate that processing for extended overflow checking
2146 -- modes is not required (this is used to prevent infinite recursion).
2148 -- No_Truncation
2149 -- Present in N_Unchecked_Type_Conversion node. This flag has an effect
2150 -- only if the RM_Size of the source is greater than the RM_Size of the
2151 -- target for scalar operands. Normally in such a case we truncate some
2152 -- higher order bits of the source, and then sign/zero extend the result
2153 -- to form the output value. But if this flag is set, then we do not do
2154 -- any truncation, so for example, if an 8 bit input is converted to 5
2155 -- bit result which is in fact stored in 8 bits, then the high order
2156 -- three bits of the target result will be copied from the source. This
2157 -- is used for properly setting out of range values for use by pragmas
2158 -- Initialize_Scalars and Normalize_Scalars.
2160 -- Null_Excluding_Subtype
2161 -- Present in N_Access_To_Object_Definition. Indicates that the subtype
2162 -- indication carries a null-exclusion indicator, which is distinct from
2163 -- the null-exclusion indicator that may precede the access keyword.
2165 -- Original_Discriminant
2166 -- Present in identifiers. Used in references to discriminants that
2167 -- appear in generic units. Because the names of the discriminants may be
2168 -- different in an instance, we use this field to recover the position of
2169 -- the discriminant in the original type, and replace it with the
2170 -- discriminant at the same position in the instantiated type.
2172 -- Original_Entity
2173 -- Present in numeric literals. Used to denote the named number that has
2174 -- been constant-folded into the given literal. If literal is from
2175 -- source, or the result of some other constant-folding operation, then
2176 -- Original_Entity is empty. This field is needed to handle properly
2177 -- named numbers in generic units, where the Associated_Node field
2178 -- interferes with the Entity field, making it impossible to preserve the
2179 -- original entity at the point of instantiation.
2181 -- Others_Discrete_Choices
2182 -- When a case statement or variant is analyzed, the semantic checks
2183 -- determine the actual list of choices that correspond to an others
2184 -- choice. This list is materialized for later use by the expander and
2185 -- the Others_Discrete_Choices field of an N_Others_Choice node points to
2186 -- this materialized list of choices, which is in standard format for a
2187 -- list of discrete choices, except that of course it cannot contain an
2188 -- N_Others_Choice entry.
2190 -- Parent_Spec
2191 -- For a library unit that is a child unit spec (package or subprogram
2192 -- declaration, generic declaration or instantiation, or library level
2193 -- rename) this field points to the compilation unit node for the parent
2194 -- package specification. This field is Empty for library bodies (the
2195 -- parent spec in this case can be found from the corresponding spec).
2197 -- Parent_With
2198 -- Present in N_With_Clause nodes. The flag indicates that the clause
2199 -- was generated for an ancestor unit to provide proper visibility. A
2200 -- with clause for child unit A.B.C produces two implicit parent with
2201 -- clauses for A and A.B.
2203 -- Premature_Use
2204 -- Present in N_Incomplete_Type_Declaration node. Used for improved
2205 -- error diagnostics: if there is a premature usage of an incomplete
2206 -- type, a subsequently generated error message indicates the position
2207 -- of its full declaration.
2209 -- Present_Expr
2210 -- Present in an N_Variant node. This has a meaningful value only after
2211 -- Gigi has back annotated the tree with representation information. At
2212 -- this point, it contains a reference to a gcc expression that depends
2213 -- on the values of one or more discriminants. Given a set of
2214 -- discriminant values, this expression evaluates to False (zero) if
2215 -- variant is not present, and True (non-zero) if it is present. See
2216 -- unit Repinfo for further details on gigi back annotation. This field
2217 -- is used during back-annotation processing (for -gnatR -gnatc) to
2218 -- determine if a field is present or not.
2220 -- Prev_Use_Clause
2221 -- Present in both N_Use_Package_Clause and N_Use_Type_Clause. Used in
2222 -- detection of ineffective use clauses by allowing a chain of related
2223 -- clauses together to avoid traversing the current scope stack.
2225 -- Print_In_Hex
2226 -- Set on an N_Integer_Literal node to indicate that the value should be
2227 -- printed in hexadecimal in the sprint listing. Has no effect on
2228 -- legality or semantics of program, only on the displayed output. This
2229 -- is used to clarify output from the packed array cases.
2231 -- Procedure_To_Call
2232 -- Present in N_Allocator, N_Free_Statement, N_Simple_Return_Statement,
2233 -- and N_Extended_Return_Statement nodes. References the entity for the
2234 -- declaration of the procedure to be called to accomplish the required
2235 -- operation (i.e. for the Allocate procedure in the case of N_Allocator
2236 -- and N_Simple_Return_Statement and N_Extended_Return_Statement (for
2237 -- allocating the return value), and for the Deallocate procedure in the
2238 -- case of N_Free_Statement.
2240 -- Raises_Constraint_Error
2241 -- Set on an expression whose evaluation will definitely fail constraint
2242 -- error check. See Sem_Eval for details.
2244 -- Redundant_Use
2245 -- Present in nodes that can appear as an operand in a use clause or use
2246 -- type clause (identifiers, expanded names, attribute references). Set
2247 -- to indicate that a use is redundant (and therefore need not be undone
2248 -- on scope exit).
2250 -- Renaming_Exception
2251 -- Present in N_Exception_Declaration node. Used to point back to the
2252 -- exception renaming for an exception declared within a subprogram.
2253 -- What happens is that an exception declared in a subprogram is moved
2254 -- to the library level with a unique name, and the original exception
2255 -- becomes a renaming. This link from the library level exception to the
2256 -- renaming declaration allows registering of the proper exception name.
2258 -- Return_Statement_Entity
2259 -- Present in N_Simple_Return_Statement and N_Extended_Return_Statement.
2260 -- Points to an E_Return_Statement representing the return statement.
2262 -- Return_Object_Declarations
2263 -- Present in N_Extended_Return_Statement. Points to a list initially
2264 -- containing a single N_Object_Declaration representing the return
2265 -- object. We use a list (instead of just a pointer to the object decl)
2266 -- because Analyze wants to insert extra actions on this list, before the
2267 -- N_Object_Declaration, which always remains last on the list.
2269 -- Rounded_Result
2270 -- Present in N_Type_Conversion, N_Op_Divide, and N_Op_Multiply nodes.
2271 -- Used in the fixed-point cases to indicate that the result must be
2272 -- rounded as a result of the use of the 'Round attribute. Also used for
2273 -- integer N_Op_Divide nodes to indicate that the result should be
2274 -- rounded to the nearest integer (breaking ties away from zero), rather
2275 -- than truncated towards zero as usual. These rounded integer operations
2276 -- are the result of expansion of rounded fixed-point divide, conversion
2277 -- and multiplication operations.
2279 -- Save_Invocation_Graph_Of_Body
2280 -- Present in compilation unit nodes. Set when the elaboration mechanism
2281 -- must record all invocation constructs and invocation relations within
2282 -- the body of the compilation unit.
2284 -- SCIL_Entity
2285 -- Present in SCIL nodes. References the specific tagged type associated
2286 -- with the SCIL node (for an N_SCIL_Dispatching_Call node, this is
2287 -- the controlling type of the call; for an N_SCIL_Membership_Test node
2288 -- generated as part of testing membership in T'Class, this is T; for an
2289 -- N_SCIL_Dispatch_Table_Tag_Init node, this is the type being declared).
2291 -- SCIL_Controlling_Tag
2292 -- Present in N_SCIL_Dispatching_Call nodes. References the controlling
2293 -- tag of a dispatching call. This is usually an N_Selected_Component
2294 -- node (for a _tag component), but may be an N_Object_Declaration or
2295 -- N_Parameter_Specification node in some cases (e.g., for a call to
2296 -- a classwide streaming operation or a call to an instance of
2297 -- Ada.Tags.Generic_Dispatching_Constructor).
2299 -- SCIL_Tag_Value
2300 -- Present in N_SCIL_Membership_Test nodes. Used to reference the tag
2301 -- of the value that is being tested.
2303 -- SCIL_Target_Prim
2304 -- Present in N_SCIL_Dispatching_Call nodes. References the primitive
2305 -- operation named (statically) in a dispatching call.
2307 -- Scope
2308 -- Present in defining identifiers, defining character literals, and
2309 -- defining operator symbols (i.e. in all entities). The entities of a
2310 -- scope all use this field to reference the corresponding scope entity.
2311 -- See Einfo for further details.
2313 -- Shift_Count_OK
2314 -- A flag present in shift nodes to indicate that the shift count is
2315 -- known to be in range, i.e. is in the range from zero to word length
2316 -- minus one. If this flag is not set, then the shift count may be
2317 -- outside this range, i.e. larger than the word length, and the code
2318 -- must ensure that such shift counts give the appropriate result.
2320 -- Source_Type
2321 -- Used in an N_Validate_Unchecked_Conversion node to point to the
2322 -- source type entity for the unchecked conversion instantiation
2323 -- which gigi must do size validation for.
2325 -- Split_PPC
2326 -- When a Pre or Post aspect specification is processed, it is broken
2327 -- into AND THEN sections. The leftmost section has Split_PPC set to
2328 -- False, indicating that it is the original specification (e.g. for
2329 -- posting errors). For other sections, Split_PPC is set to True.
2330 -- This flag is set in both the N_Aspect_Specification node itself,
2331 -- and in the pragma which is generated from this node.
2333 -- Storage_Pool
2334 -- Present in N_Allocator, N_Free_Statement, N_Simple_Return_Statement,
2335 -- and N_Extended_Return_Statement nodes. References the entity for the
2336 -- storage pool to be used for the allocate or free call or for the
2337 -- allocation of the returned value from function. Empty indicates that
2338 -- the global default pool is to be used. Note that in the case
2339 -- of a return statement, this field is set only if the function returns
2340 -- value of a type whose size is not known at compile time on the
2341 -- secondary stack.
2343 -- Suppress_Assignment_Checks
2344 -- Used in generated N_Assignment_Statement nodes to suppress predicate
2345 -- and range checks in cases where the generated code knows that the
2346 -- value being assigned is in range and satisfies any predicate. Also
2347 -- can be set in N_Object_Declaration nodes, to similarly suppress any
2348 -- checks on the initializing value. In assignment statements it also
2349 -- suppresses access checks in the generated code for out- and in-out
2350 -- parameters in entry calls, as well as discriminant and length checks.
2352 -- Suppress_Loop_Warnings
2353 -- Used in N_Loop_Statement node to indicate that warnings within the
2354 -- body of the loop should be suppressed. This is set when the range
2355 -- of a FOR loop is known to be null, or is probably null (loop would
2356 -- only execute if invalid values are present).
2358 -- Target
2359 -- Present in call and variable reference marker nodes. References the
2360 -- entity of the original entity, operator, or subprogram being invoked,
2361 -- or the original variable being read or written.
2363 -- Target_Type
2364 -- Used in an N_Validate_Unchecked_Conversion node to point to the target
2365 -- type entity for the unchecked conversion instantiation which gigi must
2366 -- do size validation for.
2368 -- Then_Actions
2369 -- This field is present in if expression nodes. During code expansion
2370 -- we use the Insert_Actions procedure (in Exp_Util) to insert actions
2371 -- at an appropriate place in the tree to get elaborated at the right
2372 -- time. For if expressions, we have to be sure that the actions for
2373 -- for the Then branch are only elaborated if the condition is True.
2374 -- The Then_Actions field is used as a temporary parking place for
2375 -- these actions. The final tree is always rewritten to eliminate the
2376 -- need for this field, so in the tree passed to Gigi, this field is
2377 -- always set to No_List.
2379 -- TSS_Elist
2380 -- Present in N_Freeze_Entity nodes. Holds an element list containing
2381 -- entries for each TSS (type support subprogram) associated with the
2382 -- frozen type. The elements of the list are the entities for the
2383 -- subprograms (see package Exp_TSS for further details). Set to No_Elist
2384 -- if there are no type support subprograms for the type or if the freeze
2385 -- node is not for a type.
2387 -- Uneval_Old_Accept
2388 -- Present in N_Pragma nodes. Set True if Opt.Uneval_Old is set to 'A'
2389 -- (accept) at the point where the pragma is encountered (including the
2390 -- case of a pragma generated from an aspect specification). It is this
2391 -- setting that is relevant, rather than the setting at the point where
2392 -- a contract is finally analyzed after the delay till the freeze point.
2394 -- Uneval_Old_Warn
2395 -- Present in N_Pragma nodes. Set True if Opt.Uneval_Old is set to 'W'
2396 -- (warn) at the point where the pragma is encountered (including the
2397 -- case of a pragma generated from an aspect specification). It is this
2398 -- setting that is relevant, rather than the setting at the point where
2399 -- a contract is finally analyzed after the delay till the freeze point.
2401 -- Unreferenced_In_Spec
2402 -- Present in N_With_Clause nodes. Set if the with clause is on the
2403 -- package or subprogram spec where the main unit is the corresponding
2404 -- body, and is not referenced by the spec (it may still be referenced by
2405 -- the body, so this flag is used to generate the proper message (see
2406 -- Sem_Util.Check_Unused_Withs for details)
2408 -- Uninitialized_Variable
2409 -- Present in N_Formal_Private_Type_Definition and in N_Private_
2410 -- Extension_Declarations. Indicates that a variable in a generic unit
2411 -- whose type is a formal private or derived type is read without being
2412 -- initialized. Used to warn if the corresponding actual type is not
2413 -- a fully initialized type.
2415 -- Used_Operations
2416 -- Present in N_Use_Type_Clause nodes. Holds the list of operations that
2417 -- are made potentially use-visible by the clause. Simplifies processing
2418 -- on exit from the scope of the use_type_clause, in particular in the
2419 -- case of Use_All_Type, when those operations several scopes.
2421 -- Was_Attribute_Reference
2422 -- Present in N_Subprogram_Body. Set to True if the original source is an
2423 -- attribute reference which is an actual in a generic instantiation. The
2424 -- instantiation prologue renames these attributes, and expansion later
2425 -- converts them into subprogram bodies.
2427 -- Was_Expression_Function
2428 -- Present in N_Subprogram_Body. True if the original source had an
2429 -- N_Expression_Function, which was converted to the N_Subprogram_Body
2430 -- by Analyze_Expression_Function.
2432 -- Was_Originally_Stub
2433 -- This flag is set in the node for a proper body that replaces stub.
2434 -- During the analysis procedure, stubs in some situations get rewritten
2435 -- by the corresponding bodies, and we set this flag to remember that
2436 -- this happened. Note that it is not good enough to rely on the use of
2437 -- Original_Node here because of the case of nested instantiations where
2438 -- the substituted node can be copied.
2440 --------------------------------------------------
2441 -- Note on Use of End_Label and End_Span Fields --
2442 --------------------------------------------------
2444 -- Several constructs have end lines:
2446 -- Loop Statement end loop [loop_IDENTIFIER];
2447 -- Package Specification end [[PARENT_UNIT_NAME .] IDENTIFIER]
2448 -- Task Definition end [task_IDENTIFIER]
2449 -- Protected Definition end [protected_IDENTIFIER]
2450 -- Protected Body end [protected_IDENTIFIER]
2452 -- Block Statement end [block_IDENTIFIER];
2453 -- Subprogram Body end [DESIGNATOR];
2454 -- Package Body end [[PARENT_UNIT_NAME .] IDENTIFIER];
2455 -- Task Body end [task_IDENTIFIER];
2456 -- Accept Statement end [entry_IDENTIFIER]];
2457 -- Entry Body end [entry_IDENTIFIER];
2459 -- If Statement end if;
2460 -- Case Statement end case;
2462 -- Record Definition end record;
2463 -- Enumeration Definition );
2465 -- The End_Label and End_Span fields are used to mark the locations of
2466 -- these lines, and also keep track of the label in the case where a label
2467 -- is present.
2469 -- For the first group above, the End_Label field of the corresponding node
2470 -- is used to point to the label identifier. In the case where there is no
2471 -- label in the source, the parser supplies a dummy identifier (with
2472 -- Comes_From_Source set to False), and the Sloc of this dummy identifier
2473 -- marks the location of the token following the END token.
2475 -- For the second group, the use of End_Label is similar, but the End_Label
2476 -- is found in the N_Handled_Sequence_Of_Statements node. This is done
2477 -- simply because in some cases there is no room in the parent node.
2479 -- For the third group, there is never any label, and instead of using
2480 -- End_Label, we use the End_Span field which gives the location of the
2481 -- token following END, relative to the starting Sloc of the construct,
2482 -- i.e. add Sloc (Node) + End_Span (Node) to get the Sloc of the IF or CASE
2483 -- following the End_Label.
2485 -- The record definition case is handled specially, we treat it as though
2486 -- it required an optional label which is never present, and so the parser
2487 -- always builds a dummy identifier with Comes From Source set False. The
2488 -- reason we do this, rather than using End_Span in this case, is that we
2489 -- want to generate a cross-ref entry for the end of a record, since it
2490 -- represents a scope for name declaration purposes.
2492 -- The enumeration definition case is handled in an exactly similar manner,
2493 -- building a dummy identifier to get a cross-reference.
2495 -- Note: the reason we store the difference as a Uint, instead of storing
2496 -- the Source_Ptr value directly, is that Source_Ptr values cannot be
2497 -- distinguished from other types of values, and we count on all general
2498 -- use fields being self describing. To make things easier for clients,
2499 -- note that we provide function End_Location, and procedure
2500 -- Set_End_Location to allow access to the logical value (which is the
2501 -- Source_Ptr value for the end token).
2503 ---------------------
2504 -- Syntactic Nodes --
2505 ---------------------
2507 ---------------------
2508 -- 2.3 Identifier --
2509 ---------------------
2511 -- IDENTIFIER ::= IDENTIFIER_LETTER {[UNDERLINE] LETTER_OR_DIGIT}
2512 -- LETTER_OR_DIGIT ::= IDENTIFIER_LETTER | DIGIT
2514 -- An IDENTIFIER shall not be a reserved word
2516 -- In the Ada grammar identifiers are the bottom level tokens which have
2517 -- very few semantics. Actual program identifiers are direct names. If
2518 -- we were being 100% honest with the grammar, then we would have a node
2519 -- called N_Direct_Name which would point to an identifier. However,
2520 -- that's too many extra nodes, so we just use the N_Identifier node
2521 -- directly as a direct name, and it contains the expression fields and
2522 -- Entity field that correspond to its use as a direct name. In those
2523 -- few cases where identifiers appear in contexts where they are not
2524 -- direct names (pragmas, pragma argument associations, attribute
2525 -- references and attribute definition clauses), the Chars field of the
2526 -- node contains the Name_Id for the identifier name.
2528 -- Note: in GNAT, a reserved word can be treated as an identifier in two
2529 -- cases. First, an incorrect use of a reserved word as an identifier is
2530 -- diagnosed and then treated as a normal identifier. Second, an
2531 -- attribute designator of the form of a reserved word (access, delta,
2532 -- digits, range) is treated as an identifier.
2534 -- Note: The set of letters that is permitted in an identifier depends
2535 -- on the character set in use. See package Csets for full details.
2537 -- N_Identifier
2538 -- Sloc points to identifier
2539 -- Chars contains the Name_Id for the identifier
2540 -- Entity
2541 -- Associated_Node
2542 -- Original_Discriminant
2543 -- Is_Elaboration_Checks_OK_Node
2544 -- Is_SPARK_Mode_On_Node
2545 -- Is_Elaboration_Warnings_OK_Node
2546 -- Has_Private_View (set in generic units)
2547 -- Has_Secondary_Private_View (set in generic units)
2548 -- Redundant_Use
2549 -- Atomic_Sync_Required
2550 -- plus fields for expression
2552 --------------------------
2553 -- 2.4 Numeric Literal --
2554 --------------------------
2556 -- NUMERIC_LITERAL ::= DECIMAL_LITERAL | BASED_LITERAL
2558 ----------------------------
2559 -- 2.4.1 Decimal Literal --
2560 ----------------------------
2562 -- DECIMAL_LITERAL ::= NUMERAL [.NUMERAL] [EXPONENT]
2564 -- NUMERAL ::= DIGIT {[UNDERLINE] DIGIT}
2566 -- EXPONENT ::= E [+] NUMERAL | E - NUMERAL
2568 -- Decimal literals appear in the tree as either integer literal nodes
2569 -- or real literal nodes, depending on whether a period is present.
2571 -- Note: literal nodes appear as a result of direct use of literals
2572 -- in the source program, and also as the result of evaluating
2573 -- expressions at compile time. In the latter case, it is possible
2574 -- to construct real literals that have no syntactic representation
2575 -- using the standard literal format. Such literals are listed by
2576 -- Sprint using the notation [numerator / denominator].
2578 -- Note: the value of an integer literal node created by the front end
2579 -- is never outside the range of values of the base type. However, it
2580 -- can be the case that the created value is outside the range of the
2581 -- particular subtype. This happens in the case of integer overflows
2582 -- with checks suppressed.
2584 -- N_Integer_Literal
2585 -- Sloc points to literal
2586 -- Original_Entity If not Empty, holds Named_Number that
2587 -- has been constant-folded into its literal value.
2588 -- Intval contains integer value of literal
2589 -- Print_In_Hex
2590 -- plus fields for expression
2592 -- N_Real_Literal
2593 -- Sloc points to literal
2594 -- Original_Entity If not Empty, holds Named_Number that
2595 -- has been constant-folded into its literal value.
2596 -- Realval contains real value of literal
2597 -- Corresponding_Integer_Value
2598 -- Is_Machine_Number
2599 -- plus fields for expression
2601 --------------------------
2602 -- 2.4.2 Based Literal --
2603 --------------------------
2605 -- BASED_LITERAL ::=
2606 -- BASE # BASED_NUMERAL [.BASED_NUMERAL] # [EXPONENT]
2608 -- BASE ::= NUMERAL
2610 -- BASED_NUMERAL ::=
2611 -- EXTENDED_DIGIT {[UNDERLINE] EXTENDED_DIGIT}
2613 -- EXTENDED_DIGIT ::= DIGIT | A | B | C | D | E | F
2615 -- Based literals appear in the tree as either integer literal nodes
2616 -- or real literal nodes, depending on whether a period is present.
2618 ----------------------------
2619 -- 2.5 Character Literal --
2620 ----------------------------
2622 -- CHARACTER_LITERAL ::= ' GRAPHIC_CHARACTER '
2624 -- N_Character_Literal
2625 -- Sloc points to literal
2626 -- Chars contains the Name_Id for the identifier
2627 -- Char_Literal_Value contains the literal value
2628 -- Entity
2629 -- Associated_Node
2630 -- Has_Private_View (set in generic units)
2631 -- Has_Secondary_Private_View (set in generic units)
2632 -- plus fields for expression
2634 -- Note: the Entity field will be missing (set to Empty) for character
2635 -- literals whose type is Standard.Wide_Character or Standard.Character
2636 -- or a type derived from one of these two. In this case the character
2637 -- literal stands for its own coding. The reason we take this irregular
2638 -- short cut is to avoid the need to build lots of junk defining
2639 -- character literal nodes.
2641 -------------------------
2642 -- 2.6 String Literal --
2643 -------------------------
2645 -- STRING LITERAL ::= "{STRING_ELEMENT}"
2647 -- A STRING_ELEMENT is either a pair of quotation marks ("), or a
2648 -- single GRAPHIC_CHARACTER other than a quotation mark.
2650 -- Is_Folded_In_Parser is True if the parser created this literal by
2651 -- folding a sequence of "&" operators. For example, if the source code
2652 -- says "aaa" & "bbb" & "ccc", and this produces "aaabbbccc", the flag
2653 -- is set. This flag is needed because the parser doesn't know about
2654 -- visibility, so the folded result might be wrong, and semantic
2655 -- analysis needs to check for that.
2657 -- N_String_Literal
2658 -- Sloc points to literal
2659 -- Strval contains Id of string value
2660 -- Has_Wide_Character
2661 -- Has_Wide_Wide_Character
2662 -- Is_Folded_In_Parser
2663 -- plus fields for expression
2665 ---------------------------------------
2666 -- 2.6 Interpolated String Literal --
2667 ---------------------------------------
2669 -- INTERPOLATED_STRING_LITERAL ::=
2670 -- '{' "{INTERPOLATED_STRING_ELEMENT}" {
2671 -- "{INTERPOLATED_STRING_ELEMENT}" } '}'
2673 -- INTERPOLATED_STRING_ELEMENT ::=
2674 -- ESCAPED_CHARACTER | INTERPOLATED_EXPRESSION
2675 -- | non_quotation_mark_non_left_brace_GRAPHIC_CHARACTER
2677 -- ESCAPED_CHARACTER ::= '\GRAPHIC_CHARACTER'
2679 -- INTERPOLATED_EXPRESSION ::= '{' EXPRESSION '}'
2681 -- Most of these syntax rules are omitted as tree nodes to simplify
2682 -- semantic processing. The scanner handles escaped characters as part
2683 -- of processing an interpolated string literal, and the parser stores
2684 -- in the Expressions field of this node a list containing the sequence
2685 -- of string literals and the roots of the interpolated expressions.
2687 -- N_Interpolated_String_Literal
2688 -- Sloc points to literal
2689 -- Expressions
2690 -- plus fields for expression
2692 ------------------
2693 -- 2.7 Comment --
2694 ------------------
2696 -- A COMMENT starts with two adjacent hyphens and extends up to the
2697 -- end of the line. A COMMENT may appear on any line of a program.
2699 -- Comments are skipped by the scanner and do not appear in the tree.
2700 -- It is possible to reconstruct the position of comments with respect
2701 -- to the elements of the tree by using the source position (Sloc)
2702 -- pointers that appear in every tree node.
2704 -----------------
2705 -- 2.8 Pragma --
2706 -----------------
2708 -- PRAGMA ::= pragma IDENTIFIER
2709 -- [(PRAGMA_ARGUMENT_ASSOCIATION {, PRAGMA_ARGUMENT_ASSOCIATION})];
2711 -- Note that a pragma may appear in the tree anywhere a declaration
2712 -- or a statement may appear, as well as in some other situations
2713 -- which are explicitly documented.
2715 -- N_Pragma
2716 -- Sloc points to PRAGMA
2717 -- Next_Pragma
2718 -- Pragma_Argument_Associations (set to No_List if none)
2719 -- Corresponding_Aspect (set to Empty if not present)
2720 -- Pragma_Identifier
2721 -- Next_Rep_Item
2722 -- Is_Generic_Contract_Pragma
2723 -- Is_Checked_Ghost_Pragma
2724 -- Is_Inherited_Pragma
2725 -- Is_Analyzed_Pragma
2726 -- Class_Present set if from Aspect with 'Class
2727 -- Uneval_Old_Accept
2728 -- Is_Ignored_Ghost_Pragma
2729 -- Is_Ignored
2730 -- Is_Checked
2731 -- From_Aspect_Specification
2732 -- Is_Delayed_Aspect
2733 -- Is_Disabled
2734 -- Import_Interface_Present
2735 -- Split_PPC set if corresponding aspect had Split_PPC set
2736 -- Uneval_Old_Warn
2738 -- Note: we should have a section on what pragmas are passed on to
2739 -- the back end to be processed. This section should note that pragma
2740 -- Psect_Object is always converted to Common_Object, but there are
2741 -- undoubtedly many other similar notes required ???
2743 -- Note: utility functions Pragma_Name_Unmapped and Pragma_Name may be
2744 -- applied to pragma nodes to obtain the Chars or its mapped version.
2746 -- Note: if From_Aspect_Specification is set, then Sloc points to the
2747 -- aspect name, as does the Pragma_Identifier. In this case if the
2748 -- pragma has a local name argument (such as pragma Inline), it is
2749 -- resolved to point to the specific entity affected by the pragma.
2751 --------------------------------------
2752 -- 2.8 Pragma Argument Association --
2753 --------------------------------------
2755 -- PRAGMA_ARGUMENT_ASSOCIATION ::=
2756 -- [pragma_argument_IDENTIFIER =>] NAME
2757 -- | [pragma_argument_IDENTIFIER =>] EXPRESSION
2759 -- In Ada 2012, there are two more possibilities:
2761 -- PRAGMA_ARGUMENT_ASSOCIATION ::=
2762 -- [pragma_argument_ASPECT_MARK =>] NAME
2763 -- | [pragma_argument_ASPECT_MARK =>] EXPRESSION
2765 -- where the interesting allowed cases (which do not fit the syntax of
2766 -- the first alternative above) are
2768 -- ASPECT_MARK => Pre'Class |
2769 -- Post'Class |
2770 -- Type_Invariant'Class |
2771 -- Invariant'Class
2773 -- We allow this special usage in all Ada modes, but it would be a
2774 -- pain to allow these aspects to pervade the pragma syntax, and the
2775 -- representation of pragma nodes internally. So what we do is to
2776 -- replace these ASPECT_MARK forms with identifiers whose name is one
2777 -- of the special internal names _Pre, _Post, or _Type_Invariant.
2779 -- We do a similar replacement of these Aspect_Mark forms in the
2780 -- Expression of a pragma argument association for the cases of
2781 -- the first arguments of any Check pragmas and Check_Policy pragmas
2783 -- N_Pragma_Argument_Association
2784 -- Sloc points to first token in association
2785 -- Chars (set to No_Name if no pragma argument identifier)
2786 -- Expression_Copy
2787 -- Expression
2789 ------------------------
2790 -- 2.9 Reserved Word --
2791 ------------------------
2793 -- Reserved words are parsed by the scanner, and returned as the
2794 -- corresponding token types (e.g. PACKAGE is returned as Tok_Package)
2796 ----------------------------
2797 -- 3.1 Basic Declaration --
2798 ----------------------------
2800 -- BASIC_DECLARATION ::=
2801 -- TYPE_DECLARATION | SUBTYPE_DECLARATION
2802 -- | OBJECT_DECLARATION | NUMBER_DECLARATION
2803 -- | SUBPROGRAM_DECLARATION | ABSTRACT_SUBPROGRAM_DECLARATION
2804 -- | PACKAGE_DECLARATION | RENAMING_DECLARATION
2805 -- | EXCEPTION_DECLARATION | GENERIC_DECLARATION
2806 -- | GENERIC_INSTANTIATION
2808 -- Basic declaration also includes IMPLICIT_LABEL_DECLARATION
2809 -- see further description in section on semantic nodes.
2811 -- Also, in the tree that is constructed, a pragma may appear
2812 -- anywhere that a declaration may appear.
2814 ------------------------------
2815 -- 3.1 Defining Identifier --
2816 ------------------------------
2818 -- DEFINING_IDENTIFIER ::= IDENTIFIER
2820 -- A defining identifier is an entity, which has additional fields
2821 -- depending on the setting of the Ekind field. These additional
2822 -- fields are defined (and access subprograms declared) in package
2823 -- Einfo.
2825 -- N_Defining_Identifier
2826 -- Sloc points to identifier
2827 -- Chars contains the Name_Id for the identifier
2828 -- Next_Entity
2829 -- Scope
2830 -- Etype
2832 -----------------------------
2833 -- 3.2.1 Type Declaration --
2834 -----------------------------
2836 -- TYPE_DECLARATION ::=
2837 -- FULL_TYPE_DECLARATION
2838 -- | INCOMPLETE_TYPE_DECLARATION
2839 -- | PRIVATE_TYPE_DECLARATION
2840 -- | PRIVATE_EXTENSION_DECLARATION
2842 ----------------------------------
2843 -- 3.2.1 Full Type Declaration --
2844 ----------------------------------
2846 -- FULL_TYPE_DECLARATION ::=
2847 -- type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
2848 -- is TYPE_DEFINITION
2849 -- [ASPECT_SPECIFICATIONS];
2850 -- | TASK_TYPE_DECLARATION
2851 -- | PROTECTED_TYPE_DECLARATION
2853 -- The full type declaration node is used only for the first case. The
2854 -- second case (concurrent type declaration), is represented directly
2855 -- by a task type declaration or a protected type declaration.
2857 -- N_Full_Type_Declaration
2858 -- Sloc points to TYPE
2859 -- Defining_Identifier
2860 -- Incomplete_View
2861 -- Discriminant_Specifications (set to No_List if none)
2862 -- Type_Definition
2863 -- Discr_Check_Funcs_Built
2865 ----------------------------
2866 -- 3.2.1 Type Definition --
2867 ----------------------------
2869 -- TYPE_DEFINITION ::=
2870 -- ENUMERATION_TYPE_DEFINITION | INTEGER_TYPE_DEFINITION
2871 -- | REAL_TYPE_DEFINITION | ARRAY_TYPE_DEFINITION
2872 -- | RECORD_TYPE_DEFINITION | ACCESS_TYPE_DEFINITION
2873 -- | DERIVED_TYPE_DEFINITION | INTERFACE_TYPE_DEFINITION
2875 --------------------------------
2876 -- 3.2.2 Subtype Declaration --
2877 --------------------------------
2879 -- SUBTYPE_DECLARATION ::=
2880 -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION
2881 -- [ASPECT_SPECIFICATIONS];
2883 -- The subtype indication field is set to Empty for subtypes
2884 -- declared in package Standard (Positive, Natural).
2886 -- N_Subtype_Declaration
2887 -- Sloc points to SUBTYPE
2888 -- Defining_Identifier
2889 -- Null_Exclusion_Present
2890 -- Subtype_Indication
2891 -- Generic_Parent_Type (for actual of formal private or derived type)
2892 -- Exception_Junk
2894 -------------------------------
2895 -- 3.2.2 Subtype Indication --
2896 -------------------------------
2898 -- SUBTYPE_INDICATION ::= SUBTYPE_MARK [CONSTRAINT]
2900 -- Note: if no constraint is present, the subtype indication appears
2901 -- directly in the tree as a subtype mark. The N_Subtype_Indication
2902 -- node is used only if a constraint is present.
2904 -- Note: [For Ada 2005 (AI-231)]: Because Ada 2005 extends this rule
2905 -- with the null-exclusion part (see AI-231), we had to introduce a new
2906 -- attribute in all the parents of subtype_indication nodes to indicate
2907 -- if the null-exclusion is present.
2909 -- Note: the reason that this node has expression fields is that a
2910 -- subtype indication can appear as an operand of a membership test.
2912 -- N_Subtype_Indication
2913 -- Sloc points to first token of subtype mark
2914 -- Subtype_Mark
2915 -- Constraint
2916 -- Etype
2917 -- Must_Not_Freeze
2919 -- Note: Depending on context, the Etype is either the entity of the
2920 -- Subtype_Mark field, or it is an itype constructed to reify the
2921 -- subtype indication. In particular, such itypes are created for a
2922 -- subtype indication that appears in an array type declaration. This
2923 -- simplifies constraint checking in indexed components.
2925 -- For subtype indications that appear in scalar type and subtype
2926 -- declarations, the Etype is the entity of the subtype mark.
2928 -------------------------
2929 -- 3.2.2 Subtype Mark --
2930 -------------------------
2932 -- SUBTYPE_MARK ::= subtype_NAME
2934 -----------------------
2935 -- 3.2.2 Constraint --
2936 -----------------------
2938 -- CONSTRAINT ::= SCALAR_CONSTRAINT | COMPOSITE_CONSTRAINT
2940 ------------------------------
2941 -- 3.2.2 Scalar Constraint --
2942 ------------------------------
2944 -- SCALAR_CONSTRAINT ::=
2945 -- RANGE_CONSTRAINT | DIGITS_CONSTRAINT | DELTA_CONSTRAINT
2947 ---------------------------------
2948 -- 3.2.2 Composite Constraint --
2949 ---------------------------------
2951 -- COMPOSITE_CONSTRAINT ::=
2952 -- INDEX_CONSTRAINT | DISCRIMINANT_CONSTRAINT
2954 -------------------------------
2955 -- 3.3.1 Object Declaration --
2956 -------------------------------
2958 -- OBJECT_DECLARATION ::=
2959 -- DEFINING_IDENTIFIER_LIST : [aliased] [constant]
2960 -- [NULL_EXCLUSION] SUBTYPE_INDICATION [:= EXPRESSION]
2961 -- [ASPECT_SPECIFICATIONS];
2962 -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant]
2963 -- ACCESS_DEFINITION [:= EXPRESSION]
2964 -- [ASPECT_SPECIFICATIONS];
2965 -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant]
2966 -- ARRAY_TYPE_DEFINITION [:= EXPRESSION]
2967 -- [ASPECT_SPECIFICATIONS];
2968 -- | SINGLE_TASK_DECLARATION
2969 -- | SINGLE_PROTECTED_DECLARATION
2971 -- Note: aliased is not permitted in Ada 83 mode
2973 -- The N_Object_Declaration node is only for the first three cases.
2974 -- Single task declaration is handled by P_Task (9.1)
2975 -- Single protected declaration is handled by P_protected (9.5)
2977 -- Although the syntax allows multiple identifiers in the list, the
2978 -- semantics is as though successive declarations were given with
2979 -- identical type definition and expression components. To simplify
2980 -- semantic processing, the parser represents a multiple declaration
2981 -- case as a sequence of single declarations, using the More_Ids and
2982 -- Prev_Ids flags to preserve the original source form as described
2983 -- in the section on "Handling of Defining Identifier Lists".
2985 -- The flag Has_Init_Expression is set if an initializing expression
2986 -- is present. Normally it is set if and only if Expression contains
2987 -- a non-empty value, but there is an exception to this. When the
2988 -- initializing expression is an aggregate which requires explicit
2989 -- assignments, the Expression field gets set to Empty, but this flag
2990 -- is still set, so we don't forget we had an initializing expression.
2992 -- Note: if a range check is required for the initialization
2993 -- expression then the Do_Range_Check flag is set in the Expression,
2994 -- with the check being done against the type given by the object
2995 -- definition, which is also the Etype of the defining identifier.
2997 -- Note: the contents of the Expression field must be ignored (i.e.
2998 -- treated as though it were Empty) if No_Initialization is set True.
3000 -- Note: the back end places some restrictions on the form of the
3001 -- Expression field. If the object being declared is Atomic, then
3002 -- the Expression may not have the form of an aggregate (since this
3003 -- might cause the back end to generate separate assignments). In this
3004 -- case the front end must generate an extra temporary and initialize
3005 -- this temporary as required (the temporary itself is not atomic).
3007 -- Note: there is no node kind for object definition. Instead, the
3008 -- corresponding field holds a subtype indication, an array type
3009 -- definition, or (Ada 2005, AI-406) an access definition.
3011 -- N_Object_Declaration
3012 -- Sloc points to first identifier
3013 -- Defining_Identifier
3014 -- Aliased_Present
3015 -- Constant_Present set if CONSTANT appears
3016 -- Null_Exclusion_Present
3017 -- Object_Definition subtype indic./array type def./access def.
3018 -- Expression (set to Empty if not present)
3019 -- Handler_List_Entry
3020 -- Corresponding_Generic_Association
3021 -- More_Ids (set to False if no more identifiers in list)
3022 -- Prev_Ids (set to False if no previous identifiers in list)
3023 -- No_Initialization
3024 -- Assignment_OK
3025 -- Exception_Junk
3026 -- Is_Subprogram_Descriptor
3027 -- Has_Init_Expression
3028 -- Suppress_Assignment_Checks
3030 -------------------------------------
3031 -- 3.3.1 Defining Identifier List --
3032 -------------------------------------
3034 -- DEFINING_IDENTIFIER_LIST ::=
3035 -- DEFINING_IDENTIFIER {, DEFINING_IDENTIFIER}
3037 -------------------------------
3038 -- 3.3.2 Number Declaration --
3039 -------------------------------
3041 -- NUMBER_DECLARATION ::=
3042 -- DEFINING_IDENTIFIER_LIST : constant := static_EXPRESSION;
3044 -- Although the syntax allows multiple identifiers in the list, the
3045 -- semantics is as though successive declarations were given with
3046 -- identical expressions. To simplify semantic processing, the parser
3047 -- represents a multiple declaration case as a sequence of single
3048 -- declarations, using the More_Ids and Prev_Ids flags to preserve
3049 -- the original source form as described in the section on "Handling
3050 -- of Defining Identifier Lists".
3052 -- N_Number_Declaration
3053 -- Sloc points to first identifier
3054 -- Defining_Identifier
3055 -- Expression
3056 -- More_Ids (set to False if no more identifiers in list)
3057 -- Prev_Ids (set to False if no previous identifiers in list)
3059 ----------------------------------
3060 -- 3.4 Derived Type Definition --
3061 ----------------------------------
3063 -- DERIVED_TYPE_DEFINITION ::=
3064 -- [abstract] [limited] new [NULL_EXCLUSION] parent_SUBTYPE_INDICATION
3065 -- [[and INTERFACE_LIST] RECORD_EXTENSION_PART]
3067 -- Note: ABSTRACT, LIMITED, and record extension part are not permitted
3068 -- in Ada 83 mode.
3070 -- Note: a record extension part is required if ABSTRACT is present
3072 -- N_Derived_Type_Definition
3073 -- Sloc points to NEW
3074 -- Abstract_Present
3075 -- Null_Exclusion_Present (set to False if not present)
3076 -- Subtype_Indication
3077 -- Record_Extension_Part (set to Empty if not present)
3078 -- Limited_Present
3079 -- Task_Present set in task interfaces
3080 -- Protected_Present set in protected interfaces
3081 -- Synchronized_Present set in interfaces
3082 -- Interface_List (set to No_List if none)
3083 -- Interface_Present set in abstract interfaces
3085 -- Note: Task_Present, Protected_Present, Synchronized_Present,
3086 -- Interface_List, and Interface_Present are used for abstract
3087 -- interfaces (see comments for INTERFACE_TYPE_DEFINITION).
3089 ---------------------------
3090 -- 3.5 Range Constraint --
3091 ---------------------------
3093 -- RANGE_CONSTRAINT ::= range RANGE
3095 -- N_Range_Constraint
3096 -- Sloc points to RANGE
3097 -- Range_Expression
3099 ----------------
3100 -- 3.5 Range --
3101 ----------------
3103 -- RANGE ::=
3104 -- RANGE_ATTRIBUTE_REFERENCE
3105 -- | SIMPLE_EXPRESSION .. SIMPLE_EXPRESSION
3107 -- Note: the case of a range given as a range attribute reference
3108 -- appears directly in the tree as an attribute reference.
3110 -- Note: the field name for a reference to a range is Range_Expression
3111 -- rather than Range, because range is a reserved keyword in Ada.
3113 -- Note: the reason that this node has expression fields is that a
3114 -- range can appear as an operand of a membership test. The Etype
3115 -- field is the type of the range (we do NOT construct an implicit
3116 -- subtype to represent the range exactly).
3118 -- N_Range
3119 -- Sloc points to ..
3120 -- Low_Bound
3121 -- High_Bound
3122 -- Cannot_Be_Superflat
3123 -- Includes_Infinities
3124 -- plus fields for expression
3126 -- Note: if the range appears in a context, such as a subtype
3127 -- declaration, where range checks are required on one or both of
3128 -- the expression fields, then type conversion nodes are inserted
3129 -- to represent the required checks.
3131 ----------------------------------------
3132 -- 3.5.1 Enumeration Type Definition --
3133 ----------------------------------------
3135 -- ENUMERATION_TYPE_DEFINITION ::=
3136 -- (ENUMERATION_LITERAL_SPECIFICATION
3137 -- {, ENUMERATION_LITERAL_SPECIFICATION})
3139 -- Note: the Literals field in the node described below is null for
3140 -- the case of the standard types CHARACTER and WIDE_CHARACTER, for
3141 -- which special processing handles these types as special cases.
3143 -- N_Enumeration_Type_Definition
3144 -- Sloc points to left parenthesis
3145 -- Literals (Empty for CHARACTER or WIDE_CHARACTER)
3146 -- End_Label (set to Empty if internally generated record)
3148 ----------------------------------------------
3149 -- 3.5.1 Enumeration Literal Specification --
3150 ----------------------------------------------
3152 -- ENUMERATION_LITERAL_SPECIFICATION ::=
3153 -- DEFINING_IDENTIFIER | DEFINING_CHARACTER_LITERAL
3155 ---------------------------------------
3156 -- 3.5.1 Defining Character Literal --
3157 ---------------------------------------
3159 -- DEFINING_CHARACTER_LITERAL ::= CHARACTER_LITERAL
3161 -- A defining character literal is an entity, which has additional
3162 -- fields depending on the setting of the Ekind field. These
3163 -- additional fields are defined (and access subprograms declared)
3164 -- in package Einfo.
3166 -- N_Defining_Character_Literal
3167 -- Sloc points to literal
3168 -- Chars contains the Name_Id for the identifier
3169 -- Next_Entity
3170 -- Scope
3171 -- Etype
3173 ------------------------------------
3174 -- 3.5.4 Integer Type Definition --
3175 ------------------------------------
3177 -- Note: there is an error in this rule in the latest version of the
3178 -- grammar, so we have retained the old rule pending clarification.
3180 -- INTEGER_TYPE_DEFINITION ::=
3181 -- SIGNED_INTEGER_TYPE_DEFINITION
3182 -- | MODULAR_TYPE_DEFINITION
3184 -------------------------------------------
3185 -- 3.5.4 Signed Integer Type Definition --
3186 -------------------------------------------
3188 -- SIGNED_INTEGER_TYPE_DEFINITION ::=
3189 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
3191 -- Note: the Low_Bound and High_Bound fields are set to Empty
3192 -- for integer types defined in package Standard.
3194 -- N_Signed_Integer_Type_Definition
3195 -- Sloc points to RANGE
3196 -- Low_Bound
3197 -- High_Bound
3199 ------------------------------------
3200 -- 3.5.4 Modular Type Definition --
3201 ------------------------------------
3203 -- MODULAR_TYPE_DEFINITION ::= mod static_EXPRESSION
3205 -- N_Modular_Type_Definition
3206 -- Sloc points to MOD
3207 -- Expression
3209 ---------------------------------
3210 -- 3.5.6 Real Type Definition --
3211 ---------------------------------
3213 -- REAL_TYPE_DEFINITION ::=
3214 -- FLOATING_POINT_DEFINITION | FIXED_POINT_DEFINITION
3216 --------------------------------------
3217 -- 3.5.7 Floating Point Definition --
3218 --------------------------------------
3220 -- FLOATING_POINT_DEFINITION ::=
3221 -- digits static_SIMPLE_EXPRESSION [REAL_RANGE_SPECIFICATION]
3223 -- Note: The Digits_Expression and Real_Range_Specifications fields
3224 -- are set to Empty for floating-point types declared in Standard.
3226 -- N_Floating_Point_Definition
3227 -- Sloc points to DIGITS
3228 -- Digits_Expression
3229 -- Real_Range_Specification (set to Empty if not present)
3231 -------------------------------------
3232 -- 3.5.7 Real Range Specification --
3233 -------------------------------------
3235 -- REAL_RANGE_SPECIFICATION ::=
3236 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
3238 -- N_Real_Range_Specification
3239 -- Sloc points to RANGE
3240 -- Low_Bound
3241 -- High_Bound
3243 -----------------------------------
3244 -- 3.5.9 Fixed Point Definition --
3245 -----------------------------------
3247 -- FIXED_POINT_DEFINITION ::=
3248 -- ORDINARY_FIXED_POINT_DEFINITION | DECIMAL_FIXED_POINT_DEFINITION
3250 --------------------------------------------
3251 -- 3.5.9 Ordinary Fixed Point Definition --
3252 --------------------------------------------
3254 -- ORDINARY_FIXED_POINT_DEFINITION ::=
3255 -- delta static_EXPRESSION REAL_RANGE_SPECIFICATION
3257 -- Note: In Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
3259 -- N_Ordinary_Fixed_Point_Definition
3260 -- Sloc points to DELTA
3261 -- Delta_Expression
3262 -- Real_Range_Specification
3264 -------------------------------------------
3265 -- 3.5.9 Decimal Fixed Point Definition --
3266 -------------------------------------------
3268 -- DECIMAL_FIXED_POINT_DEFINITION ::=
3269 -- delta static_EXPRESSION
3270 -- digits static_EXPRESSION [REAL_RANGE_SPECIFICATION]
3272 -- Note: decimal types are not permitted in Ada 83 mode
3274 -- N_Decimal_Fixed_Point_Definition
3275 -- Sloc points to DELTA
3276 -- Delta_Expression
3277 -- Digits_Expression
3278 -- Real_Range_Specification (set to Empty if not present)
3280 ------------------------------
3281 -- 3.5.9 Digits Constraint --
3282 ------------------------------
3284 -- DIGITS_CONSTRAINT ::=
3285 -- digits static_EXPRESSION [RANGE_CONSTRAINT]
3287 -- Note: in Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
3288 -- Note: in Ada 95, reduced accuracy subtypes are obsolescent
3290 -- N_Digits_Constraint
3291 -- Sloc points to DIGITS
3292 -- Digits_Expression
3293 -- Range_Constraint (set to Empty if not present)
3295 --------------------------------
3296 -- 3.6 Array Type Definition --
3297 --------------------------------
3299 -- ARRAY_TYPE_DEFINITION ::=
3300 -- UNCONSTRAINED_ARRAY_DEFINITION | CONSTRAINED_ARRAY_DEFINITION
3302 -----------------------------------------
3303 -- 3.6 Unconstrained Array Definition --
3304 -----------------------------------------
3306 -- UNCONSTRAINED_ARRAY_DEFINITION ::=
3307 -- array (INDEX_SUBTYPE_DEFINITION {, INDEX_SUBTYPE_DEFINITION}) of
3308 -- COMPONENT_DEFINITION
3310 -- Note: dimensionality of array is indicated by number of entries in
3311 -- the Subtype_Marks list, which has one entry for each dimension.
3313 -- N_Unconstrained_Array_Definition
3314 -- Sloc points to ARRAY
3315 -- Subtype_Marks
3316 -- Component_Definition
3318 -----------------------------------
3319 -- 3.6 Index Subtype Definition --
3320 -----------------------------------
3322 -- INDEX_SUBTYPE_DEFINITION ::= SUBTYPE_MARK range <>
3324 -- There is no explicit node in the tree for an index subtype
3325 -- definition since the N_Unconstrained_Array_Definition node
3326 -- incorporates the type marks which appear in this context.
3328 ---------------------------------------
3329 -- 3.6 Constrained Array Definition --
3330 ---------------------------------------
3332 -- CONSTRAINED_ARRAY_DEFINITION ::=
3333 -- array (DISCRETE_SUBTYPE_DEFINITION
3334 -- {, DISCRETE_SUBTYPE_DEFINITION})
3335 -- of COMPONENT_DEFINITION
3337 -- Note: dimensionality of array is indicated by number of entries
3338 -- in the Discrete_Subtype_Definitions list, which has one entry
3339 -- for each dimension.
3341 -- N_Constrained_Array_Definition
3342 -- Sloc points to ARRAY
3343 -- Discrete_Subtype_Definitions
3344 -- Component_Definition
3346 -- Note: although the language allows the full syntax for discrete
3347 -- subtype definitions (i.e. a discrete subtype indication or a range),
3348 -- in the generated tree, we always rewrite these as N_Range nodes.
3350 --------------------------------------
3351 -- 3.6 Discrete Subtype Definition --
3352 --------------------------------------
3354 -- DISCRETE_SUBTYPE_DEFINITION ::=
3355 -- discrete_SUBTYPE_INDICATION | RANGE
3357 -------------------------------
3358 -- 3.6 Component Definition --
3359 -------------------------------
3361 -- COMPONENT_DEFINITION ::=
3362 -- [aliased] [NULL_EXCLUSION] SUBTYPE_INDICATION | ACCESS_DEFINITION
3364 -- Note: although the syntax does not permit a component definition to
3365 -- be an anonymous array (and the parser will diagnose such an attempt
3366 -- with an appropriate message), it is possible for anonymous arrays
3367 -- to appear as component definitions. The semantics and back end handle
3368 -- this case properly, and the expander in fact generates such cases.
3369 -- Access_Definition is an optional field that gives support to
3370 -- Ada 2005 (AI-230). The parser generates nodes that have either the
3371 -- Subtype_Indication field or else the Access_Definition field.
3373 -- N_Component_Definition
3374 -- Sloc points to ALIASED, ACCESS, or to first token of subtype mark
3375 -- Aliased_Present
3376 -- Null_Exclusion_Present
3377 -- Subtype_Indication (set to Empty if not present)
3378 -- Access_Definition (set to Empty if not present)
3380 -----------------------------
3381 -- 3.6.1 Index Constraint --
3382 -----------------------------
3384 -- INDEX_CONSTRAINT ::= (DISCRETE_RANGE {, DISCRETE_RANGE})
3386 -- It is not in general possible to distinguish between discriminant
3387 -- constraints and index constraints at parse time, since a simple
3388 -- name could be either the subtype mark of a discrete range, or an
3389 -- expression in a discriminant association with no name. Either
3390 -- entry appears simply as the name, and the semantic parse must
3391 -- distinguish between the two cases. Thus we use a common tree
3392 -- node format for both of these constraint types.
3394 -- See Discriminant_Constraint for format of node
3396 ---------------------------
3397 -- 3.6.1 Discrete Range --
3398 ---------------------------
3400 -- DISCRETE_RANGE ::= discrete_SUBTYPE_INDICATION | RANGE
3402 ----------------------------
3403 -- 3.7 Discriminant Part --
3404 ----------------------------
3406 -- DISCRIMINANT_PART ::=
3407 -- UNKNOWN_DISCRIMINANT_PART | KNOWN_DISCRIMINANT_PART
3409 ------------------------------------
3410 -- 3.7 Unknown Discriminant Part --
3411 ------------------------------------
3413 -- UNKNOWN_DISCRIMINANT_PART ::= (<>)
3415 -- Note: unknown discriminant parts are not permitted in Ada 83 mode
3417 -- There is no explicit node in the tree for an unknown discriminant
3418 -- part. Instead the Unknown_Discriminants_Present flag is set in the
3419 -- parent node.
3421 ----------------------------------
3422 -- 3.7 Known Discriminant Part --
3423 ----------------------------------
3425 -- KNOWN_DISCRIMINANT_PART ::=
3426 -- (DISCRIMINANT_SPECIFICATION {; DISCRIMINANT_SPECIFICATION})
3428 -------------------------------------
3429 -- 3.7 Discriminant Specification --
3430 -------------------------------------
3432 -- DISCRIMINANT_SPECIFICATION ::=
3433 -- DEFINING_IDENTIFIER_LIST : [NULL_EXCLUSION] SUBTYPE_MARK
3434 -- [:= DEFAULT_EXPRESSION]
3435 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
3436 -- [:= DEFAULT_EXPRESSION]
3438 -- Although the syntax allows multiple identifiers in the list, the
3439 -- semantics is as though successive specifications were given with
3440 -- identical type definition and expression components. To simplify
3441 -- semantic processing, the parser represents a multiple declaration
3442 -- case as a sequence of single specifications, using the More_Ids and
3443 -- Prev_Ids flags to preserve the original source form as described
3444 -- in the section on "Handling of Defining Identifier Lists".
3446 -- N_Discriminant_Specification
3447 -- Sloc points to first identifier
3448 -- Defining_Identifier
3449 -- Null_Exclusion_Present
3450 -- Discriminant_Type subtype mark or access parameter definition
3451 -- Expression (set to Empty if no default expression)
3452 -- More_Ids (set to False if no more identifiers in list)
3453 -- Prev_Ids (set to False if no previous identifiers in list)
3455 -----------------------------
3456 -- 3.7 Default Expression --
3457 -----------------------------
3459 -- DEFAULT_EXPRESSION ::= EXPRESSION
3461 ------------------------------------
3462 -- 3.7.1 Discriminant Constraint --
3463 ------------------------------------
3465 -- DISCRIMINANT_CONSTRAINT ::=
3466 -- (DISCRIMINANT_ASSOCIATION {, DISCRIMINANT_ASSOCIATION})
3468 -- It is not in general possible to distinguish between discriminant
3469 -- constraints and index constraints at parse time, since a simple
3470 -- name could be either the subtype mark of a discrete range, or an
3471 -- expression in a discriminant association with no name. Either
3472 -- entry appears simply as the name, and the semantic parse must
3473 -- distinguish between the two cases. Thus we use a common tree
3474 -- node format for both of these constraint types.
3476 -- N_Index_Or_Discriminant_Constraint
3477 -- Sloc points to left paren
3478 -- Constraints points to list of discrete ranges or
3479 -- discriminant associations
3481 -------------------------------------
3482 -- 3.7.1 Discriminant Association --
3483 -------------------------------------
3485 -- DISCRIMINANT_ASSOCIATION ::=
3486 -- [discriminant_SELECTOR_NAME
3487 -- {| discriminant_SELECTOR_NAME} =>] EXPRESSION
3489 -- Note: a discriminant association that has no selector name list
3490 -- appears directly as an expression in the tree.
3492 -- N_Discriminant_Association
3493 -- Sloc points to first token of discriminant association
3494 -- Selector_Names (always non-empty, since if no selector
3495 -- names are present, this node is not used, see comment above)
3496 -- Expression
3498 ---------------------------------
3499 -- 3.8 Record Type Definition --
3500 ---------------------------------
3502 -- RECORD_TYPE_DEFINITION ::=
3503 -- [[abstract] tagged] [limited] RECORD_DEFINITION
3505 -- Note: ABSTRACT, TAGGED, LIMITED are not permitted in Ada 83 mode
3507 -- There is no explicit node in the tree for a record type definition.
3508 -- Instead the flags for Tagged_Present and Limited_Present appear in
3509 -- the N_Record_Definition node for a record definition appearing in
3510 -- the context of a record type definition.
3512 ----------------------------
3513 -- 3.8 Record Definition --
3514 ----------------------------
3516 -- RECORD_DEFINITION ::=
3517 -- record
3518 -- COMPONENT_LIST
3519 -- end record
3520 -- | null record
3522 -- Note: the Abstract_Present, Tagged_Present, and Limited_Present
3523 -- flags appear only for a record definition appearing in a record
3524 -- type definition.
3526 -- Note: the NULL RECORD case is not permitted in Ada 83
3528 -- N_Record_Definition
3529 -- Sloc points to RECORD or NULL
3530 -- End_Label (set to Empty if internally generated record)
3531 -- Abstract_Present
3532 -- Tagged_Present
3533 -- Limited_Present
3534 -- Component_List empty in null record case
3535 -- Null_Present set in null record case
3536 -- Task_Present set in task interfaces
3537 -- Protected_Present set in protected interfaces
3538 -- Synchronized_Present set in interfaces
3539 -- Interface_Present set in abstract interfaces
3540 -- Interface_List (set to No_List if none)
3542 -- Note: Task_Present, Protected_Present, Synchronized _Present,
3543 -- Interface_List and Interface_Present are used for abstract
3544 -- interfaces (see comments for INTERFACE_TYPE_DEFINITION).
3546 -------------------------
3547 -- 3.8 Component List --
3548 -------------------------
3550 -- COMPONENT_LIST ::=
3551 -- COMPONENT_ITEM {COMPONENT_ITEM}
3552 -- | {COMPONENT_ITEM} VARIANT_PART
3553 -- | null;
3555 -- N_Component_List
3556 -- Sloc points to first token of component list
3557 -- Component_Items
3558 -- Variant_Part (set to Empty if no variant part)
3559 -- Null_Present
3561 -------------------------
3562 -- 3.8 Component Item --
3563 -------------------------
3565 -- COMPONENT_ITEM ::= COMPONENT_DECLARATION | REPRESENTATION_CLAUSE
3567 -- Note: A component item can also be a pragma, and in the tree
3568 -- that is obtained after semantic processing, a component item
3569 -- can be an N_Null node resulting from a non-recognized pragma.
3571 --------------------------------
3572 -- 3.8 Component Declaration --
3573 --------------------------------
3575 -- COMPONENT_DECLARATION ::=
3576 -- DEFINING_IDENTIFIER_LIST : COMPONENT_DEFINITION
3577 -- [:= DEFAULT_EXPRESSION]
3578 -- [ASPECT_SPECIFICATIONS];
3580 -- Note: although the syntax does not permit a component definition to
3581 -- be an anonymous array (and the parser will diagnose such an attempt
3582 -- with an appropriate message), it is possible for anonymous arrays
3583 -- to appear as component definitions. The semantics and back end handle
3584 -- this case properly, and the expander in fact generates such cases.
3586 -- Although the syntax allows multiple identifiers in the list, the
3587 -- semantics is as though successive declarations were given with the
3588 -- same component definition and expression components. To simplify
3589 -- semantic processing, the parser represents a multiple declaration
3590 -- case as a sequence of single declarations, using the More_Ids and
3591 -- Prev_Ids flags to preserve the original source form as described
3592 -- in the section on "Handling of Defining Identifier Lists".
3594 -- N_Component_Declaration
3595 -- Sloc points to first identifier
3596 -- Defining_Identifier
3597 -- Component_Definition
3598 -- Expression (set to Empty if no default expression)
3599 -- More_Ids (set to False if no more identifiers in list)
3600 -- Prev_Ids (set to False if no previous identifiers in list)
3602 -------------------------
3603 -- 3.8.1 Variant Part --
3604 -------------------------
3606 -- VARIANT_PART ::=
3607 -- case discriminant_DIRECT_NAME is
3608 -- VARIANT {VARIANT}
3609 -- end case;
3611 -- Note: the variants list can contain pragmas as well as variants.
3612 -- In a properly formed program there is at least one variant.
3614 -- N_Variant_Part
3615 -- Sloc points to CASE
3616 -- Name
3617 -- Variants
3619 --------------------
3620 -- 3.8.1 Variant --
3621 --------------------
3623 -- VARIANT ::=
3624 -- when DISCRETE_CHOICE_LIST =>
3625 -- COMPONENT_LIST
3627 -- N_Variant
3628 -- Sloc points to WHEN
3629 -- Discrete_Choices
3630 -- Component_List
3631 -- Enclosing_Variant
3632 -- Present_Expr
3633 -- Dcheck_Function
3634 -- Has_SP_Choice
3636 -- Note: in the list of Discrete_Choices, the tree passed to the back
3637 -- end does not have choice entries corresponding to names of statically
3638 -- predicated subtypes. Such entries are always expanded out to the list
3639 -- of equivalent values or ranges.
3641 ---------------------------------
3642 -- 3.8.1 Discrete Choice List --
3643 ---------------------------------
3645 -- DISCRETE_CHOICE_LIST ::= DISCRETE_CHOICE {| DISCRETE_CHOICE}
3647 ----------------------------
3648 -- 3.8.1 Discrete Choice --
3649 ----------------------------
3651 -- DISCRETE_CHOICE ::= EXPRESSION | DISCRETE_RANGE | others
3653 -- Note: in Ada 83 mode, the expression must be a simple expression
3655 -- The only choice that appears explicitly is the OTHERS choice, as
3656 -- defined here. Other cases of discrete choice (expression and
3657 -- discrete range) appear directly. This production is also used
3658 -- for the OTHERS possibility of an exception choice.
3660 -- Note: in accordance with the syntax, the parser does not check that
3661 -- OTHERS appears at the end on its own in a choice list context. This
3662 -- is a semantic check.
3664 -- N_Others_Choice
3665 -- Sloc points to OTHERS
3666 -- Others_Discrete_Choices
3667 -- All_Others
3669 ----------------------------------
3670 -- 3.9.1 Record Extension Part --
3671 ----------------------------------
3673 -- RECORD_EXTENSION_PART ::= with RECORD_DEFINITION
3675 -- Note: record extension parts are not permitted in Ada 83 mode
3677 --------------------------------------
3678 -- 3.9.4 Interface Type Definition --
3679 --------------------------------------
3681 -- INTERFACE_TYPE_DEFINITION ::=
3682 -- [limited | task | protected | synchronized]
3683 -- interface [interface_list]
3685 -- Note: Interfaces are implemented with N_Record_Definition and
3686 -- N_Derived_Type_Definition nodes because most of the support
3687 -- for the analysis of abstract types has been reused to
3688 -- analyze abstract interfaces.
3690 ----------------------------------
3691 -- 3.10 Access Type Definition --
3692 ----------------------------------
3694 -- ACCESS_TYPE_DEFINITION ::=
3695 -- ACCESS_TO_OBJECT_DEFINITION
3696 -- | ACCESS_TO_SUBPROGRAM_DEFINITION
3698 --------------------------
3699 -- 3.10 Null Exclusion --
3700 --------------------------
3702 -- NULL_EXCLUSION ::= not null
3704 ---------------------------------------
3705 -- 3.10 Access To Object Definition --
3706 ---------------------------------------
3708 -- ACCESS_TO_OBJECT_DEFINITION ::=
3709 -- [NULL_EXCLUSION] access [GENERAL_ACCESS_MODIFIER]
3710 -- SUBTYPE_INDICATION
3712 -- N_Access_To_Object_Definition
3713 -- Sloc points to ACCESS
3714 -- All_Present
3715 -- Null_Exclusion_Present
3716 -- Null_Excluding_Subtype
3717 -- Subtype_Indication
3718 -- Constant_Present
3720 -----------------------------------
3721 -- 3.10 General Access Modifier --
3722 -----------------------------------
3724 -- GENERAL_ACCESS_MODIFIER ::= all | constant
3726 -- Note: general access modifiers are not permitted in Ada 83 mode
3728 -- There is no explicit node in the tree for general access modifier.
3729 -- Instead the All_Present or Constant_Present flags are set in the
3730 -- parent node.
3732 -------------------------------------------
3733 -- 3.10 Access To Subprogram Definition --
3734 -------------------------------------------
3736 -- ACCESS_TO_SUBPROGRAM_DEFINITION
3737 -- [NULL_EXCLUSION] access [protected] procedure PARAMETER_PROFILE
3738 -- | [NULL_EXCLUSION] access [protected] function
3739 -- PARAMETER_AND_RESULT_PROFILE
3741 -- Note: access to subprograms are not permitted in Ada 83 mode
3743 -- N_Access_Function_Definition
3744 -- Sloc points to ACCESS
3745 -- Null_Exclusion_Present
3746 -- Null_Exclusion_In_Return_Present
3747 -- Protected_Present
3748 -- Parameter_Specifications (set to No_List if no formal part)
3749 -- Result_Definition result subtype (subtype mark or access def)
3751 -- N_Access_Procedure_Definition
3752 -- Sloc points to ACCESS
3753 -- Null_Exclusion_Present
3754 -- Protected_Present
3755 -- Parameter_Specifications (set to No_List if no formal part)
3757 -----------------------------
3758 -- 3.10 Access Definition --
3759 -----------------------------
3761 -- ACCESS_DEFINITION ::=
3762 -- [NULL_EXCLUSION] access [GENERAL_ACCESS_MODIFIER] SUBTYPE_MARK
3763 -- | ACCESS_TO_SUBPROGRAM_DEFINITION
3765 -- Note: access to subprograms are an Ada 2005 (AI-254) extension
3767 -- N_Access_Definition
3768 -- Sloc points to ACCESS
3769 -- Null_Exclusion_Present
3770 -- All_Present
3771 -- Constant_Present
3772 -- Subtype_Mark
3773 -- Access_To_Subprogram_Definition (set to Empty if not present)
3775 -----------------------------------------
3776 -- 3.10.1 Incomplete Type Declaration --
3777 -----------------------------------------
3779 -- INCOMPLETE_TYPE_DECLARATION ::=
3780 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] [IS TAGGED];
3782 -- N_Incomplete_Type_Declaration
3783 -- Sloc points to TYPE
3784 -- Defining_Identifier
3785 -- Discriminant_Specifications (set to No_List if no
3786 -- discriminant part, or if the discriminant part is an
3787 -- unknown discriminant part)
3788 -- Premature_Use used for improved diagnostics.
3789 -- Unknown_Discriminants_Present set if (<>) discriminant
3790 -- Tagged_Present
3792 ----------------------------
3793 -- 3.11 Declarative Part --
3794 ----------------------------
3796 -- DECLARATIVE_PART ::= {DECLARATIVE_ITEM}
3798 -- Note: although the parser enforces the syntactic requirement that
3799 -- a declarative part can contain only declarations, the semantic
3800 -- processing may add statements to the list of actions in a
3801 -- declarative part, so the code generator should be prepared
3802 -- to accept a statement in this position.
3804 ----------------------------
3805 -- 3.11 Declarative Item --
3806 ----------------------------
3808 -- DECLARATIVE_ITEM ::= BASIC_DECLARATIVE_ITEM | BODY
3810 ----------------------------------
3811 -- 3.11 Basic Declarative Item --
3812 ----------------------------------
3814 -- BASIC_DECLARATIVE_ITEM ::=
3815 -- BASIC_DECLARATION | REPRESENTATION_CLAUSE | USE_CLAUSE
3817 ----------------
3818 -- 3.11 Body --
3819 ----------------
3821 -- BODY ::= PROPER_BODY | BODY_STUB
3823 -----------------------
3824 -- 3.11 Proper Body --
3825 -----------------------
3827 -- PROPER_BODY ::=
3828 -- SUBPROGRAM_BODY | PACKAGE_BODY | TASK_BODY | PROTECTED_BODY
3830 ---------------
3831 -- 4.1 Name --
3832 ---------------
3834 -- NAME ::=
3835 -- DIRECT_NAME | EXPLICIT_DEREFERENCE
3836 -- | INDEXED_COMPONENT | SLICE
3837 -- | SELECTED_COMPONENT | ATTRIBUTE_REFERENCE
3838 -- | TYPE_CONVERSION | FUNCTION_CALL
3839 -- | CHARACTER_LITERAL
3841 ----------------------
3842 -- 4.1 Direct Name --
3843 ----------------------
3845 -- DIRECT_NAME ::= IDENTIFIER | OPERATOR_SYMBOL
3847 -----------------
3848 -- 4.1 Prefix --
3849 -----------------
3851 -- PREFIX ::= NAME | IMPLICIT_DEREFERENCE
3853 -------------------------------
3854 -- 4.1 Explicit Dereference --
3855 -------------------------------
3857 -- EXPLICIT_DEREFERENCE ::= NAME . all
3859 -- N_Explicit_Dereference
3860 -- Sloc points to ALL
3861 -- Prefix
3862 -- Actual_Designated_Subtype
3863 -- Has_Dereference_Action
3864 -- Atomic_Sync_Required
3865 -- plus fields for expression
3867 -------------------------------
3868 -- 4.1 Implicit Dereference --
3869 -------------------------------
3871 -- IMPLICIT_DEREFERENCE ::= NAME
3873 ------------------------------
3874 -- 4.1.1 Indexed Component --
3875 ------------------------------
3877 -- INDEXED_COMPONENT ::= PREFIX (EXPRESSION {, EXPRESSION})
3879 -- Note: the parser may generate this node in some situations where it
3880 -- should be a function call. The semantic pass must correct this
3881 -- misidentification (which is inevitable at the parser level).
3883 -- N_Indexed_Component
3884 -- Sloc contains a copy of the Sloc value of the Prefix
3885 -- Prefix
3886 -- Expressions
3887 -- Generalized_Indexing
3888 -- Atomic_Sync_Required
3889 -- plus fields for expression
3891 -- Note: if any of the subscripts requires a range check, then the
3892 -- Do_Range_Check flag is set on the corresponding expression, with
3893 -- the index type being determined from the type of the Prefix, which
3894 -- references the array being indexed.
3896 -- Note: in a fully analyzed and expanded indexed component node, and
3897 -- hence in any such node that gigi sees, if the prefix is an access
3898 -- type, then an explicit dereference operation has been inserted.
3900 ------------------
3901 -- 4.1.2 Slice --
3902 ------------------
3904 -- SLICE ::= PREFIX (DISCRETE_RANGE)
3906 -- Note: an implicit subtype is created to describe the resulting
3907 -- type, so that the bounds of this type are the bounds of the slice.
3909 -- N_Slice
3910 -- Sloc points to first token of prefix
3911 -- Prefix
3912 -- Discrete_Range
3913 -- plus fields for expression
3915 -------------------------------
3916 -- 4.1.3 Selected Component --
3917 -------------------------------
3919 -- SELECTED_COMPONENT ::= PREFIX . SELECTOR_NAME
3921 -- Note: selected components that are semantically expanded names get
3922 -- changed during semantic processing into the separate N_Expanded_Name
3923 -- node. See description of this node in the section on semantic nodes.
3925 -- N_Selected_Component
3926 -- Sloc points to the period
3927 -- Prefix
3928 -- Selector_Name
3929 -- Associated_Node
3930 -- Do_Discriminant_Check
3931 -- Is_In_Discriminant_Check
3932 -- Atomic_Sync_Required
3933 -- Is_Prefixed_Call
3934 -- plus fields for expression
3936 --------------------------
3937 -- 4.1.3 Selector Name --
3938 --------------------------
3940 -- SELECTOR_NAME ::= IDENTIFIER | CHARACTER_LITERAL | OPERATOR_SYMBOL
3942 --------------------------------
3943 -- 4.1.4 Attribute Reference --
3944 --------------------------------
3946 -- ATTRIBUTE_REFERENCE ::= PREFIX ' ATTRIBUTE_DESIGNATOR
3948 -- Note: the syntax is quite ambiguous at this point. Consider:
3950 -- A'Length (X) X is part of the attribute designator
3951 -- A'Pos (X) X is an explicit actual parameter of function A'Pos
3952 -- A'Class (X) X is the expression of a type conversion
3954 -- It would be possible for the parser to distinguish these cases
3955 -- by looking at the attribute identifier. However, that would mean
3956 -- more work in introducing new implementation defined attributes,
3957 -- and also it would mean that special processing for attributes
3958 -- would be scattered around, instead of being centralized in the
3959 -- semantic routine that handles an N_Attribute_Reference node.
3960 -- Consequently, the parser in all the above cases stores the
3961 -- expression (X in these examples) as a single element list in
3962 -- in the Expressions field of the N_Attribute_Reference node.
3964 -- Similarly, for attributes like Max which take two arguments,
3965 -- we store the two arguments as a two element list in the
3966 -- Expressions field. Of course it is clear at parse time that
3967 -- this case is really a function call with an attribute as the
3968 -- prefix, but it turns out to be convenient to handle the two
3969 -- argument case in a similar manner to the one argument case,
3970 -- and indeed in general the parser will accept any number of
3971 -- expressions in this position and store them as a list in the
3972 -- attribute reference node. This allows for future addition of
3973 -- attributes that take more than two arguments.
3975 -- Note: named associates are not permitted in function calls where
3976 -- the function is an attribute (see RM 6.4(3)) so it is legitimate
3977 -- to skip the normal subprogram argument processing.
3979 -- Note: for the attributes whose designators are technically keywords,
3980 -- i.e. digits, access, delta, range, the Attribute_Name field contains
3981 -- the corresponding name, even though no identifier is involved.
3983 -- Note: the generated code may contain stream attributes applied to
3984 -- limited types for which no stream routines exist officially. In such
3985 -- case, the result is to use the stream attribute for the underlying
3986 -- full type, or in the case of a protected type, the components
3987 -- (including any discriminants) are merely streamed in order.
3989 -- See Exp_Attr for a complete description of which attributes are
3990 -- passed onto Gigi, and which are handled entirely by the front end.
3992 -- Gigi restriction: For the Pos attribute, the prefix cannot be
3993 -- a non-standard enumeration type or a nonzero/zero semantics
3994 -- boolean type, so the value is simply the stored representation.
3996 -- Gigi requirement: For the Mechanism_Code attribute, if the prefix
3997 -- references a subprogram that is a renaming, then the front end must
3998 -- rewrite the attribute to refer directly to the renamed entity.
4000 -- Note: syntactically the prefix of an attribute reference must be a
4001 -- name, and this (somewhat artificial) requirement is enforced by the
4002 -- parser. However, for many attributes, such as 'Valid, it is quite
4003 -- reasonable to apply the attribute to any value, and hence to any
4004 -- expression. Internally in the tree, the prefix is an expression which
4005 -- does not have to be a name, and this is handled fine by the semantic
4006 -- analysis and expansion, and back ends. This arises for the case of
4007 -- attribute references built by the expander (e.g. 'Valid for the case
4008 -- of an implicit validity check).
4010 -- Note: In generated code, the Address and Unrestricted_Access
4011 -- attributes can be applied to any expression, and the meaning is
4012 -- to create an object containing the value (the object is in the
4013 -- current stack frame), and pass the address of this value. If the
4014 -- Must_Be_Byte_Aligned flag is set, then the object whose address
4015 -- is taken must be on a byte (storage unit) boundary, and if it is
4016 -- not (or may not be), then the generated code must create a copy
4017 -- that is byte aligned, and pass the address of this copy.
4019 -- N_Attribute_Reference
4020 -- Sloc points to apostrophe
4021 -- Prefix (general expression, see note above)
4022 -- Attribute_Name identifier name from attribute designator
4023 -- Expressions (set to No_List if no associated expressions)
4024 -- Entity used if the attribute yields a type
4025 -- Associated_Node
4026 -- Is_Elaboration_Checks_OK_Node
4027 -- Is_SPARK_Mode_On_Node
4028 -- Is_Elaboration_Warnings_OK_Node
4029 -- Header_Size_Added
4030 -- Redundant_Use
4031 -- Must_Be_Byte_Aligned
4032 -- plus fields for expression
4034 -- Note: in Modify_Tree_For_C mode, Max and Min attributes are expanded
4035 -- into equivalent if expressions, properly taking care of side effects.
4037 ---------------------------------
4038 -- 4.1.4 Attribute Designator --
4039 ---------------------------------
4041 -- ATTRIBUTE_DESIGNATOR ::=
4042 -- IDENTIFIER [(static_EXPRESSION)]
4043 -- | access | delta | digits
4045 -- There is no explicit node in the tree for an attribute designator.
4046 -- Instead the Attribute_Name and Expressions fields of the parent
4047 -- node (N_Attribute_Reference node) hold the information.
4049 -- Note: if ACCESS, DELTA, or DIGITS appears in an attribute
4050 -- designator, then they are treated as identifiers internally
4051 -- rather than the keywords of the same name.
4053 --------------------------------------
4054 -- 4.1.4 Range Attribute Reference --
4055 --------------------------------------
4057 -- RANGE_ATTRIBUTE_REFERENCE ::= PREFIX ' RANGE_ATTRIBUTE_DESIGNATOR
4059 -- A range attribute reference is represented in the tree using the
4060 -- normal N_Attribute_Reference node.
4062 ---------------------------------------
4063 -- 4.1.4 Range Attribute Designator --
4064 ---------------------------------------
4066 -- RANGE_ATTRIBUTE_DESIGNATOR ::= Range [(static_EXPRESSION)]
4068 -- A range attribute designator is represented in the tree using the
4069 -- normal N_Attribute_Reference node.
4071 --------------------
4072 -- 4.3 Aggregate --
4073 --------------------
4075 -- AGGREGATE ::=
4076 -- RECORD_AGGREGATE | EXTENSION_AGGREGATE | ARRAY_AGGREGATE
4078 -----------------------------
4079 -- 4.3.1 Record Aggregate --
4080 -----------------------------
4082 -- RECORD_AGGREGATE ::= (RECORD_COMPONENT_ASSOCIATION_LIST)
4084 -- N_Aggregate
4085 -- Sloc points to left parenthesis
4086 -- Expressions (set to No_List if none or null record case)
4087 -- Component_Associations (set to No_List if none)
4088 -- Null_Record_Present
4089 -- Aggregate_Bounds (array) or Ancestor_Type (record)
4090 -- Associated_Node
4091 -- Compile_Time_Known_Aggregate
4092 -- Expansion_Delayed
4093 -- Has_Self_Reference
4094 -- Is_Enum_Array_Aggregate
4095 -- Is_Homogeneous_Aggregate
4096 -- Is_Parenthesis_Aggregate
4097 -- plus fields for expression
4099 -- Note: this structure is used for both record and array aggregates
4100 -- since the two cases are not separable by the parser. The parser
4101 -- makes no attempt to enforce consistency here, so it is up to the
4102 -- semantic phase to make sure that the aggregate is consistent (i.e.
4103 -- that it is not a "half-and-half" case that mixes record and array
4104 -- syntax). In particular, for a record aggregate, the expressions
4105 -- field will be set if there are positional associations.
4107 -- Note: N_Aggregate is not used for all aggregates; in particular,
4108 -- there is a separate node kind for extension aggregates.
4110 -- Note: gigi/gcc can handle array aggregates correctly providing that
4111 -- they are entirely positional, and the array subtype involved has a
4112 -- known at compile time length and is not bit packed, or a convention
4113 -- Fortran array with more than one dimension. If these conditions
4114 -- are not met, then the front end must translate the aggregate into
4115 -- an appropriate set of assignments into a temporary.
4117 -- Note: for the record aggregate case, gigi/gcc can handle most cases
4118 -- of record aggregates, including those for packed, and rep-claused
4119 -- records, and also variant records, providing that there are no
4120 -- variable length fields whose size is not known at compile time,
4121 -- and providing that the aggregate is presented in fully named form.
4123 -- The other situation in which array aggregates and record aggregates
4124 -- cannot be passed to the back end is if assignment to one or more
4125 -- components itself needs expansion, e.g. in the case of an assignment
4126 -- of an object of a controlled type. In such cases, the front end
4127 -- must expand the aggregate to a series of assignments, and apply
4128 -- the required expansion to the individual assignment statements.
4130 ----------------------------------------------
4131 -- 4.3.1 Record Component Association List --
4132 ----------------------------------------------
4134 -- RECORD_COMPONENT_ASSOCIATION_LIST ::=
4135 -- RECORD_COMPONENT_ASSOCIATION {, RECORD_COMPONENT_ASSOCIATION}
4136 -- | null record
4138 -- There is no explicit node in the tree for a record component
4139 -- association list. Instead the Null_Record_Present flag is set in
4140 -- the parent node for the NULL RECORD case.
4142 ------------------------------------------------------
4143 -- 4.3.1 Record Component Association (also 4.3.3) --
4144 ------------------------------------------------------
4146 -- RECORD_COMPONENT_ASSOCIATION ::=
4147 -- [COMPONENT_CHOICE_LIST =>] EXPRESSION
4149 -- N_Component_Association
4150 -- Sloc points to first selector name
4151 -- Choices
4152 -- Expression (empty if Box_Present)
4153 -- Loop_Actions
4154 -- Box_Present
4155 -- Inherited_Discriminant
4156 -- Binding_Chars
4158 -- Note: this structure is used for both record component associations
4159 -- and array component associations, since the two cases aren't always
4160 -- separable by the parser. The choices list may represent either a
4161 -- list of selector names in the record aggregate case, or a list of
4162 -- discrete choices in the array aggregate case or an N_Others_Choice
4163 -- node (which appears as a singleton list). Box_Present gives support
4164 -- to Ada 2005 (AI-287). Binding_Chars is only set if GNAT extensions
4165 -- are enabled and the given component association occurs within a
4166 -- choice_expression; in this case, it is the Name_Id, if any, specified
4167 -- via either of two syntactic forms: "Foo => Bar is Abc" or
4168 -- "Foo => <Abc>".
4170 ----------------------------------
4171 -- 4.3.1 Component Choice List --
4172 ----------------------------------
4174 -- COMPONENT_CHOICE_LIST ::=
4175 -- component_SELECTOR_NAME {| component_SELECTOR_NAME}
4176 -- | others
4178 -- The entries of a component choice list appear in the Choices list of
4179 -- the associated N_Component_Association, as either selector names, or
4180 -- as an N_Others_Choice node.
4182 --------------------------------
4183 -- 4.3.2 Extension Aggregate --
4184 --------------------------------
4186 -- EXTENSION_AGGREGATE ::=
4187 -- (ANCESTOR_PART with RECORD_COMPONENT_ASSOCIATION_LIST)
4189 -- Note: extension aggregates are not permitted in Ada 83 mode
4191 -- N_Extension_Aggregate
4192 -- Sloc points to left parenthesis
4193 -- Ancestor_Part
4194 -- Associated_Node
4195 -- Expressions (set to No_List if none or null record case)
4196 -- Component_Associations (set to No_List if none)
4197 -- Null_Record_Present
4198 -- Expansion_Delayed
4199 -- Has_Self_Reference
4200 -- plus fields for expression
4202 --------------------------
4203 -- 4.3.2 Ancestor Part --
4204 --------------------------
4206 -- ANCESTOR_PART ::= EXPRESSION | SUBTYPE_MARK
4208 ----------------------------
4209 -- 4.3.3 Array Aggregate --
4210 ----------------------------
4212 -- ARRAY_AGGREGATE ::=
4213 -- POSITIONAL_ARRAY_AGGREGATE | NAMED_ARRAY_AGGREGATE
4215 ---------------------------------------
4216 -- 4.3.3 Positional Array Aggregate --
4217 ---------------------------------------
4219 -- POSITIONAL_ARRAY_AGGREGATE ::=
4220 -- (EXPRESSION, EXPRESSION {, EXPRESSION})
4221 -- | (EXPRESSION {, EXPRESSION}, others => EXPRESSION)
4223 -- See Record_Aggregate (4.3.1) for node structure
4225 ----------------------------------
4226 -- 4.3.3 Named Array Aggregate --
4227 ----------------------------------
4229 -- NAMED_ARRAY_AGGREGATE ::=
4230 -- (ARRAY_COMPONENT_ASSOCIATION {, ARRAY_COMPONENT_ASSOCIATION})
4232 -- See Record_Aggregate (4.3.1) for node structure
4234 ----------------------------------------
4235 -- 4.3.3 Array Component Association --
4236 ----------------------------------------
4238 -- ARRAY_COMPONENT_ASSOCIATION ::=
4239 -- DISCRETE_CHOICE_LIST => EXPRESSION
4240 -- | ITERATED_COMPONENT_ASSOCIATION
4242 -- See Record_Component_Association (4.3.1) for node structure
4243 -- The iterated_component_association is introduced into the
4244 -- Corrigendum of Ada_2012 by AI12-061.
4246 ------------------------------------------
4247 -- 4.3.3 Iterated component Association --
4248 ------------------------------------------
4250 -- ITERATED_COMPONENT_ASSOCIATION ::=
4251 -- for DEFINING_IDENTIFIER in DISCRETE_CHOICE_LIST => EXPRESSION
4252 -- for ITERATOR_SPECIFICATION => EXPRESSION
4254 -- At most one of (Defining_Identifier, Iterator_Specification)
4255 -- is present at a time, in which case the other one is empty.
4257 -- N_Iterated_Component_Association
4258 -- Sloc points to FOR
4259 -- Defining_Identifier
4260 -- Iterator_Specification
4261 -- Expression
4262 -- Discrete_Choices
4263 -- Loop_Actions
4264 -- Box_Present
4266 -- Note that Box_Present is always False, but it is intentionally added
4267 -- for completeness.
4269 ----------------------------
4270 -- 4.3.4 Delta Aggregate --
4271 ----------------------------
4273 -- N_Delta_Aggregate
4274 -- Sloc points to left parenthesis
4275 -- Expression
4276 -- Component_Associations
4277 -- Etype
4279 ---------------------------------
4280 -- 3.4.5 Container_Aggregates --
4281 ---------------------------------
4283 -- ITERATED_ELEMENT_ASSOCIATION ::=
4284 -- for LOOP_PARAMETER_SPECIFICATION[ use KEY_EXPRESSION] => EXPRESSION
4285 -- | for ITERATOR_SPECIFICATION[ use KEY_EXPRESSION] => EXPRESSION
4287 -- N_Iterated_Element_Association
4288 -- Key_Expression
4289 -- Iterator_Specification
4290 -- Expression
4291 -- Loop_Parameter_Specification
4292 -- Loop_Actions
4293 -- Box_Present
4295 -- Exactly one of Iterator_Specification or Loop_Parameter_
4296 -- specification is present. If the Key_Expression is absent,
4297 -- the construct is parsed as an Iterated_Component_Association,
4298 -- and legality checks are performed during semantic analysis.
4300 -- Both iterated associations are Ada 2022 features that are
4301 -- expanded during aggregate construction, and do not appear in
4302 -- expanded code.
4304 --------------------------------------------------
4305 -- 4.4 Expression/Relation/Term/Factor/Primary --
4306 --------------------------------------------------
4308 -- EXPRESSION ::=
4309 -- RELATION {LOGICAL_OPERATOR RELATION}
4311 -- CHOICE_EXPRESSION ::=
4312 -- CHOICE_RELATION {LOGICAL_OPERATOR CHOICE_RELATION}
4314 -- CHOICE_RELATION ::=
4315 -- SIMPLE_EXPRESSION [RELATIONAL_OPERATOR SIMPLE_EXPRESSION]
4317 -- RELATION ::=
4318 -- SIMPLE_EXPRESSION [not] in MEMBERSHIP_CHOICE_LIST
4319 -- | RAISE_EXPRESSION
4321 -- MEMBERSHIP_CHOICE_LIST ::=
4322 -- MEMBERSHIP_CHOICE {'|' MEMBERSHIP CHOICE}
4324 -- MEMBERSHIP_CHOICE ::=
4325 -- CHOICE_EXPRESSION | RANGE | SUBTYPE_MARK
4327 -- LOGICAL_OPERATOR ::= and | and then | or | or else | xor
4329 -- SIMPLE_EXPRESSION ::=
4330 -- [UNARY_ADDING_OPERATOR] TERM {BINARY_ADDING_OPERATOR TERM}
4332 -- TERM ::= FACTOR {MULTIPLYING_OPERATOR FACTOR}
4334 -- FACTOR ::= PRIMARY [** PRIMARY] | abs PRIMARY | not PRIMARY
4336 -- No nodes are generated for any of these constructs. Instead, the
4337 -- node for the operator appears directly. When we refer to an
4338 -- expression in this description, we mean any of the possible
4339 -- constituent components of an expression (e.g. identifier is
4340 -- an example of an expression).
4342 -- Note: the above syntax is that Ada 2012 syntax which restricts
4343 -- choice relations to simple expressions to avoid ambiguities in
4344 -- some contexts with set membership notation. It has been decided
4345 -- that in retrospect, the Ada 95 change allowing general expressions
4346 -- in this context was a mistake, so we have reverted to the above
4347 -- syntax in Ada 95 and Ada 2005 modes (the restriction to simple
4348 -- expressions was there in Ada 83 from the start).
4350 ------------------
4351 -- 4.4 Primary --
4352 ------------------
4354 -- PRIMARY ::=
4355 -- NUMERIC_LITERAL | null
4356 -- | STRING_LITERAL | AGGREGATE
4357 -- | NAME | QUALIFIED_EXPRESSION
4358 -- | ALLOCATOR | (EXPRESSION)
4360 -- Usually there is no explicit node in the tree for primary. Instead
4361 -- the constituent (e.g. AGGREGATE) appears directly. There are two
4362 -- exceptions. First, there is an explicit node for a null primary.
4364 -- N_Null
4365 -- Sloc points to NULL
4366 -- plus fields for expression
4368 -- Second, the case of (EXPRESSION) is handled specially. Ada requires
4369 -- that the parser keep track of which subexpressions are enclosed
4370 -- in parentheses, and how many levels of parentheses are used. This
4371 -- information is required for optimization purposes, and also for
4372 -- some semantic checks (e.g. (((1))) in a procedure spec does not
4373 -- conform with ((((1)))) in the body).
4375 -- The parentheses are recorded by keeping a Paren_Count field in every
4376 -- subexpression node (it is actually present in all nodes, but only
4377 -- used in subexpression nodes). This count records the number of
4378 -- levels of parentheses. If the number of levels in the source exceeds
4379 -- the maximum accommodated by this count, then the count is simply left
4380 -- at the maximum value. This means that there are some pathological
4381 -- cases of failure to detect conformance failures (e.g. an expression
4382 -- with 500 levels of parens will conform with one with 501 levels),
4383 -- but we do not need to lose sleep over this.
4385 -- Historical note: in versions of GNAT prior to 1.75, there was a node
4386 -- type N_Parenthesized_Expression used to accurately record unlimited
4387 -- numbers of levels of parentheses. However, it turned out to be a
4388 -- real nuisance to have to take into account the possible presence of
4389 -- this node during semantic analysis, since basically parentheses have
4390 -- zero relevance to semantic analysis.
4392 -- Note: the level of parentheses always present in things like
4393 -- aggregates does not count, only the parentheses in the primary
4394 -- (EXPRESSION) affect the setting of the Paren_Count field.
4396 -- 2nd Note: the contents of the Expression field must be ignored (i.e.
4397 -- treated as though it were Empty) if No_Initialization is set True.
4399 --------------------------------------
4400 -- 4.5 Short-Circuit Control Forms --
4401 --------------------------------------
4403 -- EXPRESSION ::=
4404 -- RELATION {and then RELATION} | RELATION {or else RELATION}
4406 -- Gigi restriction: For both these control forms, the operand and
4407 -- result types are always Standard.Boolean. The expander inserts the
4408 -- required conversion operations where needed to ensure this is the
4409 -- case.
4411 -- N_And_Then
4412 -- Sloc points to AND of AND THEN
4413 -- Left_Opnd
4414 -- Right_Opnd
4415 -- Actions
4416 -- plus fields for expression
4418 -- N_Or_Else
4419 -- Sloc points to OR of OR ELSE
4420 -- Left_Opnd
4421 -- Right_Opnd
4422 -- Actions
4423 -- plus fields for expression
4425 -- Note: The Actions field is used to hold actions associated with
4426 -- the right hand operand. These have to be treated specially since
4427 -- they are not unconditionally executed. See Insert_Actions for a
4428 -- more detailed description of how these actions are handled.
4430 ---------------------------
4431 -- 4.5 Membership Tests --
4432 ---------------------------
4434 -- RELATION ::=
4435 -- SIMPLE_EXPRESSION [not] in MEMBERSHIP_CHOICE_LIST
4437 -- MEMBERSHIP_CHOICE_LIST ::=
4438 -- MEMBERSHIP_CHOICE {'|' MEMBERSHIP CHOICE}
4440 -- MEMBERSHIP_CHOICE ::=
4441 -- CHOICE_EXPRESSION | RANGE | SUBTYPE_MARK
4443 -- Note: although the grammar above allows only a range or a subtype
4444 -- mark, the parser in fact will accept any simple expression in place
4445 -- of a subtype mark. This means that the semantic analyzer must be able
4446 -- to deal with, and diagnose a simple expression other than a name for
4447 -- the right operand. This simplifies error recovery in the parser.
4449 -- The Alternatives field below is present only if there is more than
4450 -- one Membership_Choice present (which is legitimate only in Ada 2012
4451 -- mode) in which case Right_Opnd is Empty, and Alternatives contains
4452 -- the list of choices. In the tree passed to the back end, Alternatives
4453 -- is always No_List, and Right_Opnd is set (i.e. the expansion circuit
4454 -- expands out the complex set membership case using simple membership
4455 -- and equality operations).
4457 -- Should we rename Alternatives here to Membership_Choices ???
4459 -- N_In
4460 -- Sloc points to IN
4461 -- Left_Opnd
4462 -- Right_Opnd
4463 -- Alternatives (set to No_List if only one set alternative)
4464 -- No_Minimize_Eliminate
4465 -- plus fields for expression
4467 -- N_Not_In
4468 -- Sloc points to NOT of NOT IN
4469 -- Left_Opnd
4470 -- Right_Opnd
4471 -- Alternatives (set to No_List if only one set alternative)
4472 -- No_Minimize_Eliminate
4473 -- plus fields for expression
4475 --------------------
4476 -- 4.5 Operators --
4477 --------------------
4479 -- LOGICAL_OPERATOR ::= and | or | xor
4481 -- RELATIONAL_OPERATOR ::= = | /= | < | <= | > | >=
4483 -- BINARY_ADDING_OPERATOR ::= + | - | &
4485 -- UNARY_ADDING_OPERATOR ::= + | -
4487 -- MULTIPLYING_OPERATOR ::= * | / | mod | rem
4489 -- HIGHEST_PRECEDENCE_OPERATOR ::= ** | abs | not
4491 -- Gigi restriction: Gigi will never be given * / mod rem nodes with
4492 -- fixed-point operands. All handling of smalls for multiplication and
4493 -- division is handled by the front end (mod and rem result only from
4494 -- expansion). Gigi thus never needs to worry about small values (for
4495 -- other operators operating on fixed-point, e.g. addition, the small
4496 -- value does not have any semantic effect anyway, these are always
4497 -- integer operations).
4499 -- Gigi restriction: For all operators taking Boolean operands, the
4500 -- type is always Standard.Boolean. The expander inserts the required
4501 -- conversion operations where needed to ensure this is the case.
4503 -- N_Op_And
4504 -- Sloc points to AND
4505 -- Do_Length_Check
4506 -- plus fields for binary operator
4507 -- plus fields for expression
4509 -- N_Op_Or
4510 -- Sloc points to OR
4511 -- Do_Length_Check
4512 -- plus fields for binary operator
4513 -- plus fields for expression
4515 -- N_Op_Xor
4516 -- Sloc points to XOR
4517 -- Do_Length_Check
4518 -- plus fields for binary operator
4519 -- plus fields for expression
4521 -- N_Op_Eq
4522 -- Sloc points to =
4523 -- Compare_Type
4524 -- plus fields for binary operator
4525 -- plus fields for expression
4527 -- N_Op_Ne
4528 -- Sloc points to /=
4529 -- Compare_Type
4530 -- plus fields for binary operator
4531 -- plus fields for expression
4533 -- N_Op_Lt
4534 -- Sloc points to <
4535 -- Compare_Type
4536 -- plus fields for binary operator
4537 -- plus fields for expression
4539 -- N_Op_Le
4540 -- Sloc points to <=
4541 -- Compare_Type
4542 -- plus fields for binary operator
4543 -- plus fields for expression
4545 -- N_Op_Gt
4546 -- Sloc points to >
4547 -- Compare_Type
4548 -- plus fields for binary operator
4549 -- plus fields for expression
4551 -- N_Op_Ge
4552 -- Sloc points to >=
4553 -- Compare_Type
4554 -- plus fields for binary operator
4555 -- plus fields for expression
4557 -- N_Op_Add
4558 -- Sloc points to + (binary)
4559 -- plus fields for binary operator
4560 -- plus fields for expression
4562 -- N_Op_Subtract
4563 -- Sloc points to - (binary)
4564 -- plus fields for binary operator
4565 -- plus fields for expression
4567 -- N_Op_Concat
4568 -- Sloc points to &
4569 -- Is_Component_Left_Opnd
4570 -- Is_Component_Right_Opnd
4571 -- plus fields for binary operator
4572 -- plus fields for expression
4574 -- N_Op_Multiply
4575 -- Sloc points to *
4576 -- Rounded_Result
4577 -- plus fields for binary operator
4578 -- plus fields for expression
4580 -- N_Op_Divide
4581 -- Sloc points to /
4582 -- Do_Division_Check
4583 -- Rounded_Result
4584 -- plus fields for binary operator
4585 -- plus fields for expression
4587 -- N_Op_Mod
4588 -- Sloc points to MOD
4589 -- Do_Division_Check
4590 -- plus fields for binary operator
4591 -- plus fields for expression
4593 -- N_Op_Rem
4594 -- Sloc points to REM
4595 -- Do_Division_Check
4596 -- plus fields for binary operator
4597 -- plus fields for expression
4599 -- N_Op_Expon
4600 -- Sloc points to **
4601 -- Is_Power_Of_2_For_Shift
4602 -- plus fields for binary operator
4603 -- plus fields for expression
4605 -- N_Op_Plus
4606 -- Sloc points to + (unary)
4607 -- plus fields for unary operator
4608 -- plus fields for expression
4610 -- N_Op_Minus
4611 -- Sloc points to - (unary)
4612 -- plus fields for unary operator
4613 -- plus fields for expression
4615 -- N_Op_Abs
4616 -- Sloc points to ABS
4617 -- plus fields for unary operator
4618 -- plus fields for expression
4620 -- N_Op_Not
4621 -- Sloc points to NOT
4622 -- plus fields for unary operator
4623 -- plus fields for expression
4625 -- See also shift operators in section B.2
4627 -- Note on fixed-point operations passed to Gigi: For adding operators,
4628 -- the semantics is to treat these simply as integer operations, with
4629 -- the small values being ignored (the bounds are already stored in
4630 -- units of small, so that constraint checking works as usual). For the
4631 -- case of multiply/divide/rem/mod operations, Gigi will never see them.
4633 -- Note on equality/inequality tests for records. In the expanded tree,
4634 -- record comparisons are always expanded to be a series of component
4635 -- comparisons, so the back end will never see an equality or inequality
4636 -- operation with operands of a record type.
4638 -- Note on overflow handling: When the overflow checking mode is set to
4639 -- MINIMIZED or ELIMINATED, nodes for signed arithmetic operations may
4640 -- be modified to use a larger type for the operands and result. In
4641 -- the case where the computed range exceeds that of Long_Long_Integer,
4642 -- and we are running in ELIMINATED mode, the operator node will be
4643 -- changed to be a call to the appropriate routine in System.Bignums.
4645 -- Note: In Modify_Tree_For_C mode, we do not generate an N_Op_Mod node
4646 -- for signed integer types (since there is no equivalent operator in
4647 -- C). Instead we rewrite such an operation in terms of REM (which is
4648 -- % in C) and other C-available operators.
4650 ------------------------------------
4651 -- 4.5.7 Conditional Expressions --
4652 ------------------------------------
4654 -- CONDITIONAL_EXPRESSION ::= IF_EXPRESSION | CASE_EXPRESSION
4656 --------------------------
4657 -- 4.5.7 If Expression --
4658 --------------------------
4660 -- IF_EXPRESSION ::=
4661 -- if CONDITION then DEPENDENT_EXPRESSION
4662 -- {elsif CONDITION then DEPENDENT_EXPRESSION}
4663 -- [else DEPENDENT_EXPRESSION]
4665 -- DEPENDENT_EXPRESSION ::= EXPRESSION
4667 -- Note: if we have (IF x1 THEN x2 ELSIF x3 THEN x4 ELSE x5) then it
4668 -- is represented as (IF x1 THEN x2 ELSE (IF x3 THEN x4 ELSE x5)) and
4669 -- the Is_Elsif flag is set on the inner if expression.
4671 -- N_If_Expression
4672 -- Sloc points to IF or ELSIF keyword
4673 -- Expressions
4674 -- Then_Actions
4675 -- Else_Actions
4676 -- Is_Elsif (set if comes from ELSIF)
4677 -- Do_Overflow_Check
4678 -- plus fields for expression
4680 -- Expressions here is a three-element list, whose first element is the
4681 -- condition, the second element is the dependent expression after THEN
4682 -- and the third element is the dependent expression after the ELSE
4683 -- (explicitly set to True if missing).
4685 -- Note: the Then_Actions and Else_Actions fields are always set to
4686 -- No_List in the tree passed to the back end. These are used only
4687 -- for temporary processing purposes in the expander. Even though they
4688 -- are semantic fields, their parent pointers are set because analysis
4689 -- of actions nodes in those lists may generate additional actions that
4690 -- need to know their insertion point (for example for the creation of
4691 -- transient scopes).
4693 -- Note: in the tree passed to the back end, if the result type is
4694 -- an unconstrained array, the if expression can only appears in the
4695 -- initializing expression of an object declaration (this avoids the
4696 -- back end having to create a variable length temporary on the fly).
4698 ----------------------------
4699 -- 4.5.7 Case Expression --
4700 ----------------------------
4702 -- CASE_EXPRESSION ::=
4703 -- case SELECTING_EXPRESSION is
4704 -- CASE_EXPRESSION_ALTERNATIVE
4705 -- {,CASE_EXPRESSION_ALTERNATIVE}
4707 -- Note that the Alternatives cannot include pragmas (this contrasts
4708 -- with the situation of case statements where pragmas are allowed).
4710 -- N_Case_Expression
4711 -- Sloc points to CASE
4712 -- Expression (the selecting expression)
4713 -- Alternatives (the case expression alternatives)
4714 -- Etype
4715 -- Do_Overflow_Check
4717 ----------------------------------------
4718 -- 4.5.7 Case Expression Alternative --
4719 ----------------------------------------
4721 -- CASE_EXPRESSION_ALTERNATIVE ::=
4722 -- when DISCRETE_CHOICE_LIST =>
4723 -- DEPENDENT_EXPRESSION
4725 -- N_Case_Expression_Alternative
4726 -- Sloc points to WHEN
4727 -- Actions
4728 -- Discrete_Choices
4729 -- Expression
4730 -- Has_SP_Choice
4732 -- Note: The Actions field temporarily holds any actions associated with
4733 -- evaluation of the Expression. During expansion of the case expression
4734 -- these actions are wrapped into an N_Expression_With_Actions node
4735 -- replacing the original expression.
4737 -- Note: this node never appears in the tree passed to the back end,
4738 -- since the expander converts case expressions into case statements.
4740 ---------------------------------
4741 -- 4.5.8 Quantified Expression --
4742 ---------------------------------
4744 -- QUANTIFIED_EXPRESSION ::=
4745 -- for QUANTIFIER LOOP_PARAMETER_SPECIFICATION => PREDICATE
4746 -- | for QUANTIFIER ITERATOR_SPECIFICATION => PREDICATE
4748 -- QUANTIFIER ::= all | some
4750 -- At most one of (Iterator_Specification, Loop_Parameter_Specification)
4751 -- is present at a time, in which case the other one is empty.
4753 -- N_Quantified_Expression
4754 -- Sloc points to FOR
4755 -- Iterator_Specification
4756 -- Loop_Parameter_Specification
4757 -- Condition
4758 -- All_Present
4760 --------------------------
4761 -- 4.6 Type Conversion --
4762 --------------------------
4764 -- TYPE_CONVERSION ::=
4765 -- SUBTYPE_MARK (EXPRESSION) | SUBTYPE_MARK (NAME)
4767 -- In the (NAME) case, the name is stored as the expression
4769 -- Note: the parser never generates a type conversion node, since it
4770 -- looks like an indexed component which is generated by preference.
4771 -- The semantic pass must correct this misidentification.
4773 -- Gigi handles conversions that involve no change in the root type,
4774 -- and also all conversions from integer to floating-point types.
4775 -- Conversions from floating-point to integer are only handled in
4776 -- the case where Float_Truncate flag set. Other conversions from
4777 -- floating-point to integer (involving rounding) and all conversions
4778 -- involving fixed-point types are handled by the expander, unless the
4779 -- Conversion_OK flag is set.
4781 -- Sprint syntax if Float_Truncate set: X^(Y)
4782 -- Sprint syntax if Conversion_OK set X?(Y)
4783 -- Sprint syntax if both flags set X?^(Y)
4785 -- Note: If either the operand or result type is fixed-point, Gigi will
4786 -- only see a type conversion node with Conversion_OK set. The front end
4787 -- takes care of all handling of small's for fixed-point conversions.
4789 -- N_Type_Conversion
4790 -- Sloc points to first token of subtype mark
4791 -- Subtype_Mark
4792 -- Expression
4793 -- Do_Discriminant_Check
4794 -- Do_Length_Check
4795 -- Float_Truncate
4796 -- Conversion_OK
4797 -- Do_Overflow_Check
4798 -- Rounded_Result
4799 -- plus fields for expression
4801 -- Note: if a range check is required, then the Do_Range_Check flag
4802 -- is set in the Expression with the check being done against the
4803 -- target type range (after the base type conversion, if any).
4805 -------------------------------
4806 -- 4.7 Qualified Expression --
4807 -------------------------------
4809 -- QUALIFIED_EXPRESSION ::=
4810 -- SUBTYPE_MARK ' (EXPRESSION) | SUBTYPE_MARK ' AGGREGATE
4812 -- Note: the parentheses in the (EXPRESSION) case are deemed to enclose
4813 -- the expression, so the Expression field of this node always points
4814 -- to a parenthesized expression in this case (i.e. Paren_Count will
4815 -- always be non-zero for the referenced expression if it is not an
4816 -- aggregate).
4818 -- N_Qualified_Expression
4819 -- Sloc points to apostrophe
4820 -- Subtype_Mark
4821 -- Expression expression or aggregate
4822 -- Is_Qualified_Universal_Literal
4823 -- plus fields for expression
4825 --------------------
4826 -- 4.8 Allocator --
4827 --------------------
4829 -- ALLOCATOR ::=
4830 -- new [SUBPOOL_SPECIFICATION] SUBTYPE_INDICATION
4831 -- | new [SUBPOOL_SPECIFICATION] QUALIFIED_EXPRESSION
4833 -- SUBPOOL_SPECIFICATION ::= (subpool_handle_NAME)
4835 -- Sprint syntax (when storage pool present)
4836 -- new xxx (storage_pool = pool)
4837 -- or
4838 -- new (subpool) xxx (storage_pool = pool)
4840 -- N_Allocator
4841 -- Sloc points to NEW
4842 -- Expression subtype indication or qualified expression
4843 -- Subpool_Handle_Name (set to Empty if not present)
4844 -- Storage_Pool
4845 -- Procedure_To_Call
4846 -- For_Special_Return_Object
4847 -- Null_Exclusion_Present
4848 -- No_Initialization
4849 -- Is_Static_Coextension
4850 -- Do_Storage_Check
4851 -- Is_Dynamic_Coextension
4852 -- plus fields for expression
4854 -- Note: like all nodes, the N_Allocator has the Comes_From_Source flag.
4855 -- This flag has a special function in conjunction with the restriction
4856 -- No_Implicit_Heap_Allocations, which will be triggered if this flag
4857 -- is not set. This means that if a source allocator is replaced with
4858 -- a constructed allocator, the Comes_From_Source flag should be copied
4859 -- to the newly created allocator.
4861 ---------------------------------
4862 -- 5.1 Sequence Of Statements --
4863 ---------------------------------
4865 -- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT}
4867 -- Note: Although the parser will not accept a declaration as a
4868 -- statement, the semantic analyzer may insert declarations (e.g.
4869 -- declarations of implicit types needed for execution of other
4870 -- statements) into a sequence of statements, so the code generator
4871 -- should be prepared to accept a declaration where a statement is
4872 -- expected. Note also that pragmas can appear as statements.
4874 --------------------
4875 -- 5.1 Statement --
4876 --------------------
4878 -- STATEMENT ::=
4879 -- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT
4881 -- There is no explicit node in the tree for a statement. Instead, the
4882 -- individual statement appears directly. Labels are treated as a
4883 -- kind of statement, i.e. they are linked into a statement list at
4884 -- the point they appear, so the labeled statement appears following
4885 -- the label or labels in the statement list.
4887 ---------------------------
4888 -- 5.1 Simple Statement --
4889 ---------------------------
4891 -- SIMPLE_STATEMENT ::= NULL_STATEMENT
4892 -- | ASSIGNMENT_STATEMENT | EXIT_STATEMENT
4893 -- | GOTO_STATEMENT | PROCEDURE_CALL_STATEMENT
4894 -- | SIMPLE_RETURN_STATEMENT | ENTRY_CALL_STATEMENT
4895 -- | REQUEUE_STATEMENT | DELAY_STATEMENT
4896 -- | ABORT_STATEMENT | RAISE_STATEMENT
4897 -- | CODE_STATEMENT
4899 -----------------------------
4900 -- 5.1 Compound Statement --
4901 -----------------------------
4903 -- COMPOUND_STATEMENT ::=
4904 -- IF_STATEMENT | CASE_STATEMENT
4905 -- | LOOP_STATEMENT | BLOCK_STATEMENT
4906 -- | EXTENDED_RETURN_STATEMENT
4907 -- | ACCEPT_STATEMENT | SELECT_STATEMENT
4909 -------------------------
4910 -- 5.1 Null Statement --
4911 -------------------------
4913 -- NULL_STATEMENT ::= null;
4915 -- N_Null_Statement
4916 -- Sloc points to NULL
4917 -- Next_Rep_Item
4919 ----------------
4920 -- 5.1 Label --
4921 ----------------
4923 -- LABEL ::= <<label_STATEMENT_IDENTIFIER>>
4925 -- Note that the occurrence of a label is not a defining identifier,
4926 -- but rather a referencing occurrence. The defining occurrence is
4927 -- in the implicit label declaration which occurs in the innermost
4928 -- enclosing block.
4930 -- N_Label
4931 -- Sloc points to <<
4932 -- Identifier direct name of statement identifier
4933 -- Exception_Junk
4935 -- Note: Before Ada 2012, a label is always followed by a statement,
4936 -- and this is true in the tree even in Ada 2012 mode (the parser
4937 -- inserts a null statement marked with Comes_From_Source False).
4939 -------------------------------
4940 -- 5.1 Statement Identifier --
4941 -------------------------------
4943 -- STATEMENT_IDENTIFIER ::= DIRECT_NAME
4945 -- The IDENTIFIER of a STATEMENT_IDENTIFIER shall be an identifier
4946 -- (not an OPERATOR_SYMBOL)
4948 -------------------------------
4949 -- 5.2 Assignment Statement --
4950 -------------------------------
4952 -- ASSIGNMENT_STATEMENT ::=
4953 -- variable_NAME := EXPRESSION;
4955 -- N_Assignment_Statement
4956 -- Sloc points to :=
4957 -- Name
4958 -- Expression
4959 -- Is_Elaboration_Checks_OK_Node
4960 -- Is_SPARK_Mode_On_Node
4961 -- Do_Discriminant_Check
4962 -- Do_Length_Check
4963 -- Forwards_OK
4964 -- Backwards_OK
4965 -- No_Ctrl_Actions
4966 -- No_Finalize_Actions
4967 -- Has_Target_Names
4968 -- Is_Elaboration_Code
4969 -- Componentwise_Assignment
4970 -- Suppress_Assignment_Checks
4972 -- Note: if a range check is required, then the Do_Range_Check flag
4973 -- is set in the Expression (right hand side), with the check being
4974 -- done against the type of the Name (left hand side).
4976 -- Note: the back end places some restrictions on the form of the
4977 -- Expression field. If the object being assigned to is Atomic, then
4978 -- the Expression may not have the form of an aggregate (since this
4979 -- might cause the back end to generate separate assignments). In this
4980 -- case the front end must generate an extra temporary and initialize
4981 -- this temporary as required (the temporary itself is not atomic).
4983 ------------------
4984 -- Target_Name --
4985 ------------------
4987 -- N_Target_Name
4988 -- Sloc points to @
4989 -- Etype
4991 -- Note (Ada 2022): node is used during analysis as a placeholder for
4992 -- the value of the LHS of the enclosing assignment statement. Node is
4993 -- eventually rewritten together with enclosing assignment, and backends
4994 -- are not aware of it.
4996 -----------------------
4997 -- 5.3 If Statement --
4998 -----------------------
5000 -- IF_STATEMENT ::=
5001 -- if CONDITION then
5002 -- SEQUENCE_OF_STATEMENTS
5003 -- {elsif CONDITION then
5004 -- SEQUENCE_OF_STATEMENTS}
5005 -- [else
5006 -- SEQUENCE_OF_STATEMENTS]
5007 -- end if;
5009 -- Gigi restriction: This expander ensures that the type of the
5010 -- Condition fields is always Standard.Boolean, even if the type
5011 -- in the source is some non-standard boolean type.
5013 -- N_If_Statement
5014 -- Sloc points to IF
5015 -- Condition
5016 -- Then_Statements
5017 -- Elsif_Parts (set to No_List if none present)
5018 -- Else_Statements (set to No_List if no else part present)
5019 -- End_Span (set to Uint_0 if expander generated)
5020 -- From_Conditional_Expression
5022 -- N_Elsif_Part
5023 -- Sloc points to ELSIF
5024 -- Condition
5025 -- Then_Statements
5026 -- Condition_Actions
5028 --------------------
5029 -- 5.3 Condition --
5030 --------------------
5032 -- CONDITION ::= boolean_EXPRESSION
5034 -------------------------
5035 -- 5.4 Case Statement --
5036 -------------------------
5038 -- CASE_STATEMENT ::=
5039 -- case EXPRESSION is
5040 -- CASE_STATEMENT_ALTERNATIVE
5041 -- {CASE_STATEMENT_ALTERNATIVE}
5042 -- end case;
5044 -- Note: the Alternatives can contain pragmas. These only occur at
5045 -- the start of the list, since any pragmas occurring after the first
5046 -- alternative are absorbed into the corresponding statement sequence.
5048 -- N_Case_Statement
5049 -- Sloc points to CASE
5050 -- Expression
5051 -- Alternatives
5052 -- End_Span (set to Uint_0 if expander generated)
5053 -- From_Conditional_Expression
5055 -- Note: Before Ada 2012, a pragma in a statement sequence is always
5056 -- followed by a statement, and this is true in the tree even in Ada
5057 -- 2012 mode (the parser inserts a null statement marked with the flag
5058 -- Comes_From_Source False).
5060 -------------------------------------
5061 -- 5.4 Case Statement Alternative --
5062 -------------------------------------
5064 -- CASE_STATEMENT_ALTERNATIVE ::=
5065 -- when DISCRETE_CHOICE_LIST =>
5066 -- SEQUENCE_OF_STATEMENTS
5068 -- N_Case_Statement_Alternative
5069 -- Sloc points to WHEN
5070 -- Discrete_Choices
5071 -- Statements
5072 -- Has_SP_Choice
5073 -- Multidefined_Bindings
5075 -- Note: in the list of Discrete_Choices, the tree passed to the back
5076 -- end does not have choice entries corresponding to names of statically
5077 -- predicated subtypes. Such entries are always expanded out to the list
5078 -- of equivalent values or ranges. Multidefined_Bindings is True iff
5079 -- more than one choice is present and each choice contains
5080 -- at least one component association having a non-null Binding_Chars
5081 -- attribute; this can only occur if GNAT extensions are enabled
5082 -- and the type of the case selector is composite.
5084 -------------------------
5085 -- 5.5 Loop Statement --
5086 -------------------------
5088 -- LOOP_STATEMENT ::=
5089 -- [loop_STATEMENT_IDENTIFIER :]
5090 -- [ITERATION_SCHEME] loop
5091 -- SEQUENCE_OF_STATEMENTS
5092 -- end loop [loop_IDENTIFIER];
5094 -- Note: The occurrence of a loop label is not a defining identifier
5095 -- but rather a referencing occurrence. The defining occurrence is in
5096 -- the implicit label declaration which occurs in the innermost
5097 -- enclosing block.
5099 -- Note: there is always a loop statement identifier present in the
5100 -- tree, even if none was given in the source. In the case where no loop
5101 -- identifier is given in the source, the parser creates a name of the
5102 -- form _Loop_n, where n is a decimal integer (the two underlines ensure
5103 -- that the loop names created in this manner do not conflict with any
5104 -- user defined identifiers), and the flag Has_Created_Identifier is set
5105 -- to True. The only exception to the rule that all loop statement nodes
5106 -- have identifiers occurs for loops constructed by the expander, and
5107 -- the semantic analyzer will create and supply dummy loop identifiers
5108 -- in these cases.
5110 -- N_Loop_Statement
5111 -- Sloc points to LOOP
5112 -- Identifier loop identifier (set to Empty if no identifier)
5113 -- Iteration_Scheme (set to Empty if no iteration scheme)
5114 -- Statements
5115 -- End_Label
5116 -- Has_Created_Identifier
5117 -- Is_Null_Loop
5118 -- Suppress_Loop_Warnings
5120 -- Note: the parser fills in the Identifier field if there is an
5121 -- explicit loop identifier. Otherwise the parser leaves this field
5122 -- set to Empty, and then the semantic processing for a loop statement
5123 -- creates an identifier, setting the Has_Created_Identifier flag to
5124 -- True. So after semantic analysis, the Identifier is always set,
5125 -- referencing an identifier whose entity has an Ekind of E_Loop.
5127 ---------------------------
5128 -- 5.5 Iteration Scheme --
5129 ---------------------------
5131 -- ITERATION_SCHEME ::=
5132 -- while CONDITION
5133 -- | for LOOP_PARAMETER_SPECIFICATION
5134 -- | for ITERATOR_SPECIFICATION
5136 -- At most one of (Iterator_Specification, Loop_Parameter_Specification)
5137 -- is present at a time, in which case the other one is empty. Both are
5138 -- empty in the case of a WHILE loop.
5140 -- Gigi restriction: The expander ensures that the type of the Condition
5141 -- field is always Standard.Boolean, even if the type in the source is
5142 -- some non-standard boolean type.
5144 -- N_Iteration_Scheme
5145 -- Sloc points to WHILE or FOR
5146 -- Condition (set to Empty if FOR case)
5147 -- Condition_Actions
5148 -- Iterator_Specification (set to Empty if WHILE case)
5149 -- Loop_Parameter_Specification (set to Empty if WHILE case)
5151 ---------------------------------------
5152 -- 5.5 Loop Parameter Specification --
5153 ---------------------------------------
5155 -- LOOP_PARAMETER_SPECIFICATION ::=
5156 -- DEFINING_IDENTIFIER in [reverse] DISCRETE_SUBTYPE_DEFINITION
5157 -- [Iterator_Filter]
5159 -- Note: the optional Iterator_Filter is an Ada 2022 construct.
5161 -- N_Loop_Parameter_Specification
5162 -- Sloc points to first identifier
5163 -- Defining_Identifier
5164 -- Reverse_Present
5165 -- Iterator_Filter (set to Empty if not present)
5166 -- Discrete_Subtype_Definition
5168 -----------------------------------
5169 -- 5.5.1 Iterator Specification --
5170 -----------------------------------
5172 -- ITERATOR_SPECIFICATION ::=
5173 -- DEFINING_IDENTIFIER in [reverse] NAME
5174 -- | DEFINING_IDENTIFIER [: SUBTYPE_INDICATION] of [reverse] NAME
5176 -- N_Iterator_Specification
5177 -- Sloc points to defining identifier
5178 -- Defining_Identifier
5179 -- Name
5180 -- Reverse_Present
5181 -- Of_Present
5182 -- Iterator_Filter (set to Empty if not present)
5183 -- Subtype_Indication
5185 -- Note: The Of_Present flag distinguishes the two forms
5187 --------------------------
5188 -- 5.6 Block Statement --
5189 --------------------------
5191 -- BLOCK_STATEMENT ::=
5192 -- [block_STATEMENT_IDENTIFIER:]
5193 -- [declare
5194 -- DECLARATIVE_PART]
5195 -- begin
5196 -- HANDLED_SEQUENCE_OF_STATEMENTS
5197 -- end [block_IDENTIFIER];
5199 -- Note that the occurrence of a block identifier is not a defining
5200 -- identifier, but rather a referencing occurrence. The defining
5201 -- occurrence is an E_Block entity declared by the implicit label
5202 -- declaration which occurs in the innermost enclosing block statement
5203 -- or body; the block identifier denotes that E_Block.
5205 -- For block statements that come from source code, there is always a
5206 -- block statement identifier present in the tree, denoting an E_Block.
5207 -- In the case where no block identifier is given in the source,
5208 -- the parser creates a name of the form B_n, where n is a decimal
5209 -- integer, and the flag Has_Created_Identifier is set to True. Blocks
5210 -- constructed by the expander usually have no identifier, and no
5211 -- corresponding entity.
5213 -- Note: the block statement created for an extended return statement
5214 -- has an entity, and this entity is an E_Return_Statement, rather than
5215 -- the usual E_Block.
5217 -- Note: Exception_Junk is set for the wrapping blocks created during
5218 -- local raise optimization (Exp_Ch11.Expand_Local_Exception_Handlers).
5220 -- Note: from a control flow viewpoint, a block statement defines an
5221 -- extended basic block, i.e. the entry of the block dominates every
5222 -- statement in the sequence. When generating new statements with
5223 -- exception handlers in the expander at the end of a sequence that
5224 -- comes from source code, it can be necessary to wrap them all in a
5225 -- block statement in order to expose the implicit control flow to
5226 -- gigi and thus prevent it from issuing bogus control flow warnings.
5228 -- N_Block_Statement
5229 -- Sloc points to DECLARE or BEGIN
5230 -- Identifier block direct name (set to Empty if not present)
5231 -- Declarations (set to No_List if no DECLARE part)
5232 -- Handled_Statement_Sequence
5233 -- Activation_Chain_Entity
5234 -- Cleanup_Actions
5235 -- Has_Created_Identifier
5236 -- Is_Asynchronous_Call_Block
5237 -- Is_Task_Allocation_Block
5238 -- Exception_Junk
5239 -- Is_Abort_Block
5240 -- Is_Initialization_Block
5241 -- Is_Task_Master
5242 -- At_End_Proc (set to Empty if no clean up procedure)
5244 -------------------------
5245 -- 5.7 Exit Statement --
5246 -------------------------
5248 -- EXIT_STATEMENT ::= exit [loop_NAME] [when CONDITION];
5250 -- Gigi restriction: The expander ensures that the type of the Condition
5251 -- field is always Standard.Boolean, even if the type in the source is
5252 -- some non-standard boolean type.
5254 -- N_Exit_Statement
5255 -- Sloc points to EXIT
5256 -- Name (set to Empty if no loop name present)
5257 -- Condition (set to Empty if no WHEN part present)
5258 -- Next_Exit_Statement : Next exit on chain
5260 -------------------------
5261 -- 5.9 Goto Statement --
5262 -------------------------
5264 -- GOTO_STATEMENT ::= goto label_NAME;
5266 -- N_Goto_Statement
5267 -- Sloc points to GOTO
5268 -- Name
5269 -- Exception_Junk
5271 ---------------------------------
5272 -- 6.1 Subprogram Declaration --
5273 ---------------------------------
5275 -- SUBPROGRAM_DECLARATION ::=
5276 -- SUBPROGRAM_SPECIFICATION
5277 -- [ASPECT_SPECIFICATIONS];
5279 -- N_Subprogram_Declaration
5280 -- Sloc points to FUNCTION or PROCEDURE
5281 -- Specification
5282 -- Body_To_Inline
5283 -- Corresponding_Body
5284 -- Parent_Spec
5285 -- Is_Entry_Barrier_Function
5286 -- Is_Task_Body_Procedure
5288 ------------------------------------------
5289 -- 6.1 Abstract Subprogram Declaration --
5290 ------------------------------------------
5292 -- ABSTRACT_SUBPROGRAM_DECLARATION ::=
5293 -- SUBPROGRAM_SPECIFICATION is abstract
5294 -- [ASPECT_SPECIFICATIONS];
5296 -- N_Abstract_Subprogram_Declaration
5297 -- Sloc points to ABSTRACT
5298 -- Specification
5300 -----------------------------------
5301 -- 6.1 Subprogram Specification --
5302 -----------------------------------
5304 -- SUBPROGRAM_SPECIFICATION ::=
5305 -- [[not] overriding]
5306 -- procedure DEFINING_PROGRAM_UNIT_NAME PARAMETER_PROFILE
5307 -- | [[not] overriding]
5308 -- function DEFINING_DESIGNATOR PARAMETER_AND_RESULT_PROFILE
5310 -- Note: there are no separate nodes for the profiles, instead the
5311 -- information appears directly in the following nodes.
5313 -- N_Function_Specification
5314 -- Sloc points to FUNCTION
5315 -- Defining_Unit_Name (the designator)
5316 -- Parameter_Specifications (set to No_List if no formal part)
5317 -- Null_Exclusion_Present
5318 -- Result_Definition for result subtype
5319 -- Generic_Parent
5320 -- Must_Override set if overriding indicator present
5321 -- Must_Not_Override set if not_overriding indicator present
5323 -- N_Procedure_Specification
5324 -- Sloc points to PROCEDURE
5325 -- Defining_Unit_Name
5326 -- Null_Statement NULL statement for body, if Null_Present
5327 -- Parameter_Specifications (set to No_List if no formal part)
5328 -- Generic_Parent
5329 -- Null_Present set for null procedure case (Ada 2005 feature)
5330 -- Must_Override set if overriding indicator present
5331 -- Must_Not_Override set if not_overriding indicator present
5333 -- Note: overriding indicator is an Ada 2005 feature
5335 ---------------------
5336 -- 6.1 Designator --
5337 ---------------------
5339 -- DESIGNATOR ::=
5340 -- [PARENT_UNIT_NAME .] IDENTIFIER | OPERATOR_SYMBOL
5342 -- Designators that are simply identifiers or operator symbols appear
5343 -- directly in the tree in this form. The following node is used only
5344 -- in the case where the designator has a parent unit name component.
5346 -- N_Designator
5347 -- Sloc points to period
5348 -- Name holds the parent unit name
5349 -- Identifier
5351 -- Note: Name is always non-Empty, since this node is only used for the
5352 -- case where a parent library unit package name is present.
5354 -- Note that the identifier can also be an operator symbol here
5356 ------------------------------
5357 -- 6.1 Defining Designator --
5358 ------------------------------
5360 -- DEFINING_DESIGNATOR ::=
5361 -- DEFINING_PROGRAM_UNIT_NAME | DEFINING_OPERATOR_SYMBOL
5363 -------------------------------------
5364 -- 6.1 Defining Program Unit Name --
5365 -------------------------------------
5367 -- DEFINING_PROGRAM_UNIT_NAME ::=
5368 -- [PARENT_UNIT_NAME .] DEFINING_IDENTIFIER
5370 -- The parent unit name is present only in the case of a child unit name
5371 -- (permissible only for Ada 95 for a library level unit, i.e. a unit
5372 -- at scope level one). If no such name is present, the defining program
5373 -- unit name is represented simply as the defining identifier. In the
5374 -- child unit case, the following node is used to represent the child
5375 -- unit name.
5377 -- N_Defining_Program_Unit_Name
5378 -- Sloc points to period
5379 -- Name holds the parent unit name
5380 -- Defining_Identifier
5382 -- Note: Name is always non-Empty, since this node is only used for the
5383 -- case where a parent unit name is present.
5385 --------------------------
5386 -- 6.1 Operator Symbol --
5387 --------------------------
5389 -- OPERATOR_SYMBOL ::= STRING_LITERAL
5391 -- Note: the fields of the N_Operator_Symbol node are laid out to match
5392 -- the corresponding fields of an N_Character_Literal node. This allows
5393 -- easy conversion of the operator symbol node into a character literal
5394 -- node in the case where a string constant of the form of an operator
5395 -- symbol is scanned out as such, but turns out semantically to be a
5396 -- string literal that is not an operator. For details see Sinfo.CN.
5397 -- Change_Operator_Symbol_To_String_Literal.
5399 -- N_Operator_Symbol
5400 -- Sloc points to literal
5401 -- Chars contains the Name_Id for the operator symbol
5402 -- Strval Id of string value. This is used if the operator
5403 -- symbol turns out to be a normal string after all.
5404 -- Entity
5405 -- Associated_Node Note this is shared with Entity
5406 -- Etype
5407 -- Has_Private_View (set in generic units)
5408 -- Has_Secondary_Private_View (set in generic units)
5410 -- Note: the Strval field may be set to No_String for generated
5411 -- operator symbols that are known not to be string literals
5412 -- semantically.
5414 -----------------------------------
5415 -- 6.1 Defining Operator Symbol --
5416 -----------------------------------
5418 -- DEFINING_OPERATOR_SYMBOL ::= OPERATOR_SYMBOL
5420 -- A defining operator symbol is an entity, which has additional
5421 -- fields depending on the setting of the Ekind field. These
5422 -- additional fields are defined (and access subprograms declared)
5423 -- in package Einfo.
5425 -- N_Defining_Operator_Symbol
5426 -- Sloc points to literal
5427 -- Chars contains the Name_Id for the operator symbol
5428 -- Next_Entity
5429 -- Scope
5430 -- Etype
5432 ----------------------------
5433 -- 6.1 Parameter Profile --
5434 ----------------------------
5436 -- PARAMETER_PROFILE ::= [FORMAL_PART]
5438 ---------------------------------------
5439 -- 6.1 Parameter and Result Profile --
5440 ---------------------------------------
5442 -- PARAMETER_AND_RESULT_PROFILE ::=
5443 -- [FORMAL_PART] return [NULL_EXCLUSION] SUBTYPE_MARK
5444 -- | [FORMAL_PART] return ACCESS_DEFINITION
5446 -- There is no explicit node in the tree for a parameter and result
5447 -- profile. Instead the information appears directly in the parent.
5449 ----------------------
5450 -- 6.1 Formal Part --
5451 ----------------------
5453 -- FORMAL_PART ::=
5454 -- (PARAMETER_SPECIFICATION {; PARAMETER_SPECIFICATION})
5456 ----------------------------------
5457 -- 6.1 Parameter Specification --
5458 ----------------------------------
5460 -- PARAMETER_SPECIFICATION ::=
5461 -- DEFINING_IDENTIFIER_LIST : [ALIASED] MODE [NULL_EXCLUSION]
5462 -- SUBTYPE_MARK [:= DEFAULT_EXPRESSION] [ASPECT_SPECIFICATIONS]
5463 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
5464 -- [:= DEFAULT_EXPRESSION] [ASPECT_SPECIFICATIONS]
5466 -- Although the syntax allows multiple identifiers in the list, the
5467 -- semantics is as though successive specifications were given with
5468 -- identical type definition and expression components. To simplify
5469 -- semantic processing, the parser represents a multiple declaration
5470 -- case as a sequence of single Specifications, using the More_Ids and
5471 -- Prev_Ids flags to preserve the original source form as described
5472 -- in the section on "Handling of Defining Identifier Lists".
5474 -- ALIASED can only be present in Ada 2012 mode
5476 -- N_Parameter_Specification
5477 -- Sloc points to first identifier
5478 -- Defining_Identifier
5479 -- Aliased_Present
5480 -- In_Present
5481 -- Out_Present
5482 -- Null_Exclusion_Present
5483 -- Parameter_Type subtype mark or access definition
5484 -- Expression (set to Empty if no default expression present)
5485 -- More_Ids (set to False if no more identifiers in list)
5486 -- Prev_Ids (set to False if no previous identifiers in list)
5487 -- Default_Expression
5489 ---------------
5490 -- 6.1 Mode --
5491 ---------------
5493 -- MODE ::= [in] | in out | out
5495 -- There is no explicit node in the tree for the Mode. Instead the
5496 -- In_Present and Out_Present flags are set in the parent node to
5497 -- record the presence of keywords specifying the mode.
5499 --------------------------
5500 -- 6.3 Subprogram Body --
5501 --------------------------
5503 -- SUBPROGRAM_BODY ::=
5504 -- SUBPROGRAM_SPECIFICATION [ASPECT_SPECIFICATIONS] is
5505 -- DECLARATIVE_PART
5506 -- begin
5507 -- HANDLED_SEQUENCE_OF_STATEMENTS
5508 -- end [DESIGNATOR];
5510 -- N_Subprogram_Body
5511 -- Sloc points to FUNCTION or PROCEDURE
5512 -- Specification
5513 -- Declarations
5514 -- Handled_Statement_Sequence
5515 -- Activation_Chain_Entity
5516 -- Corresponding_Spec
5517 -- Acts_As_Spec
5518 -- Bad_Is_Detected used only by parser
5519 -- Do_Storage_Check
5520 -- Has_Relative_Deadline_Pragma
5521 -- Is_Entry_Barrier_Function
5522 -- Is_Protected_Subprogram_Body
5523 -- Is_Task_Body_Procedure
5524 -- Is_Task_Master
5525 -- Was_Attribute_Reference
5526 -- Was_Expression_Function
5527 -- Was_Originally_Stub
5529 -----------------------------------
5530 -- 6.4 Procedure Call Statement --
5531 -----------------------------------
5533 -- PROCEDURE_CALL_STATEMENT ::=
5534 -- procedure_NAME; | procedure_PREFIX ACTUAL_PARAMETER_PART;
5536 -- Note: the reason that a procedure call has expression fields is that
5537 -- it semantically resembles an expression, e.g. overloading is allowed
5538 -- and a type is concocted for semantic processing purposes. Certain of
5539 -- these fields, such as Parens are not relevant, but it is easier to
5540 -- just supply all of them together.
5542 -- N_Procedure_Call_Statement
5543 -- Sloc points to first token of name or prefix
5544 -- Name stores name or prefix
5545 -- Parameter_Associations (set to No_List if no
5546 -- actual parameter part)
5547 -- First_Named_Actual
5548 -- Controlling_Argument (set to Empty if not dispatching)
5549 -- Is_Elaboration_Checks_OK_Node
5550 -- Is_SPARK_Mode_On_Node
5551 -- Is_Elaboration_Warnings_OK_Node
5552 -- No_Elaboration_Check
5553 -- Is_Known_Guaranteed_ABE
5554 -- plus fields for expression
5556 -- If any IN parameter requires a range check, then the corresponding
5557 -- argument expression has the Do_Range_Check flag set, and the range
5558 -- check is done against the formal type. Note that this argument
5559 -- expression may appear directly in the Parameter_Associations list,
5560 -- or may be a descendant of an N_Parameter_Association node that
5561 -- appears in this list.
5563 ------------------------
5564 -- 6.4 Function Call --
5565 ------------------------
5567 -- FUNCTION_CALL ::=
5568 -- function_NAME | function_PREFIX ACTUAL_PARAMETER_PART
5570 -- Note: the parser may generate an indexed component node or simply
5571 -- a name node instead of a function call node. The semantic pass must
5572 -- correct this misidentification.
5574 -- N_Function_Call
5575 -- Sloc points to first token of name or prefix
5576 -- Name stores name or prefix
5577 -- Parameter_Associations (set to No_List if no
5578 -- actual parameter part)
5579 -- First_Named_Actual
5580 -- Controlling_Argument (set to Empty if not dispatching)
5581 -- Is_Elaboration_Checks_OK_Node
5582 -- Is_SPARK_Mode_On_Node
5583 -- Is_Elaboration_Warnings_OK_Node
5584 -- No_Elaboration_Check
5585 -- Is_Expanded_Build_In_Place_Call
5586 -- Is_Known_Guaranteed_ABE
5587 -- plus fields for expression
5589 --------------------------------
5590 -- 6.4 Actual Parameter Part --
5591 --------------------------------
5593 -- ACTUAL_PARAMETER_PART ::=
5594 -- (PARAMETER_ASSOCIATION {,PARAMETER_ASSOCIATION})
5596 --------------------------------
5597 -- 6.4 Parameter Association --
5598 --------------------------------
5600 -- PARAMETER_ASSOCIATION ::=
5601 -- [formal_parameter_SELECTOR_NAME =>] EXPLICIT_ACTUAL_PARAMETER
5603 -- Note: the N_Parameter_Association node is built only if a formal
5604 -- parameter selector name is present, otherwise the parameter
5605 -- association appears in the tree simply as the node for the
5606 -- explicit actual parameter.
5608 -- N_Parameter_Association
5609 -- Sloc points to formal parameter
5610 -- Selector_Name (always non-Empty)
5611 -- Explicit_Actual_Parameter
5612 -- Next_Named_Actual
5613 -- Is_Accessibility_Actual
5615 ---------------------------
5616 -- 6.4 Actual Parameter --
5617 ---------------------------
5619 -- EXPLICIT_ACTUAL_PARAMETER ::=
5620 -- EXPRESSION | variable_NAME | REDUCTION_EXPRESSION_PARAMETER
5622 ---------------------------
5623 -- 6.5 Return Statement --
5624 ---------------------------
5626 -- SIMPLE_RETURN_STATEMENT ::= return [EXPRESSION];
5628 -- EXTENDED_RETURN_STATEMENT ::=
5629 -- return DEFINING_IDENTIFIER : [aliased] RETURN_SUBTYPE_INDICATION
5630 -- [:= EXPRESSION] [do
5631 -- HANDLED_SEQUENCE_OF_STATEMENTS
5632 -- end return];
5634 -- RETURN_SUBTYPE_INDICATION ::= SUBTYPE_INDICATION | ACCESS_DEFINITION
5636 -- The term "return statement" is defined in 6.5 to mean either a
5637 -- SIMPLE_RETURN_STATEMENT or an EXTENDED_RETURN_STATEMENT. We avoid
5638 -- the use of this term, since it used to mean something else in earlier
5639 -- versions of Ada.
5641 -- N_Simple_Return_Statement
5642 -- Sloc points to RETURN
5643 -- Return_Statement_Entity
5644 -- Expression (set to Empty if no expression present)
5645 -- Storage_Pool
5646 -- Procedure_To_Call
5647 -- Comes_From_Extended_Return_Statement
5649 -- Note: Return_Statement_Entity points to an E_Return_Statement
5651 -- If a range check is required, then Do_Range_Check is set on the
5652 -- Expression. The check is against the return subtype of the function.
5654 -- N_Extended_Return_Statement
5655 -- Sloc points to RETURN
5656 -- Return_Statement_Entity
5657 -- Return_Object_Declarations
5658 -- Handled_Statement_Sequence (set to Empty if not present)
5659 -- Storage_Pool
5660 -- Procedure_To_Call
5662 -- Note: Return_Statement_Entity points to an E_Return_Statement.
5664 -- Note that Return_Object_Declarations is a list containing the
5665 -- N_Object_Declaration -- see comment on this field above.
5667 -- The declared object will have Is_Return_Object = True.
5669 -- There is no such syntactic category as return_object_declaration
5670 -- in the RM. Return_Object_Declarations represents this portion of
5671 -- the syntax for EXTENDED_RETURN_STATEMENT:
5672 -- DEFINING_IDENTIFIER : [aliased] RETURN_SUBTYPE_INDICATION
5673 -- [:= EXPRESSION]
5675 -- There are two entities associated with an extended_return_statement:
5676 -- the Return_Statement_Entity represents the statement itself,
5677 -- and the Defining_Identifier of the Object_Declaration in
5678 -- Return_Object_Declarations represents the object being
5679 -- returned. N_Simple_Return_Statement has only the former.
5681 ------------------------------
5682 -- 6.8 Expression Function --
5683 ------------------------------
5685 -- EXPRESSION_FUNCTION ::=
5686 -- FUNCTION SPECIFICATION IS (EXPRESSION)
5687 -- [ASPECT_SPECIFICATIONS];
5689 -- N_Expression_Function
5690 -- Sloc points to FUNCTION
5691 -- Specification
5692 -- Expression
5693 -- Corresponding_Spec
5695 ------------------------------
5696 -- 7.1 Package Declaration --
5697 ------------------------------
5699 -- PACKAGE_DECLARATION ::=
5700 -- PACKAGE_SPECIFICATION;
5702 -- Note: the activation chain entity for a package spec is used for
5703 -- all tasks declared in the package spec, or in the package body.
5705 -- N_Package_Declaration
5706 -- Sloc points to PACKAGE
5707 -- Specification
5708 -- Corresponding_Body
5709 -- Parent_Spec
5710 -- Activation_Chain_Entity
5712 --------------------------------
5713 -- 7.1 Package Specification --
5714 --------------------------------
5716 -- PACKAGE_SPECIFICATION ::=
5717 -- package DEFINING_PROGRAM_UNIT_NAME
5718 -- [ASPECT_SPECIFICATIONS]
5719 -- is
5720 -- {BASIC_DECLARATIVE_ITEM}
5721 -- [private
5722 -- {BASIC_DECLARATIVE_ITEM}]
5723 -- end [[PARENT_UNIT_NAME .] IDENTIFIER]
5725 -- N_Package_Specification
5726 -- Sloc points to PACKAGE
5727 -- Defining_Unit_Name
5728 -- Visible_Declarations
5729 -- Private_Declarations (set to No_List if no private
5730 -- part present)
5731 -- End_Label
5732 -- Generic_Parent
5733 -- Limited_View_Installed
5735 -----------------------
5736 -- 7.1 Package Body --
5737 -----------------------
5739 -- PACKAGE_BODY ::=
5740 -- package body DEFINING_PROGRAM_UNIT_NAME
5741 -- [ASPECT_SPECIFICATIONS]
5742 -- is
5743 -- DECLARATIVE_PART
5744 -- [begin
5745 -- HANDLED_SEQUENCE_OF_STATEMENTS]
5746 -- end [[PARENT_UNIT_NAME .] IDENTIFIER];
5748 -- N_Package_Body
5749 -- Sloc points to PACKAGE
5750 -- Defining_Unit_Name
5751 -- Declarations
5752 -- Handled_Statement_Sequence (set to Empty if no HSS present)
5753 -- Corresponding_Spec
5754 -- Was_Originally_Stub
5755 -- At_End_Proc (set to Empty if no clean up procedure)
5757 -- Note: if a source level package does not contain a handled sequence
5758 -- of statements, then the parser supplies a dummy one with a null
5759 -- sequence of statements. Comes_From_Source will be False in this
5760 -- constructed sequence. The reason we need this is for the End_Label
5761 -- field in the HSS.
5763 -----------------------------------
5764 -- 7.4 Private Type Declaration --
5765 -----------------------------------
5767 -- PRIVATE_TYPE_DECLARATION ::=
5768 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
5769 -- is [[abstract] tagged] [limited] private
5770 -- [ASPECT_SPECIFICATIONS];
5772 -- Note: TAGGED is not permitted in Ada 83 mode
5774 -- N_Private_Type_Declaration
5775 -- Sloc points to TYPE
5776 -- Defining_Identifier
5777 -- Discriminant_Specifications (set to No_List if no
5778 -- discriminant part)
5779 -- Unknown_Discriminants_Present set if (<>) discriminant
5780 -- Abstract_Present
5781 -- Tagged_Present
5782 -- Limited_Present
5784 ----------------------------------------
5785 -- 7.4 Private Extension Declaration --
5786 ----------------------------------------
5788 -- PRIVATE_EXTENSION_DECLARATION ::=
5789 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] is
5790 -- [abstract] [limited | synchronized]
5791 -- new ancestor_SUBTYPE_INDICATION [and INTERFACE_LIST]
5792 -- with private [ASPECT_SPECIFICATIONS];
5794 -- Note: LIMITED, and private extension declarations are not allowed
5795 -- in Ada 83 mode.
5797 -- N_Private_Extension_Declaration
5798 -- Sloc points to TYPE
5799 -- Defining_Identifier
5800 -- Uninitialized_Variable
5801 -- Discriminant_Specifications (set to No_List if no
5802 -- discriminant part)
5803 -- Unknown_Discriminants_Present set if (<>) discriminant
5804 -- Abstract_Present
5805 -- Limited_Present
5806 -- Synchronized_Present
5807 -- Subtype_Indication
5808 -- Interface_List (set to No_List if none)
5810 ---------------------
5811 -- 8.4 Use Clause --
5812 ---------------------
5814 -- USE_CLAUSE ::= USE_PACKAGE_CLAUSE | USE_TYPE_CLAUSE
5816 -----------------------------
5817 -- 8.4 Use Package Clause --
5818 -----------------------------
5820 -- USE_PACKAGE_CLAUSE ::= use package_NAME {, package_NAME};
5822 -- N_Use_Package_Clause
5823 -- Sloc points to USE
5824 -- Prev_Use_Clause
5825 -- Name
5826 -- Next_Use_Clause
5827 -- Associated_Node
5828 -- Hidden_By_Use_Clause
5829 -- Is_Effective_Use_Clause
5830 -- More_Ids (set to False if no more identifiers in list)
5831 -- Prev_Ids (set to False if no previous identifiers in list)
5833 --------------------------
5834 -- 8.4 Use Type Clause --
5835 --------------------------
5837 -- USE_TYPE_CLAUSE ::= use [ALL] type SUBTYPE_MARK {, SUBTYPE_MARK};
5839 -- Note: use type clause is not permitted in Ada 83 mode
5841 -- Note: the ALL keyword can appear only in Ada 2012 mode
5843 -- N_Use_Type_Clause
5844 -- Sloc points to USE
5845 -- Prev_Use_Clause
5846 -- Used_Operations
5847 -- Next_Use_Clause
5848 -- Subtype_Mark
5849 -- Hidden_By_Use_Clause
5850 -- Is_Effective_Use_Clause
5851 -- More_Ids (set to False if no more identifiers in list)
5852 -- Prev_Ids (set to False if no previous identifiers in list)
5853 -- All_Present
5855 -------------------------------
5856 -- 8.5 Renaming Declaration --
5857 -------------------------------
5859 -- RENAMING_DECLARATION ::=
5860 -- OBJECT_RENAMING_DECLARATION
5861 -- | EXCEPTION_RENAMING_DECLARATION
5862 -- | PACKAGE_RENAMING_DECLARATION
5863 -- | SUBPROGRAM_RENAMING_DECLARATION
5864 -- | GENERIC_RENAMING_DECLARATION
5866 --------------------------------------
5867 -- 8.5 Object Renaming Declaration --
5868 --------------------------------------
5870 -- OBJECT_RENAMING_DECLARATION ::=
5871 -- DEFINING_IDENTIFIER :
5872 -- [NULL_EXCLUSION] SUBTYPE_MARK renames object_NAME
5873 -- [ASPECT_SPECIFICATIONS];
5874 -- | DEFINING_IDENTIFIER :
5875 -- ACCESS_DEFINITION renames object_NAME
5876 -- [ASPECT_SPECIFICATIONS];
5878 -- Note: Access_Definition is an optional field that gives support to
5879 -- Ada 2005 (AI-230). The parser generates nodes that have either the
5880 -- Subtype_Indication field or else the Access_Definition field.
5882 -- N_Object_Renaming_Declaration
5883 -- Sloc points to first identifier
5884 -- Defining_Identifier
5885 -- Null_Exclusion_Present (set to False if not present)
5886 -- Subtype_Mark (set to Empty if not present)
5887 -- Access_Definition (set to Empty if not present)
5888 -- Name
5889 -- Corresponding_Generic_Association
5891 -----------------------------------------
5892 -- 8.5 Exception Renaming Declaration --
5893 -----------------------------------------
5895 -- EXCEPTION_RENAMING_DECLARATION ::=
5896 -- DEFINING_IDENTIFIER : exception renames exception_NAME
5897 -- [ASPECT_SPECIFICATIONS];
5899 -- N_Exception_Renaming_Declaration
5900 -- Sloc points to first identifier
5901 -- Defining_Identifier
5902 -- Name
5904 ---------------------------------------
5905 -- 8.5 Package Renaming Declaration --
5906 ---------------------------------------
5908 -- PACKAGE_RENAMING_DECLARATION ::=
5909 -- package DEFINING_PROGRAM_UNIT_NAME renames package_NAME
5910 -- [ASPECT_SPECIFICATIONS];
5912 -- N_Package_Renaming_Declaration
5913 -- Sloc points to PACKAGE
5914 -- Defining_Unit_Name
5915 -- Name
5916 -- Parent_Spec
5918 ------------------------------------------
5919 -- 8.5 Subprogram Renaming Declaration --
5920 ------------------------------------------
5922 -- SUBPROGRAM_RENAMING_DECLARATION ::=
5923 -- SUBPROGRAM_SPECIFICATION renames callable_entity_NAME
5924 -- [ASPECT_SPECIFICATIONS];
5926 -- N_Subprogram_Renaming_Declaration
5927 -- Sloc points to RENAMES
5928 -- Specification
5929 -- Name
5930 -- Parent_Spec
5931 -- Corresponding_Spec
5932 -- Corresponding_Formal_Spec
5933 -- From_Default
5935 -----------------------------------------
5936 -- 8.5.5 Generic Renaming Declaration --
5937 -----------------------------------------
5939 -- GENERIC_RENAMING_DECLARATION ::=
5940 -- generic package DEFINING_PROGRAM_UNIT_NAME
5941 -- renames generic_package_NAME
5942 -- [ASPECT_SPECIFICATIONS];
5943 -- | generic procedure DEFINING_PROGRAM_UNIT_NAME
5944 -- renames generic_procedure_NAME
5945 -- [ASPECT_SPECIFICATIONS];
5946 -- | generic function DEFINING_PROGRAM_UNIT_NAME
5947 -- renames generic_function_NAME
5948 -- [ASPECT_SPECIFICATIONS];
5950 -- N_Generic_Package_Renaming_Declaration
5951 -- Sloc points to GENERIC
5952 -- Defining_Unit_Name
5953 -- Name
5954 -- Parent_Spec
5956 -- N_Generic_Procedure_Renaming_Declaration
5957 -- Sloc points to GENERIC
5958 -- Defining_Unit_Name
5959 -- Name
5960 -- Parent_Spec
5962 -- N_Generic_Function_Renaming_Declaration
5963 -- Sloc points to GENERIC
5964 -- Defining_Unit_Name
5965 -- Name
5966 -- Parent_Spec
5968 --------------------------------
5969 -- 9.1 Task Type Declaration --
5970 --------------------------------
5972 -- TASK_TYPE_DECLARATION ::=
5973 -- task type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
5974 -- [ASPECT_SPECIFICATIONS]
5975 -- [is [new INTERFACE_LIST with] TASK_DEFINITION];
5977 -- N_Task_Type_Declaration
5978 -- Sloc points to TASK
5979 -- Defining_Identifier
5980 -- Discriminant_Specifications (set to No_List if no
5981 -- discriminant part)
5982 -- Interface_List (set to No_List if none)
5983 -- Task_Definition (set to Empty if not present)
5984 -- Corresponding_Body
5986 ----------------------------------
5987 -- 9.1 Single Task Declaration --
5988 ----------------------------------
5990 -- SINGLE_TASK_DECLARATION ::=
5991 -- task DEFINING_IDENTIFIER
5992 -- [ASPECT_SPECIFICATIONS]
5993 -- [is [new INTERFACE_LIST with] TASK_DEFINITION];
5995 -- N_Single_Task_Declaration
5996 -- Sloc points to TASK
5997 -- Defining_Identifier
5998 -- Interface_List (set to No_List if none)
5999 -- Task_Definition (set to Empty if not present)
6001 --------------------------
6002 -- 9.1 Task Definition --
6003 --------------------------
6005 -- TASK_DEFINITION ::=
6006 -- {TASK_ITEM}
6007 -- [private
6008 -- {TASK_ITEM}]
6009 -- end [task_IDENTIFIER]
6011 -- Note: as a result of semantic analysis, the list of task items can
6012 -- include implicit type declarations resulting from entry families.
6014 -- N_Task_Definition
6015 -- Sloc points to first token of task definition
6016 -- Visible_Declarations
6017 -- Private_Declarations (set to No_List if no private part)
6018 -- End_Label
6019 -- Has_Storage_Size_Pragma
6020 -- Has_Relative_Deadline_Pragma
6022 --------------------
6023 -- 9.1 Task Item --
6024 --------------------
6026 -- TASK_ITEM ::= ENTRY_DECLARATION | REPRESENTATION_CLAUSE
6028 --------------------
6029 -- 9.1 Task Body --
6030 --------------------
6032 -- TASK_BODY ::=
6033 -- task body task_DEFINING_IDENTIFIER
6034 -- [ASPECT_SPECIFICATIONS]
6035 -- is
6036 -- DECLARATIVE_PART
6037 -- begin
6038 -- HANDLED_SEQUENCE_OF_STATEMENTS
6039 -- end [task_IDENTIFIER];
6041 -- Gigi restriction: This node never appears
6043 -- N_Task_Body
6044 -- Sloc points to TASK
6045 -- Defining_Identifier
6046 -- Declarations
6047 -- Handled_Statement_Sequence
6048 -- Is_Task_Master
6049 -- Activation_Chain_Entity
6050 -- Corresponding_Spec
6051 -- Was_Originally_Stub
6053 -------------------------------------
6054 -- 9.4 Protected Type Declaration --
6055 -------------------------------------
6057 -- PROTECTED_TYPE_DECLARATION ::=
6058 -- protected type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
6059 -- [ASPECT_SPECIFICATIONS]
6060 -- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
6062 -- Note: protected type declarations are not permitted in Ada 83 mode
6064 -- N_Protected_Type_Declaration
6065 -- Sloc points to PROTECTED
6066 -- Defining_Identifier
6067 -- Discriminant_Specifications (set to No_List if no
6068 -- discriminant part)
6069 -- Interface_List (set to No_List if none)
6070 -- Protected_Definition
6071 -- Corresponding_Body
6073 ---------------------------------------
6074 -- 9.4 Single Protected Declaration --
6075 ---------------------------------------
6077 -- SINGLE_PROTECTED_DECLARATION ::=
6078 -- protected DEFINING_IDENTIFIER
6079 -- [ASPECT_SPECIFICATIONS]
6080 -- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
6082 -- Note: single protected declarations are not allowed in Ada 83 mode
6084 -- N_Single_Protected_Declaration
6085 -- Sloc points to PROTECTED
6086 -- Defining_Identifier
6087 -- Interface_List (set to No_List if none)
6088 -- Protected_Definition
6090 -------------------------------
6091 -- 9.4 Protected Definition --
6092 -------------------------------
6094 -- PROTECTED_DEFINITION ::=
6095 -- {PROTECTED_OPERATION_DECLARATION}
6096 -- [private
6097 -- {PROTECTED_ELEMENT_DECLARATION}]
6098 -- end [protected_IDENTIFIER]
6100 -- N_Protected_Definition
6101 -- Sloc points to first token of protected definition
6102 -- Visible_Declarations
6103 -- Private_Declarations (set to No_List if no private part)
6104 -- End_Label
6106 ------------------------------------------
6107 -- 9.4 Protected Operation Declaration --
6108 ------------------------------------------
6110 -- PROTECTED_OPERATION_DECLARATION ::=
6111 -- SUBPROGRAM_DECLARATION
6112 -- | ENTRY_DECLARATION
6113 -- | REPRESENTATION_CLAUSE
6115 ----------------------------------------
6116 -- 9.4 Protected Element Declaration --
6117 ----------------------------------------
6119 -- PROTECTED_ELEMENT_DECLARATION ::=
6120 -- PROTECTED_OPERATION_DECLARATION | COMPONENT_DECLARATION
6122 -------------------------
6123 -- 9.4 Protected Body --
6124 -------------------------
6126 -- PROTECTED_BODY ::=
6127 -- protected body DEFINING_IDENTIFIER
6128 -- [ASPECT_SPECIFICATIONS];
6129 -- is
6130 -- {PROTECTED_OPERATION_ITEM}
6131 -- end [protected_IDENTIFIER];
6133 -- Note: protected bodies are not allowed in Ada 83 mode
6135 -- Gigi restriction: This node never appears
6137 -- N_Protected_Body
6138 -- Sloc points to PROTECTED
6139 -- Defining_Identifier
6140 -- Declarations protected operation items (and pragmas)
6141 -- End_Label
6142 -- Corresponding_Spec
6143 -- Was_Originally_Stub
6145 -----------------------------------
6146 -- 9.4 Protected Operation Item --
6147 -----------------------------------
6149 -- PROTECTED_OPERATION_ITEM ::=
6150 -- SUBPROGRAM_DECLARATION
6151 -- | SUBPROGRAM_BODY
6152 -- | ENTRY_BODY
6153 -- | REPRESENTATION_CLAUSE
6155 ------------------------------
6156 -- 9.5.2 Entry Declaration --
6157 ------------------------------
6159 -- ENTRY_DECLARATION ::=
6160 -- [[not] overriding]
6161 -- entry DEFINING_IDENTIFIER
6162 -- [(DISCRETE_SUBTYPE_DEFINITION)] PARAMETER_PROFILE
6163 -- [ASPECT_SPECIFICATIONS];
6165 -- N_Entry_Declaration
6166 -- Sloc points to ENTRY
6167 -- Defining_Identifier
6168 -- Discrete_Subtype_Definition (set to Empty if not present)
6169 -- Parameter_Specifications (set to No_List if no formal part)
6170 -- Corresponding_Body
6171 -- Must_Override set if overriding indicator present
6172 -- Must_Not_Override set if not_overriding indicator present
6174 -- Note: overriding indicator is an Ada 2005 feature
6176 -----------------------------
6177 -- 9.5.2 Accept statement --
6178 -----------------------------
6180 -- ACCEPT_STATEMENT ::=
6181 -- accept entry_DIRECT_NAME
6182 -- [(ENTRY_INDEX)] PARAMETER_PROFILE [do
6183 -- HANDLED_SEQUENCE_OF_STATEMENTS
6184 -- end [entry_IDENTIFIER]];
6186 -- Gigi restriction: This node never appears
6188 -- Note: there are no explicit declarations allowed in an accept
6189 -- statement. However, the implicit declarations for any statement
6190 -- identifiers (labels and block/loop identifiers) are declarations
6191 -- that belong logically to the accept statement, and that is why
6192 -- there is a Declarations field in this node.
6194 -- N_Accept_Statement
6195 -- Sloc points to ACCEPT
6196 -- Entry_Direct_Name
6197 -- Entry_Index (set to Empty if not present)
6198 -- Parameter_Specifications (set to No_List if no formal part)
6199 -- Handled_Statement_Sequence
6200 -- Declarations (set to No_List if no declarations)
6202 ------------------------
6203 -- 9.5.2 Entry Index --
6204 ------------------------
6206 -- ENTRY_INDEX ::= EXPRESSION
6208 -----------------------
6209 -- 9.5.2 Entry Body --
6210 -----------------------
6212 -- ENTRY_BODY ::=
6213 -- entry DEFINING_IDENTIFIER ENTRY_BODY_FORMAL_PART ENTRY_BARRIER is
6214 -- DECLARATIVE_PART
6215 -- begin
6216 -- HANDLED_SEQUENCE_OF_STATEMENTS
6217 -- end [entry_IDENTIFIER];
6219 -- ENTRY_BARRIER ::= when CONDITION
6221 -- Note: we store the CONDITION of the ENTRY_BARRIER in the node for
6222 -- the ENTRY_BODY_FORMAL_PART to avoid the N_Entry_Body node getting
6223 -- too full (it would otherwise have too many fields)
6225 -- Gigi restriction: This node never appears
6227 -- N_Entry_Body
6228 -- Sloc points to ENTRY
6229 -- Defining_Identifier
6230 -- Entry_Body_Formal_Part
6231 -- Declarations
6232 -- Handled_Statement_Sequence
6233 -- Activation_Chain_Entity
6234 -- Corresponding_Spec
6235 -- At_End_Proc (set to Empty if no clean up procedure)
6237 -----------------------------------
6238 -- 9.5.2 Entry Body Formal Part --
6239 -----------------------------------
6241 -- ENTRY_BODY_FORMAL_PART ::=
6242 -- [(ENTRY_INDEX_SPECIFICATION)] PARAMETER_PROFILE
6244 -- Note that an entry body formal part node is present even if it is
6245 -- empty. This reflects the grammar, in which it is the components of
6246 -- the entry body formal part that are optional, not the entry body
6247 -- formal part itself. Also this means that the barrier condition
6248 -- always has somewhere to be stored.
6250 -- Gigi restriction: This node never appears
6252 -- N_Entry_Body_Formal_Part
6253 -- Sloc points to first token
6254 -- Entry_Index_Specification (set to Empty if not present)
6255 -- Parameter_Specifications (set to No_List if no formal part)
6256 -- Condition from entry barrier of entry body
6258 --------------------------
6259 -- 9.5.2 Entry Barrier --
6260 --------------------------
6262 -- ENTRY_BARRIER ::= when CONDITION
6264 --------------------------------------
6265 -- 9.5.2 Entry Index Specification --
6266 --------------------------------------
6268 -- ENTRY_INDEX_SPECIFICATION ::=
6269 -- for DEFINING_IDENTIFIER in DISCRETE_SUBTYPE_DEFINITION
6271 -- Gigi restriction: This node never appears
6273 -- N_Entry_Index_Specification
6274 -- Sloc points to FOR
6275 -- Defining_Identifier
6276 -- Discrete_Subtype_Definition
6278 ---------------------------------
6279 -- 9.5.3 Entry Call Statement --
6280 ---------------------------------
6282 -- ENTRY_CALL_STATEMENT ::= entry_NAME [ACTUAL_PARAMETER_PART];
6284 -- The parser may generate a procedure call for this construct. The
6285 -- semantic pass must correct this misidentification where needed.
6287 -- Gigi restriction: This node never appears
6289 -- N_Entry_Call_Statement
6290 -- Sloc points to first token of name
6291 -- Name
6292 -- Parameter_Associations (set to No_List if no
6293 -- actual parameter part)
6294 -- First_Named_Actual
6295 -- Is_Elaboration_Checks_OK_Node
6296 -- Is_SPARK_Mode_On_Node
6297 -- Is_Elaboration_Warnings_OK_Node
6299 ------------------------------
6300 -- 9.5.4 Requeue Statement --
6301 ------------------------------
6303 -- REQUEUE_STATEMENT ::= requeue entry_NAME [with abort];
6305 -- Note: requeue statements are not permitted in Ada 83 mode
6307 -- Gigi restriction: This node never appears
6309 -- N_Requeue_Statement
6310 -- Sloc points to REQUEUE
6311 -- Name
6312 -- Abort_Present
6313 -- Is_Elaboration_Checks_OK_Node
6314 -- Is_SPARK_Mode_On_Node
6315 -- Is_Elaboration_Warnings_OK_Node
6317 --------------------------
6318 -- 9.6 Delay Statement --
6319 --------------------------
6321 -- DELAY_STATEMENT ::=
6322 -- DELAY_UNTIL_STATEMENT
6323 -- | DELAY_RELATIVE_STATEMENT
6325 --------------------------------
6326 -- 9.6 Delay Until Statement --
6327 --------------------------------
6329 -- DELAY_UNTIL_STATEMENT ::= delay until delay_EXPRESSION;
6331 -- Note: delay until statements are not permitted in Ada 83 mode
6333 -- Gigi restriction: This node never appears
6335 -- N_Delay_Until_Statement
6336 -- Sloc points to DELAY
6337 -- Expression
6339 -----------------------------------
6340 -- 9.6 Delay Relative Statement --
6341 -----------------------------------
6343 -- DELAY_RELATIVE_STATEMENT ::= delay delay_EXPRESSION;
6345 -- Gigi restriction: This node never appears
6347 -- N_Delay_Relative_Statement
6348 -- Sloc points to DELAY
6349 -- Expression
6351 ---------------------------
6352 -- 9.7 Select Statement --
6353 ---------------------------
6355 -- SELECT_STATEMENT ::=
6356 -- SELECTIVE_ACCEPT
6357 -- | TIMED_ENTRY_CALL
6358 -- | CONDITIONAL_ENTRY_CALL
6359 -- | ASYNCHRONOUS_SELECT
6361 -----------------------------
6362 -- 9.7.1 Selective Accept --
6363 -----------------------------
6365 -- SELECTIVE_ACCEPT ::=
6366 -- select
6367 -- [GUARD]
6368 -- SELECT_ALTERNATIVE
6369 -- {or
6370 -- [GUARD]
6371 -- SELECT_ALTERNATIVE}
6372 -- [else
6373 -- SEQUENCE_OF_STATEMENTS]
6374 -- end select;
6376 -- Gigi restriction: This node never appears
6378 -- Note: the guard expression, if present, appears in the node for
6379 -- the select alternative.
6381 -- N_Selective_Accept
6382 -- Sloc points to SELECT
6383 -- Select_Alternatives
6384 -- Else_Statements (set to No_List if no else part)
6386 ------------------
6387 -- 9.7.1 Guard --
6388 ------------------
6390 -- GUARD ::= when CONDITION =>
6392 -- As noted above, the CONDITION that is part of a GUARD is included
6393 -- in the node for the select alternative for convenience.
6395 -------------------------------
6396 -- 9.7.1 Select Alternative --
6397 -------------------------------
6399 -- SELECT_ALTERNATIVE ::=
6400 -- ACCEPT_ALTERNATIVE
6401 -- | DELAY_ALTERNATIVE
6402 -- | TERMINATE_ALTERNATIVE
6404 -------------------------------
6405 -- 9.7.1 Accept Alternative --
6406 -------------------------------
6408 -- ACCEPT_ALTERNATIVE ::=
6409 -- ACCEPT_STATEMENT [SEQUENCE_OF_STATEMENTS]
6411 -- Gigi restriction: This node never appears
6413 -- N_Accept_Alternative
6414 -- Sloc points to ACCEPT
6415 -- Accept_Statement
6416 -- Condition from the guard (set to Empty if no guard present)
6417 -- Statements (set to Empty_List if no statements)
6418 -- Pragmas_Before pragmas before alt (set to No_List if none)
6419 -- Accept_Handler_Records
6421 ------------------------------
6422 -- 9.7.1 Delay Alternative --
6423 ------------------------------
6425 -- DELAY_ALTERNATIVE ::=
6426 -- DELAY_STATEMENT [SEQUENCE_OF_STATEMENTS]
6428 -- Gigi restriction: This node never appears
6430 -- N_Delay_Alternative
6431 -- Sloc points to DELAY
6432 -- Delay_Statement
6433 -- Condition from the guard (set to Empty if no guard present)
6434 -- Statements (set to Empty_List if no statements)
6435 -- Pragmas_Before pragmas before alt (set to No_List if none)
6437 ----------------------------------
6438 -- 9.7.1 Terminate Alternative --
6439 ----------------------------------
6441 -- TERMINATE_ALTERNATIVE ::= terminate;
6443 -- Gigi restriction: This node never appears
6445 -- N_Terminate_Alternative
6446 -- Sloc points to TERMINATE
6447 -- Condition from the guard (set to Empty if no guard present)
6448 -- Pragmas_Before pragmas before alt (set to No_List if none)
6449 -- Pragmas_After pragmas after alt (set to No_List if none)
6451 -----------------------------
6452 -- 9.7.2 Timed Entry Call --
6453 -----------------------------
6455 -- TIMED_ENTRY_CALL ::=
6456 -- select
6457 -- ENTRY_CALL_ALTERNATIVE
6458 -- or
6459 -- DELAY_ALTERNATIVE
6460 -- end select;
6462 -- Gigi restriction: This node never appears
6464 -- N_Timed_Entry_Call
6465 -- Sloc points to SELECT
6466 -- Entry_Call_Alternative
6467 -- Delay_Alternative
6469 -----------------------------------
6470 -- 9.7.2 Entry Call Alternative --
6471 -----------------------------------
6473 -- ENTRY_CALL_ALTERNATIVE ::=
6474 -- PROCEDURE_OR_ENTRY_CALL [SEQUENCE_OF_STATEMENTS]
6476 -- PROCEDURE_OR_ENTRY_CALL ::=
6477 -- PROCEDURE_CALL_STATEMENT | ENTRY_CALL_STATEMENT
6479 -- Gigi restriction: This node never appears
6481 -- N_Entry_Call_Alternative
6482 -- Sloc points to first token of entry call statement
6483 -- Entry_Call_Statement
6484 -- Statements (set to Empty_List if no statements)
6485 -- Pragmas_Before pragmas before alt (set to No_List if none)
6487 -----------------------------------
6488 -- 9.7.3 Conditional Entry Call --
6489 -----------------------------------
6491 -- CONDITIONAL_ENTRY_CALL ::=
6492 -- select
6493 -- ENTRY_CALL_ALTERNATIVE
6494 -- else
6495 -- SEQUENCE_OF_STATEMENTS
6496 -- end select;
6498 -- Gigi restriction: This node never appears
6500 -- N_Conditional_Entry_Call
6501 -- Sloc points to SELECT
6502 -- Entry_Call_Alternative
6503 -- Else_Statements
6505 --------------------------------
6506 -- 9.7.4 Asynchronous Select --
6507 --------------------------------
6509 -- ASYNCHRONOUS_SELECT ::=
6510 -- select
6511 -- TRIGGERING_ALTERNATIVE
6512 -- then abort
6513 -- ABORTABLE_PART
6514 -- end select;
6516 -- Note: asynchronous select is not permitted in Ada 83 mode
6518 -- Gigi restriction: This node never appears
6520 -- N_Asynchronous_Select
6521 -- Sloc points to SELECT
6522 -- Triggering_Alternative
6523 -- Abortable_Part
6525 -----------------------------------
6526 -- 9.7.4 Triggering Alternative --
6527 -----------------------------------
6529 -- TRIGGERING_ALTERNATIVE ::=
6530 -- TRIGGERING_STATEMENT [SEQUENCE_OF_STATEMENTS]
6532 -- Gigi restriction: This node never appears
6534 -- N_Triggering_Alternative
6535 -- Sloc points to first token of triggering statement
6536 -- Triggering_Statement
6537 -- Statements (set to Empty_List if no statements)
6538 -- Pragmas_Before pragmas before alt (set to No_List if none)
6540 ---------------------------------
6541 -- 9.7.4 Triggering Statement --
6542 ---------------------------------
6544 -- TRIGGERING_STATEMENT ::= PROCEDURE_OR_ENTRY_CALL | DELAY_STATEMENT
6546 ---------------------------
6547 -- 9.7.4 Abortable Part --
6548 ---------------------------
6550 -- ABORTABLE_PART ::= SEQUENCE_OF_STATEMENTS
6552 -- Gigi restriction: This node never appears
6554 -- N_Abortable_Part
6555 -- Sloc points to ABORT
6556 -- Statements
6558 --------------------------
6559 -- 9.8 Abort Statement --
6560 --------------------------
6562 -- ABORT_STATEMENT ::= abort task_NAME {, task_NAME};
6564 -- Gigi restriction: This node never appears
6566 -- N_Abort_Statement
6567 -- Sloc points to ABORT
6568 -- Names
6570 -------------------------
6571 -- 10.1.1 Compilation --
6572 -------------------------
6574 -- COMPILATION ::= {COMPILATION_UNIT}
6576 -- There is no explicit node in the tree for a compilation, since in
6577 -- general the compiler is processing only a single compilation unit
6578 -- at a time. It is possible to parse multiple units in syntax check
6579 -- only mode, but the trees are discarded in that case.
6581 ------------------------------
6582 -- 10.1.1 Compilation Unit --
6583 ------------------------------
6585 -- COMPILATION_UNIT ::=
6586 -- CONTEXT_CLAUSE LIBRARY_ITEM
6587 -- | CONTEXT_CLAUSE SUBUNIT
6589 -- The N_Compilation_Unit node itself represents the above syntax.
6590 -- However, there are two additional items not reflected in the above
6591 -- syntax. First we have the global declarations that are added by the
6592 -- code generator. These are outer level declarations (so they cannot
6593 -- be represented as being inside the units). An example is the wrapper
6594 -- subprograms that are created to do ABE checking. As always a list of
6595 -- declarations can contain actions as well (i.e. statements), and such
6596 -- statements are executed as part of the elaboration of the unit. Note
6597 -- that all such declarations are elaborated before the library unit.
6599 -- Similarly, certain actions need to be elaborated at the completion
6600 -- of elaboration of the library unit (notably the statement that sets
6601 -- the Boolean flag indicating that elaboration is complete).
6603 -- The third item not reflected in the syntax is pragmas that appear
6604 -- after the compilation unit. As always pragmas are a problem since
6605 -- they are not part of the formal syntax, but can be stuck into the
6606 -- source following a set of ad hoc rules, and we have to find an ad
6607 -- hoc way of sticking them into the tree. For pragmas that appear
6608 -- before the library unit, we just consider them to be part of the
6609 -- context clause, and pragmas can appear in the Context_Items list
6610 -- of the compilation unit. However, pragmas can also appear after
6611 -- the library item.
6613 -- To deal with all these problems, we create an auxiliary node for
6614 -- a compilation unit, referenced from the N_Compilation_Unit node,
6615 -- that contains these items.
6617 -- N_Compilation_Unit
6618 -- Sloc points to first token of defining unit name
6619 -- Context_Items context items and pragmas preceding unit
6620 -- Private_Present set if library unit has private keyword
6621 -- Unit library item or subunit
6622 -- Aux_Decls_Node points to the N_Compilation_Unit_Aux node
6623 -- First_Inlined_Subprogram
6624 -- Library_Unit corresponding/parent spec/body
6625 -- Save_Invocation_Graph_Of_Body
6626 -- Acts_As_Spec flag for subprogram body with no spec
6627 -- Body_Required set for spec if body is required
6628 -- Has_Pragma_Suppress_All
6629 -- Context_Pending
6630 -- Has_No_Elaboration_Code
6632 -- N_Compilation_Unit_Aux
6633 -- Sloc is a copy of the Sloc from the N_Compilation_Unit node
6634 -- Declarations (set to No_List if no global declarations)
6635 -- Actions (set to No_List if no actions)
6636 -- Pragmas_After pragmas after unit (set to No_List if none)
6637 -- Config_Pragmas config pragmas (set to Empty_List if none)
6638 -- Default_Storage_Pool
6640 --------------------------
6641 -- 10.1.1 Library Item --
6642 --------------------------
6644 -- LIBRARY_ITEM ::=
6645 -- [private] LIBRARY_UNIT_DECLARATION
6646 -- | LIBRARY_UNIT_BODY
6647 -- | [private] LIBRARY_UNIT_RENAMING_DECLARATION
6649 -- Note: PRIVATE is not allowed in Ada 83 mode
6651 -- There is no explicit node in the tree for library item, instead
6652 -- the declaration or body, and the flag for private if present,
6653 -- appear in the N_Compilation_Unit node.
6655 --------------------------------------
6656 -- 10.1.1 Library Unit Declaration --
6657 --------------------------------------
6659 -- LIBRARY_UNIT_DECLARATION ::=
6660 -- SUBPROGRAM_DECLARATION | PACKAGE_DECLARATION
6661 -- | GENERIC_DECLARATION | GENERIC_INSTANTIATION
6663 -----------------------------------------------
6664 -- 10.1.1 Library Unit Renaming Declaration --
6665 -----------------------------------------------
6667 -- LIBRARY_UNIT_RENAMING_DECLARATION ::=
6668 -- PACKAGE_RENAMING_DECLARATION
6669 -- | GENERIC_RENAMING_DECLARATION
6670 -- | SUBPROGRAM_RENAMING_DECLARATION
6672 -------------------------------
6673 -- 10.1.1 Library unit body --
6674 -------------------------------
6676 -- LIBRARY_UNIT_BODY ::= SUBPROGRAM_BODY | PACKAGE_BODY
6678 ------------------------------
6679 -- 10.1.1 Parent Unit Name --
6680 ------------------------------
6682 -- PARENT_UNIT_NAME ::= NAME
6684 ----------------------------
6685 -- 10.1.2 Context clause --
6686 ----------------------------
6688 -- CONTEXT_CLAUSE ::= {CONTEXT_ITEM}
6690 -- The context clause can include pragmas, and any pragmas that appear
6691 -- before the context clause proper (i.e. all configuration pragmas,
6692 -- also appear at the front of this list).
6694 --------------------------
6695 -- 10.1.2 Context_Item --
6696 --------------------------
6698 -- CONTEXT_ITEM ::= WITH_CLAUSE | USE_CLAUSE | WITH_TYPE_CLAUSE
6700 -------------------------
6701 -- 10.1.2 With clause --
6702 -------------------------
6704 -- WITH_CLAUSE ::=
6705 -- with library_unit_NAME {,library_unit_NAME};
6707 -- A separate With clause is built for each name, so that we have
6708 -- a Corresponding_Spec field for each with'ed spec. The flags
6709 -- First_Name and Last_Name are used to reconstruct the exact
6710 -- source form. When a list of names appears in one with clause,
6711 -- the first name in the list has First_Name set, and the last
6712 -- has Last_Name set. If the with clause has only one name, then
6713 -- both of the flags First_Name and Last_Name are set in this name.
6715 -- Note: in the case of implicit with's that are installed by the
6716 -- Rtsfind routine, Implicit_With is set, and the Sloc is typically
6717 -- set to Standard_Location, but it is incorrect to test the Sloc
6718 -- to find out if a with clause is implicit, test the flag instead.
6720 -- N_With_Clause
6721 -- Sloc points to first token of library unit name
6722 -- Name
6723 -- Private_Present set if with_clause has private keyword
6724 -- Limited_Present set if LIMITED is present
6725 -- Next_Implicit_With
6726 -- Library_Unit
6727 -- Corresponding_Spec
6728 -- First_Name (set to True if first name or only one name)
6729 -- Last_Name (set to True if last name or only one name)
6730 -- Context_Installed
6731 -- Elaborate_Present
6732 -- Elaborate_All_Present
6733 -- Elaborate_All_Desirable
6734 -- Elaborate_Desirable
6735 -- Implicit_With
6736 -- Limited_View_Installed
6737 -- Parent_With
6738 -- Unreferenced_In_Spec
6739 -- No_Entities_Ref_In_Spec
6741 -- Note: Limited_Present and Limited_View_Installed are used to support
6742 -- the implementation of Ada 2005 (AI-50217).
6744 -- Similarly, Private_Present is used to support the implementation of
6745 -- Ada 2005 (AI-50262).
6747 -- Note: if the WITH clause refers to a standard library unit, then a
6748 -- limited with clause is changed into a normal with clause, because we
6749 -- are not prepared to deal with limited with in the context of Rtsfind.
6750 -- So in this case, the Limited_Present flag will be False in the final
6751 -- tree.
6753 ----------------------
6754 -- With_Type clause --
6755 ----------------------
6757 -- This is a GNAT extension, used to implement mutually recursive
6758 -- types declared in different packages.
6760 -- Note: this is now obsolete. The functionality of this construct
6761 -- is now implemented by the Ada 2005 limited_with_clause.
6763 ---------------------
6764 -- 10.2 Body stub --
6765 ---------------------
6767 -- BODY_STUB ::=
6768 -- SUBPROGRAM_BODY_STUB
6769 -- | PACKAGE_BODY_STUB
6770 -- | TASK_BODY_STUB
6771 -- | PROTECTED_BODY_STUB
6773 ----------------------------------
6774 -- 10.1.3 Subprogram Body Stub --
6775 ----------------------------------
6777 -- SUBPROGRAM_BODY_STUB ::=
6778 -- SUBPROGRAM_SPECIFICATION is separate
6779 -- [ASPECT_SPECIFICATION];
6781 -- N_Subprogram_Body_Stub
6782 -- Sloc points to FUNCTION or PROCEDURE
6783 -- Specification
6784 -- Corresponding_Spec_Of_Stub
6785 -- Library_Unit points to the subunit
6786 -- Corresponding_Body
6787 -- At_End_Proc (set to Empty if no clean up procedure)
6789 -------------------------------
6790 -- 10.1.3 Package Body Stub --
6791 -------------------------------
6793 -- PACKAGE_BODY_STUB ::=
6794 -- package body DEFINING_IDENTIFIER is separate
6795 -- [ASPECT_SPECIFICATION];
6797 -- N_Package_Body_Stub
6798 -- Sloc points to PACKAGE
6799 -- Defining_Identifier
6800 -- Corresponding_Spec_Of_Stub
6801 -- Library_Unit points to the subunit
6802 -- Corresponding_Body
6804 ----------------------------
6805 -- 10.1.3 Task Body Stub --
6806 ----------------------------
6808 -- TASK_BODY_STUB ::=
6809 -- task body DEFINING_IDENTIFIER is separate
6810 -- [ASPECT_SPECIFICATION];
6812 -- N_Task_Body_Stub
6813 -- Sloc points to TASK
6814 -- Defining_Identifier
6815 -- Corresponding_Spec_Of_Stub
6816 -- Library_Unit points to the subunit
6817 -- Corresponding_Body
6818 -- At_End_Proc (set to Empty if no clean up procedure)
6820 ---------------------------------
6821 -- 10.1.3 Protected Body Stub --
6822 ---------------------------------
6824 -- PROTECTED_BODY_STUB ::=
6825 -- protected body DEFINING_IDENTIFIER is separate
6826 -- [ASPECT_SPECIFICATION];
6828 -- Note: protected body stubs are not allowed in Ada 83 mode
6830 -- N_Protected_Body_Stub
6831 -- Sloc points to PROTECTED
6832 -- Defining_Identifier
6833 -- Corresponding_Spec_Of_Stub
6834 -- Library_Unit points to the subunit
6835 -- Corresponding_Body
6837 ---------------------
6838 -- 10.1.3 Subunit --
6839 ---------------------
6841 -- SUBUNIT ::= separate (PARENT_UNIT_NAME) PROPER_BODY
6843 -- N_Subunit
6844 -- Sloc points to SEPARATE
6845 -- Name is the name of the parent unit
6846 -- Proper_Body is the subunit body
6847 -- Corresponding_Stub is the stub declaration for the unit.
6849 ---------------------------------
6850 -- 11.1 Exception Declaration --
6851 ---------------------------------
6853 -- EXCEPTION_DECLARATION ::= DEFINING_IDENTIFIER_LIST : exception
6854 -- [ASPECT_SPECIFICATIONS];
6856 -- For consistency with object declarations etc., the parser converts
6857 -- the case of multiple identifiers being declared to a series of
6858 -- declarations in which the expression is copied, using the More_Ids
6859 -- and Prev_Ids flags to remember the source form as described in the
6860 -- section on "Handling of Defining Identifier Lists".
6862 -- N_Exception_Declaration
6863 -- Sloc points to EXCEPTION
6864 -- Defining_Identifier
6865 -- Expression
6866 -- Renaming_Exception
6867 -- More_Ids (set to False if no more identifiers in list)
6868 -- Prev_Ids (set to False if no previous identifiers in list)
6870 ------------------------------------------
6871 -- 11.2 Handled Sequence Of Statements --
6872 ------------------------------------------
6874 -- HANDLED_SEQUENCE_OF_STATEMENTS ::=
6875 -- SEQUENCE_OF_STATEMENTS
6876 -- [exception
6877 -- EXCEPTION_HANDLER
6878 -- {EXCEPTION_HANDLER}]
6879 -- [at end
6880 -- cleanup_procedure_call (param, param, param, ...);]
6882 -- The AT END phrase is a GNAT extension to provide for cleanups. It is
6883 -- used only internally currently, but is considered to be syntactic.
6884 -- At the moment, the only cleanup action allowed is a single call to a
6885 -- parameterless procedure; this restriction could be lifted if we make
6886 -- some changes in gigi. The At_End_Proc field is an N_Identifier node
6887 -- that denotes the procedure to be called. The cleanup action occurs
6888 -- whenever the sequence of statements is left for any reason. The
6889 -- possible reasons are:
6891 -- 1. reaching the end of the sequence
6892 -- 2. exit, return, or goto
6893 -- 3. exception or abort
6895 -- The cleanup action also occurs whenever the exception handlers are
6896 -- left.
6898 -- The AT END cleanup handler protects only the sequence of statements
6899 -- and the exception handlers (not the associated declarations of
6900 -- the parent), just like exception handlers do not protect the
6901 -- declarations. The big difference is that the cleanup actions occur
6902 -- on either a normal or an abnormal exit from the statement sequence.
6904 -- At_End_Proc is also a field of various nodes that can contain
6905 -- both Declarations and Handled_Statement_Sequence, such as subprogram
6906 -- bodies and block statements. In that case, the At_End_Proc
6907 -- protects the Declarations as well as the Handled_Statement_Sequence.
6909 -- Note: the list of Exception_Handlers can contain pragmas as well
6910 -- as actual handlers. In practice these pragmas can only occur at
6911 -- the start of the list, since any pragmas occurring later on will
6912 -- be included in the statement list of the corresponding handler.
6914 -- Note: although in the Ada syntax, the sequence of statements in
6915 -- a handled sequence of statements can only contain statements, we
6916 -- allow free mixing of declarations and statements in the resulting
6917 -- expanded tree. This is for example used to deal with the case of
6918 -- a cleanup procedure that must handle declarations as well as the
6919 -- statements of a block.
6921 -- Note: the cleanup_procedure_call does not go through the common
6922 -- processing for calls, which in particular means that it will not be
6923 -- automatically inlined in all cases, even though the procedure to be
6924 -- called is marked inline. More specifically, if the procedure comes
6925 -- from another unit than the main source unit, for example a run-time
6926 -- unit, then it needs to be manually added to the list of bodies to be
6927 -- inlined by invoking Add_Inlined_Body on it.
6929 -- N_Handled_Sequence_Of_Statements
6930 -- Sloc points to first token of first statement
6931 -- Statements
6932 -- End_Label (set to Empty if expander generated)
6933 -- Exception_Handlers (set to No_List if none present)
6934 -- At_End_Proc (set to Empty if no clean up procedure)
6936 -- Note: A Handled_Sequence_Of_Statements can contain both
6937 -- Exception_Handlers and an At_End_Proc.
6939 -- Note: the parent always contains a Declarations field which contains
6940 -- declarations associated with the handled sequence of statements. This
6941 -- is true even in the case of an accept statement (see description of
6942 -- the N_Accept_Statement node).
6944 -- End_Label refers to the containing construct
6946 -----------------------------
6947 -- 11.2 Exception Handler --
6948 -----------------------------
6950 -- EXCEPTION_HANDLER ::=
6951 -- when [CHOICE_PARAMETER_SPECIFICATION :]
6952 -- EXCEPTION_CHOICE {| EXCEPTION_CHOICE} =>
6953 -- SEQUENCE_OF_STATEMENTS
6955 -- Note: choice parameter specification is not allowed in Ada 83 mode
6957 -- N_Exception_Handler
6958 -- Sloc points to WHEN
6959 -- Choice_Parameter (set to Empty if not present)
6960 -- Exception_Choices
6961 -- Statements
6962 -- Exception_Label (set to Empty if not present)
6963 -- Local_Raise_Statements (set to No_Elist if not present)
6964 -- Local_Raise_Not_OK
6965 -- Has_Local_Raise
6967 ------------------------------------------
6968 -- 11.2 Choice parameter specification --
6969 ------------------------------------------
6971 -- CHOICE_PARAMETER_SPECIFICATION ::= DEFINING_IDENTIFIER
6973 ----------------------------
6974 -- 11.2 Exception Choice --
6975 ----------------------------
6977 -- EXCEPTION_CHOICE ::= exception_NAME | others
6979 -- Except in the case of OTHERS, no explicit node appears in the tree
6980 -- for exception choice. Instead the exception name appears directly.
6981 -- An OTHERS choice is represented by a N_Others_Choice node (see
6982 -- section 3.8.1.
6984 -- Note: for the exception choice created for an at end handler, the
6985 -- exception choice is an N_Others_Choice node with All_Others set.
6987 ---------------------------
6988 -- 11.3 Raise Statement --
6989 ---------------------------
6991 -- RAISE_STATEMENT ::= raise [exception_NAME];
6993 -- In Ada 2005, we have
6995 -- RAISE_STATEMENT ::=
6996 -- raise; | raise exception_NAME [with string_EXPRESSION];
6998 -- N_Raise_Statement
6999 -- Sloc points to RAISE
7000 -- Name (set to Empty if no exception name present)
7001 -- Expression (set to Empty if no expression present)
7003 ----------------------------
7004 -- 11.3 Raise Expression --
7005 ----------------------------
7007 -- RAISE_EXPRESSION ::= raise exception_NAME [with string_EXPRESSION]
7009 -- N_Raise_Expression
7010 -- Sloc points to RAISE
7011 -- Name (always present)
7012 -- Expression (set to Empty if no expression present)
7013 -- plus fields for expression
7015 -------------------------------
7016 -- 12.1 Generic Declaration --
7017 -------------------------------
7019 -- GENERIC_DECLARATION ::=
7020 -- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
7022 ------------------------------------------
7023 -- 12.1 Generic Subprogram Declaration --
7024 ------------------------------------------
7026 -- GENERIC_SUBPROGRAM_DECLARATION ::=
7027 -- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION
7028 -- [ASPECT_SPECIFICATIONS];
7030 -- Note: Generic_Formal_Declarations can include pragmas
7032 -- N_Generic_Subprogram_Declaration
7033 -- Sloc points to GENERIC
7034 -- Specification subprogram specification
7035 -- Corresponding_Body
7036 -- Generic_Formal_Declarations from generic formal part
7037 -- Parent_Spec
7039 ---------------------------------------
7040 -- 12.1 Generic Package Declaration --
7041 ---------------------------------------
7043 -- GENERIC_PACKAGE_DECLARATION ::=
7044 -- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION
7045 -- [ASPECT_SPECIFICATIONS];
7047 -- Note: when we do generics right, the Activation_Chain_Entity entry
7048 -- for this node can be removed (since the expander won't see generic
7049 -- units any more)???.
7051 -- Note: Generic_Formal_Declarations can include pragmas
7053 -- N_Generic_Package_Declaration
7054 -- Sloc points to GENERIC
7055 -- Specification package specification
7056 -- Corresponding_Body
7057 -- Generic_Formal_Declarations from generic formal part
7058 -- Parent_Spec
7059 -- Activation_Chain_Entity
7061 -------------------------------
7062 -- 12.1 Generic Formal Part --
7063 -------------------------------
7065 -- GENERIC_FORMAL_PART ::=
7066 -- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
7068 ------------------------------------------------
7069 -- 12.1 Generic Formal Parameter Declaration --
7070 ------------------------------------------------
7072 -- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
7073 -- FORMAL_OBJECT_DECLARATION
7074 -- | FORMAL_TYPE_DECLARATION
7075 -- | FORMAL_SUBPROGRAM_DECLARATION
7076 -- | FORMAL_PACKAGE_DECLARATION
7078 ---------------------------------
7079 -- 12.3 Generic Instantiation --
7080 ---------------------------------
7082 -- GENERIC_INSTANTIATION ::=
7083 -- package DEFINING_PROGRAM_UNIT_NAME is
7084 -- new generic_package_NAME [GENERIC_ACTUAL_PART]
7085 -- [ASPECT_SPECIFICATIONS];
7086 -- | [[not] overriding]
7087 -- procedure DEFINING_PROGRAM_UNIT_NAME is
7088 -- new generic_procedure_NAME [GENERIC_ACTUAL_PART]
7089 -- [ASPECT_SPECIFICATIONS];
7090 -- | [[not] overriding]
7091 -- function DEFINING_DESIGNATOR is
7092 -- new generic_function_NAME [GENERIC_ACTUAL_PART]
7093 -- [ASPECT_SPECIFICATIONS];
7095 -- N_Package_Instantiation
7096 -- Sloc points to PACKAGE
7097 -- Defining_Unit_Name
7098 -- Name
7099 -- Generic_Associations (set to No_List if no
7100 -- generic actual part)
7101 -- Parent_Spec
7102 -- Instance_Spec
7103 -- Is_Elaboration_Checks_OK_Node
7104 -- Is_SPARK_Mode_On_Node
7105 -- Is_Elaboration_Warnings_OK_Node
7106 -- Is_Declaration_Level_Node
7107 -- Is_Known_Guaranteed_ABE
7109 -- N_Procedure_Instantiation
7110 -- Sloc points to PROCEDURE
7111 -- Defining_Unit_Name
7112 -- Name
7113 -- Parent_Spec
7114 -- Generic_Associations (set to No_List if no
7115 -- generic actual part)
7116 -- Instance_Spec
7117 -- Is_Elaboration_Checks_OK_Node
7118 -- Is_SPARK_Mode_On_Node
7119 -- Is_Elaboration_Warnings_OK_Node
7120 -- Is_Declaration_Level_Node
7121 -- Must_Override set if overriding indicator present
7122 -- Must_Not_Override set if not_overriding indicator present
7123 -- Is_Known_Guaranteed_ABE
7125 -- N_Function_Instantiation
7126 -- Sloc points to FUNCTION
7127 -- Defining_Unit_Name
7128 -- Name
7129 -- Generic_Associations (set to No_List if no
7130 -- generic actual part)
7131 -- Parent_Spec
7132 -- Instance_Spec
7133 -- Is_Elaboration_Checks_OK_Node
7134 -- Is_SPARK_Mode_On_Node
7135 -- Is_Elaboration_Warnings_OK_Node
7136 -- Is_Declaration_Level_Node
7137 -- Must_Override set if overriding indicator present
7138 -- Must_Not_Override set if not_overriding indicator present
7139 -- Is_Known_Guaranteed_ABE
7141 -- Note: overriding indicator is an Ada 2005 feature
7143 -------------------------------
7144 -- 12.3 Generic Actual Part --
7145 -------------------------------
7147 -- GENERIC_ACTUAL_PART ::=
7148 -- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
7150 -------------------------------
7151 -- 12.3 Generic Association --
7152 -------------------------------
7154 -- GENERIC_ASSOCIATION ::=
7155 -- [generic_formal_parameter_SELECTOR_NAME =>]
7157 -- Note: unlike the procedure call case, a generic association node
7158 -- is generated for every association, even if no formal parameter
7159 -- selector name is present. In this case the parser will leave the
7160 -- Selector_Name field set to Empty, to be filled in later by the
7161 -- semantic pass.
7163 -- In Ada 2005, a formal may be associated with a box, if the
7164 -- association is part of the list of actuals for a formal package.
7165 -- If the association is given by OTHERS => <>, the association is
7166 -- an N_Others_Choice.
7168 -- N_Generic_Association
7169 -- Sloc points to first token of generic association
7170 -- Selector_Name (set to Empty if no formal
7171 -- parameter selector name)
7172 -- Explicit_Generic_Actual_Parameter (Empty if box present)
7173 -- Box_Present (for formal_package associations with a box)
7175 ---------------------------------------------
7176 -- 12.3 Explicit Generic Actual Parameter --
7177 ---------------------------------------------
7179 -- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
7180 -- EXPRESSION | variable_NAME | subprogram_NAME
7181 -- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
7183 -------------------------------------
7184 -- 12.4 Formal Object Declaration --
7185 -------------------------------------
7187 -- FORMAL_OBJECT_DECLARATION ::=
7188 -- DEFINING_IDENTIFIER_LIST :
7189 -- MODE [NULL_EXCLUSION] SUBTYPE_MARK [:= DEFAULT_EXPRESSION]
7190 -- [ASPECT_SPECIFICATIONS];
7191 -- | DEFINING_IDENTIFIER_LIST :
7192 -- MODE ACCESS_DEFINITION [:= DEFAULT_EXPRESSION]
7193 -- [ASPECT_SPECIFICATIONS];
7195 -- Although the syntax allows multiple identifiers in the list, the
7196 -- semantics is as though successive declarations were given with
7197 -- identical type definition and expression components. To simplify
7198 -- semantic processing, the parser represents a multiple declaration
7199 -- case as a sequence of single declarations, using the More_Ids and
7200 -- Prev_Ids flags to preserve the original source form as described
7201 -- in the section on "Handling of Defining Identifier Lists".
7203 -- N_Formal_Object_Declaration
7204 -- Sloc points to first identifier
7205 -- Defining_Identifier
7206 -- In_Present
7207 -- Out_Present
7208 -- Null_Exclusion_Present (set to False if not present)
7209 -- Subtype_Mark (set to Empty if not present)
7210 -- Access_Definition (set to Empty if not present)
7211 -- Default_Expression (set to Empty if no default expression)
7212 -- More_Ids (set to False if no more identifiers in list)
7213 -- Prev_Ids (set to False if no previous identifiers in list)
7215 -----------------------------------
7216 -- 12.5 Formal Type Declaration --
7217 -----------------------------------
7219 -- FORMAL_TYPE_DECLARATION ::=
7220 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
7221 -- is FORMAL_TYPE_DEFINITION
7222 -- [ASPECT_SPECIFICATIONS];
7223 -- | type DEFINING_IDENTIFIER [DISCRIMINANT_PART] [is tagged]
7225 -- N_Formal_Type_Declaration
7226 -- Sloc points to TYPE
7227 -- Defining_Identifier
7228 -- Formal_Type_Definition
7229 -- Discriminant_Specifications (set to No_List if no
7230 -- discriminant part)
7231 -- Unknown_Discriminants_Present set if (<>) discriminant
7232 -- Default_Subtype_Mark
7234 ----------------------------------
7235 -- 12.5 Formal type definition --
7236 ----------------------------------
7238 -- FORMAL_TYPE_DEFINITION ::=
7239 -- FORMAL_PRIVATE_TYPE_DEFINITION
7240 -- | FORMAL_DERIVED_TYPE_DEFINITION
7241 -- | FORMAL_DISCRETE_TYPE_DEFINITION
7242 -- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
7243 -- | FORMAL_MODULAR_TYPE_DEFINITION
7244 -- | FORMAL_FLOATING_POINT_DEFINITION
7245 -- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
7246 -- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
7247 -- | FORMAL_ARRAY_TYPE_DEFINITION
7248 -- | FORMAL_ACCESS_TYPE_DEFINITION
7249 -- | FORMAL_INTERFACE_TYPE_DEFINITION
7250 -- | FORMAL_INCOMPLETE_TYPE_DEFINITION
7252 -- The Ada 2012 syntax introduces two new non-terminals:
7253 -- Formal_{Complete,Incomplete}_Type_Declaration just to introduce
7254 -- the latter category. Here we introduce an incomplete type definition
7255 -- in order to preserve as much as possible the existing structure.
7257 ---------------------------------------------
7258 -- 12.5.1 Formal Private Type Definition --
7259 ---------------------------------------------
7261 -- FORMAL_PRIVATE_TYPE_DEFINITION ::=
7262 -- [[abstract] tagged] [limited] private
7264 -- Note: TAGGED is not allowed in Ada 83 mode
7266 -- N_Formal_Private_Type_Definition
7267 -- Sloc points to PRIVATE
7268 -- Uninitialized_Variable
7269 -- Abstract_Present
7270 -- Tagged_Present
7271 -- Limited_Present
7273 --------------------------------------------
7274 -- 12.5.1 Formal Derived Type Definition --
7275 --------------------------------------------
7277 -- FORMAL_DERIVED_TYPE_DEFINITION ::=
7278 -- [abstract] [limited | synchronized]
7279 -- new SUBTYPE_MARK [[and INTERFACE_LIST] with private]
7280 -- Note: this construct is not allowed in Ada 83 mode
7282 -- N_Formal_Derived_Type_Definition
7283 -- Sloc points to NEW
7284 -- Subtype_Mark
7285 -- Private_Present
7286 -- Abstract_Present
7287 -- Limited_Present
7288 -- Synchronized_Present
7289 -- Interface_List (set to No_List if none)
7291 -----------------------------------------------
7292 -- 12.5.1 Formal Incomplete Type Definition --
7293 -----------------------------------------------
7295 -- FORMAL_INCOMPLETE_TYPE_DEFINITION ::= [tagged]
7297 -- N_Formal_Incomplete_Type_Definition
7298 -- Sloc points to identifier of parent
7299 -- Tagged_Present
7301 ---------------------------------------------
7302 -- 12.5.2 Formal Discrete Type Definition --
7303 ---------------------------------------------
7305 -- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
7307 -- N_Formal_Discrete_Type_Definition
7308 -- Sloc points to (
7310 ---------------------------------------------------
7311 -- 12.5.2 Formal Signed Integer Type Definition --
7312 ---------------------------------------------------
7314 -- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
7316 -- N_Formal_Signed_Integer_Type_Definition
7317 -- Sloc points to RANGE
7319 --------------------------------------------
7320 -- 12.5.2 Formal Modular Type Definition --
7321 --------------------------------------------
7323 -- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
7325 -- N_Formal_Modular_Type_Definition
7326 -- Sloc points to MOD
7328 ----------------------------------------------
7329 -- 12.5.2 Formal Floating Point Definition --
7330 ----------------------------------------------
7332 -- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
7334 -- N_Formal_Floating_Point_Definition
7335 -- Sloc points to DIGITS
7337 ----------------------------------------------------
7338 -- 12.5.2 Formal Ordinary Fixed Point Definition --
7339 ----------------------------------------------------
7341 -- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
7343 -- N_Formal_Ordinary_Fixed_Point_Definition
7344 -- Sloc points to DELTA
7346 ---------------------------------------------------
7347 -- 12.5.2 Formal Decimal Fixed Point Definition --
7348 ---------------------------------------------------
7350 -- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
7352 -- Note: formal decimal fixed point definition not allowed in Ada 83
7354 -- N_Formal_Decimal_Fixed_Point_Definition
7355 -- Sloc points to DELTA
7357 ------------------------------------------
7358 -- 12.5.3 Formal Array Type Definition --
7359 ------------------------------------------
7361 -- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
7363 -------------------------------------------
7364 -- 12.5.4 Formal Access Type Definition --
7365 -------------------------------------------
7367 -- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
7369 ----------------------------------------------
7370 -- 12.5.5 Formal Interface Type Definition --
7371 ----------------------------------------------
7373 -- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
7375 -----------------------------------------
7376 -- 12.6 Formal Subprogram Declaration --
7377 -----------------------------------------
7379 -- FORMAL_SUBPROGRAM_DECLARATION ::=
7380 -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
7381 -- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
7383 --------------------------------------------------
7384 -- 12.6 Formal Concrete Subprogram Declaration --
7385 --------------------------------------------------
7387 -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
7388 -- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT]
7389 -- [ASPECT_SPECIFICATIONS];
7391 -- N_Formal_Concrete_Subprogram_Declaration
7392 -- Sloc points to WITH
7393 -- Specification
7394 -- Default_Name (set to Empty if no subprogram default)
7395 -- Box_Present
7396 -- Expression (set to Empty if no expression present)
7398 -- Note: If no subprogram default is present, then Name is set
7399 -- to Empty, and Box_Present is False.
7401 -- Note: The Expression field is only used for the GNAT extension
7402 -- that allows a FORMAL_CONCRETE_SUBPROGRAM_DECLARATION to specify
7403 -- an expression default for generic formal functions.
7405 --------------------------------------------------
7406 -- 12.6 Formal Abstract Subprogram Declaration --
7407 --------------------------------------------------
7409 -- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
7410 -- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT]
7411 -- [ASPECT_SPECIFICATIONS];
7413 -- N_Formal_Abstract_Subprogram_Declaration
7414 -- Sloc points to WITH
7415 -- Specification
7416 -- Default_Name (set to Empty if no subprogram default)
7417 -- Box_Present
7419 -- Note: if no subprogram default is present, then Name is set
7420 -- to Empty, and Box_Present is False.
7422 ------------------------------
7423 -- 12.6 Subprogram Default --
7424 ------------------------------
7426 -- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <> | (EXPRESSION)
7428 -- There is no separate node in the tree for a subprogram default.
7429 -- Instead the parent (N_Formal_Concrete_Subprogram_Declaration
7430 -- or N_Formal_Abstract_Subprogram_Declaration) node contains the
7431 -- default name or box indication, as needed.
7433 -- Note: The syntax "(EXPRESSION)" is a GNAT extension, and allows
7434 -- a FORMAL_CONCRETE_SUBPROGRAM_DECLARATION to specify an expression
7435 -- default for formal functions, in analogy with expression_functions.
7437 ------------------------
7438 -- 12.6 Default Name --
7439 ------------------------
7441 -- DEFAULT_NAME ::= NAME
7443 --------------------------------------
7444 -- 12.7 Formal Package Declaration --
7445 --------------------------------------
7447 -- FORMAL_PACKAGE_DECLARATION ::=
7448 -- with package DEFINING_IDENTIFIER
7449 -- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART
7450 -- [ASPECT_SPECIFICATIONS];
7452 -- Note: formal package declarations not allowed in Ada 83 mode
7454 -- N_Formal_Package_Declaration
7455 -- Sloc points to WITH
7456 -- Defining_Identifier
7457 -- Name
7458 -- Generic_Associations (set to No_List if (<>) case or
7459 -- empty generic actual part)
7460 -- Box_Present
7461 -- Instance_Spec
7462 -- Is_Known_Guaranteed_ABE
7464 --------------------------------------
7465 -- 12.7 Formal Package Actual Part --
7466 --------------------------------------
7468 -- FORMAL_PACKAGE_ACTUAL_PART ::=
7469 -- ([OTHERS] => <>)
7470 -- | [GENERIC_ACTUAL_PART]
7471 -- (FORMAL_PACKAGE_ASSOCIATION {. FORMAL_PACKAGE_ASSOCIATION}
7473 -- FORMAL_PACKAGE_ASSOCIATION ::=
7474 -- GENERIC_ASSOCIATION
7475 -- | GENERIC_FORMAL_PARAMETER_SELECTOR_NAME => <>
7477 -- There is no explicit node in the tree for a formal package actual
7478 -- part. Instead the information appears in the parent node (i.e. the
7479 -- formal package declaration node itself).
7481 -- There is no explicit node for a formal package association. All of
7482 -- them are represented either by a generic association, possibly with
7483 -- Box_Present, or by an N_Others_Choice.
7485 ---------------------------------
7486 -- 13.1 Representation clause --
7487 ---------------------------------
7489 -- REPRESENTATION_CLAUSE ::=
7490 -- ATTRIBUTE_DEFINITION_CLAUSE
7491 -- | ENUMERATION_REPRESENTATION_CLAUSE
7492 -- | RECORD_REPRESENTATION_CLAUSE
7493 -- | AT_CLAUSE
7495 ----------------------
7496 -- 13.1 Local Name --
7497 ----------------------
7499 -- LOCAL_NAME :=
7500 -- DIRECT_NAME
7501 -- | DIRECT_NAME'ATTRIBUTE_DESIGNATOR
7502 -- | library_unit_NAME
7504 -- The construct DIRECT_NAME'ATTRIBUTE_DESIGNATOR appears in the tree
7505 -- as an attribute reference, which has essentially the same form.
7507 ---------------------------------------
7508 -- 13.3 Attribute definition clause --
7509 ---------------------------------------
7511 -- ATTRIBUTE_DEFINITION_CLAUSE ::=
7512 -- for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use EXPRESSION;
7513 -- | for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use NAME;
7515 -- In Ada 83, the expression must be a simple expression and the
7516 -- local name must be a direct name.
7518 -- Note: the only attribute definition clause that is processed by
7519 -- gigi is an address clause. For all other cases, the information
7520 -- is extracted by the front end and either results in setting entity
7521 -- information, e.g. Esize for the Size clause, or in appropriate
7522 -- expansion actions (e.g. in the case of Storage_Size).
7524 -- For an address clause, Gigi constructs the appropriate addressing
7525 -- code. It also ensures that no aliasing optimizations are made
7526 -- for the object for which the address clause appears.
7528 -- Note: for an address clause used to achieve an overlay:
7530 -- A : Integer;
7531 -- B : Integer;
7532 -- for B'Address use A'Address;
7534 -- the above rule means that Gigi will ensure that no optimizations
7535 -- will be made for B that would violate the implementation advice
7536 -- of RM 13.3(19). However, this advice applies only to B and not
7537 -- to A, which seems unfortunate. The GNAT front end will mark the
7538 -- object A as volatile to also prevent unwanted optimization
7539 -- assumptions based on no aliasing being made for B.
7541 -- N_Attribute_Definition_Clause
7542 -- Sloc points to FOR
7543 -- Name the local name
7544 -- Chars the identifier name from the attribute designator
7545 -- Expression the expression or name
7546 -- Entity
7547 -- Next_Rep_Item
7548 -- From_At_Mod
7549 -- Check_Address_Alignment
7550 -- From_Aspect_Specification
7551 -- Is_Delayed_Aspect
7552 -- Address_Warning_Posted
7554 -- Note: if From_Aspect_Specification is set, then Sloc points to the
7555 -- aspect name, and Entity is resolved already to reference the entity
7556 -- to which the aspect applies.
7558 -----------------------------------
7559 -- 13.3.1 Aspect Specifications --
7560 -----------------------------------
7562 -- We modify the RM grammar here, the RM grammar is:
7564 -- ASPECT_SPECIFICATION ::=
7565 -- with ASPECT_MARK [=> ASPECT_DEFINITION] {,
7566 -- ASPECT_MARK [=> ASPECT_DEFINITION] }
7568 -- ASPECT_MARK ::= aspect_IDENTIFIER['Class]
7570 -- ASPECT_DEFINITION ::= NAME | EXPRESSION
7572 -- That's inconvenient, since there is no non-terminal name for a single
7573 -- entry in the list of aspects. So we use this grammar instead:
7575 -- ASPECT_SPECIFICATIONS ::=
7576 -- with ASPECT_SPECIFICATION {, ASPECT_SPECIFICATION}
7578 -- ASPECT_SPECIFICATION =>
7579 -- ASPECT_MARK [=> ASPECT_DEFINITION]
7581 -- ASPECT_MARK ::= aspect_IDENTIFIER['Class]
7583 -- ASPECT_DEFINITION ::= NAME | EXPRESSION
7585 -- Note that for Annotate, the ASPECT_DEFINITION is a pure positional
7586 -- aggregate with the elements of the aggregate corresponding to the
7587 -- successive arguments of the corresponding pragma.
7589 -- See separate package Aspects for details on the incorporation of
7590 -- these nodes into the tree, and how aspect specifications for a given
7591 -- declaration node are associated with that node.
7593 -- N_Aspect_Specification
7594 -- Sloc points to aspect identifier
7595 -- Identifier aspect identifier
7596 -- Aspect_Rep_Item
7597 -- Expression (set to Empty if none)
7598 -- Entity entity to which the aspect applies
7599 -- Next_Rep_Item
7600 -- Class_Present Set if 'Class present
7601 -- Is_Ignored
7602 -- Is_Checked
7603 -- Is_Delayed_Aspect
7604 -- Is_Disabled
7605 -- Is_Boolean_Aspect
7606 -- Split_PPC Set if split pre/post attribute
7607 -- Aspect_On_Partial_View
7609 -- Note: Aspect_Specification is an Ada 2012 feature
7611 -- Note: The Identifier serves to identify the aspect involved (it
7612 -- is the aspect whose name corresponds to the Chars field). This
7613 -- means that the other fields of this identifier are unused, and
7614 -- in particular we use the Entity field of this identifier to save
7615 -- a copy of the expression for visibility analysis, see spec of
7616 -- Sem_Ch13 for full details of this usage.
7618 -- In the case of aspects of the form xxx'Class, the aspect identifier
7619 -- is for xxx, and Class_Present is set to True.
7621 -- Note: When a Pre or Post aspect specification is processed, it is
7622 -- broken into AND THEN sections. The left most section has Split_PPC
7623 -- set to False, indicating that it is the original specification (e.g.
7624 -- for posting errors). For the other sections, Split_PPC is set True.
7626 ---------------------------------------------
7627 -- 13.4 Enumeration representation clause --
7628 ---------------------------------------------
7630 -- ENUMERATION_REPRESENTATION_CLAUSE ::=
7631 -- for first_subtype_LOCAL_NAME use ENUMERATION_AGGREGATE;
7633 -- In Ada 83, the name must be a direct name
7635 -- N_Enumeration_Representation_Clause
7636 -- Sloc points to FOR
7637 -- Identifier direct name
7638 -- Array_Aggregate
7639 -- Next_Rep_Item
7641 ---------------------------------
7642 -- 13.4 Enumeration aggregate --
7643 ---------------------------------
7645 -- ENUMERATION_AGGREGATE ::= ARRAY_AGGREGATE
7647 ------------------------------------------
7648 -- 13.5.1 Record representation clause --
7649 ------------------------------------------
7651 -- RECORD_REPRESENTATION_CLAUSE ::=
7652 -- for first_subtype_LOCAL_NAME use
7653 -- record [MOD_CLAUSE]
7654 -- {COMPONENT_CLAUSE}
7655 -- end record;
7657 -- Gigi restriction: Mod_Clause is always Empty (if present it is
7658 -- replaced by a corresponding Alignment attribute definition clause).
7660 -- Note: Component_Clauses can include pragmas
7662 -- N_Record_Representation_Clause
7663 -- Sloc points to FOR
7664 -- Identifier direct name
7665 -- Mod_Clause (set to Empty if no mod clause present)
7666 -- Component_Clauses
7667 -- Next_Rep_Item
7669 ------------------------------
7670 -- 13.5.1 Component clause --
7671 ------------------------------
7673 -- COMPONENT_CLAUSE ::=
7674 -- component_LOCAL_NAME at POSITION
7675 -- range FIRST_BIT .. LAST_BIT;
7677 -- N_Component_Clause
7678 -- Sloc points to AT
7679 -- Component_Name points to Name or Attribute_Reference
7680 -- Position
7681 -- First_Bit
7682 -- Last_Bit
7684 ----------------------
7685 -- 13.5.1 Position --
7686 ----------------------
7688 -- POSITION ::= static_EXPRESSION
7690 -----------------------
7691 -- 13.5.1 First_Bit --
7692 -----------------------
7694 -- FIRST_BIT ::= static_SIMPLE_EXPRESSION
7696 ----------------------
7697 -- 13.5.1 Last_Bit --
7698 ----------------------
7700 -- LAST_BIT ::= static_SIMPLE_EXPRESSION
7702 --------------------------
7703 -- 13.8 Code statement --
7704 --------------------------
7706 -- CODE_STATEMENT ::= QUALIFIED_EXPRESSION;
7708 -- Note: in GNAT, the qualified expression has the form
7710 -- Asm_Insn'(Asm (...));
7712 -- See package System.Machine_Code in file s-maccod.ads for details on
7713 -- the allowed parameters to Asm. There are two ways this node can
7714 -- arise, as a code statement, in which case the expression is the
7715 -- qualified expression, or as a result of the expansion of an intrinsic
7716 -- call to the Asm or Asm_Input procedure.
7718 -- N_Code_Statement
7719 -- Sloc points to first token of the expression
7720 -- Expression
7722 -- Note: package Exp_Code contains an abstract functional interface
7723 -- for use by Gigi in accessing the data from N_Code_Statement nodes.
7725 ------------------------
7726 -- 13.12 Restriction --
7727 ------------------------
7729 -- RESTRICTION ::=
7730 -- restriction_IDENTIFIER
7731 -- | restriction_parameter_IDENTIFIER => EXPRESSION
7733 -- There is no explicit node for restrictions. Instead the restriction
7734 -- appears in normal pragma syntax as a pragma argument association,
7735 -- which has the same syntactic form.
7737 --------------------------
7738 -- B.2 Shift Operators --
7739 --------------------------
7741 -- Calls to the intrinsic shift functions are converted to one of
7742 -- the following shift nodes, which have the form of normal binary
7743 -- operator names. Note that for a given shift operation, one node
7744 -- covers all possible types, as for normal operators.
7746 -- Note: it is perfectly permissible for the expander to generate
7747 -- shift operation nodes directly, in which case they will be analyzed
7748 -- and parsed in the usual manner.
7750 -- Sprint syntax: shift-function-name!(expr, count)
7752 -- Note: the Left_Opnd field holds the first argument (the value to
7753 -- be shifted). The Right_Opnd field holds the second argument (the
7754 -- shift count). The Chars field is the name of the intrinsic function.
7756 -- N_Op_Rotate_Left
7757 -- Sloc points to the function name
7758 -- plus fields for binary operator
7759 -- plus fields for expression
7760 -- Shift_Count_OK
7762 -- N_Op_Rotate_Right
7763 -- Sloc points to the function name
7764 -- plus fields for binary operator
7765 -- plus fields for expression
7766 -- Shift_Count_OK
7768 -- N_Op_Shift_Left
7769 -- Sloc points to the function name
7770 -- plus fields for binary operator
7771 -- plus fields for expression
7772 -- Shift_Count_OK
7774 -- N_Op_Shift_Right_Arithmetic
7775 -- Sloc points to the function name
7776 -- plus fields for binary operator
7777 -- plus fields for expression
7778 -- Shift_Count_OK
7780 -- N_Op_Shift_Right
7781 -- Sloc points to the function name
7782 -- plus fields for binary operator
7783 -- plus fields for expression
7784 -- Shift_Count_OK
7786 -- Note: N_Op_Rotate_Left, N_Op_Rotate_Right, N_Shift_Right_Arithmetic
7787 -- never appear in the expanded tree if Modify_Tree_For_C mode is set.
7789 -- Note: For N_Op_Shift_Left and N_Op_Shift_Right, the right operand is
7790 -- always less than the word size if Modify_Tree_For_C mode is set.
7792 --------------------------
7793 -- Obsolescent Features --
7794 --------------------------
7796 -- The syntax descriptions and tree nodes for obsolescent features are
7797 -- grouped together, corresponding to their location in appendix I in
7798 -- the RM. However, parsing and semantic analysis for these constructs
7799 -- is located in an appropriate chapter (see individual notes).
7801 ---------------------------
7802 -- J.3 Delta Constraint --
7803 ---------------------------
7805 -- Note: the parse routine for this construct is located in section
7806 -- 3.5.9 of Par-Ch3, and semantic analysis is in Sem_Ch3, which is
7807 -- where delta constraint logically belongs.
7809 -- DELTA_CONSTRAINT ::= DELTA static_EXPRESSION [RANGE_CONSTRAINT]
7811 -- N_Delta_Constraint
7812 -- Sloc points to DELTA
7813 -- Delta_Expression
7814 -- Range_Constraint (set to Empty if not present)
7816 --------------------
7817 -- J.7 At Clause --
7818 --------------------
7820 -- AT_CLAUSE ::= for DIRECT_NAME use at EXPRESSION;
7822 -- Note: the parse routine for this construct is located in Par-Ch13,
7823 -- and the semantic analysis is in Sem_Ch13, where at clause logically
7824 -- belongs if it were not obsolescent.
7826 -- Note: in Ada 83 the expression must be a simple expression
7828 -- Gigi restriction: This node never appears, it is rewritten as an
7829 -- address attribute definition clause.
7831 -- N_At_Clause
7832 -- Sloc points to FOR
7833 -- Identifier
7834 -- Expression
7836 ---------------------
7837 -- J.8 Mod clause --
7838 ---------------------
7840 -- MOD_CLAUSE ::= at mod static_EXPRESSION;
7842 -- Note: the parse routine for this construct is located in Par-Ch13,
7843 -- and the semantic analysis is in Sem_Ch13, where mod clause logically
7844 -- belongs if it were not obsolescent.
7846 -- Note: in Ada 83, the expression must be a simple expression
7848 -- Gigi restriction: this node never appears. It is replaced
7849 -- by a corresponding Alignment attribute definition clause.
7851 -- Note: pragmas can appear before and after the MOD_CLAUSE since
7852 -- its name has "clause" in it. This is rather strange, but is quite
7853 -- definitely specified. The pragmas before are collected in the
7854 -- Pragmas_Before field of the mod clause node itself, and pragmas
7855 -- after are simply swallowed up in the list of component clauses.
7857 -- N_Mod_Clause
7858 -- Sloc points to AT
7859 -- Expression
7860 -- Pragmas_Before Pragmas before mod clause (No_List if none)
7862 --------------------
7863 -- Semantic Nodes --
7864 --------------------
7866 -- These semantic nodes are used to hold additional semantic information.
7867 -- They are inserted into the tree as a result of semantic processing.
7868 -- Although there are no legitimate source syntax constructions that
7869 -- correspond directly to these nodes, we need a source syntax for the
7870 -- reconstructed tree printed by Sprint, and the node descriptions here
7871 -- show this syntax.
7873 -----------------
7874 -- Call_Marker --
7875 -----------------
7877 -- This node is created during the analysis/resolution of entry calls,
7878 -- requeues, and subprogram calls. It performs several functions:
7880 -- * Call markers provide a uniform model for handling calls by the
7881 -- ABE mechanism, regardless of whether expansion took place.
7883 -- * The call marker captures the target of the related call along
7884 -- with other attributes which are either unavailable or expensive
7885 -- to recompute once analysis, resolution, and expansion are over.
7887 -- * The call marker aids the ABE Processing phase by signaling the
7888 -- presence of a call in case the original call was transformed by
7889 -- expansion.
7891 -- * The call marker acts as a reference point for the insertion of
7892 -- run-time conditional ABE checks or guaranteed ABE failures.
7894 -- Sprint syntax: #target#
7896 -- The Sprint syntax shown above is not enabled by default
7898 -- N_Call_Marker
7899 -- Sloc points to Sloc of original call
7900 -- Target
7901 -- Is_Elaboration_Checks_OK_Node
7902 -- Is_SPARK_Mode_On_Node
7903 -- Is_Elaboration_Warnings_OK_Node
7904 -- Is_Source_Call
7905 -- Is_Declaration_Level_Node
7906 -- Is_Dispatching_Call
7907 -- Is_Preelaborable_Call
7908 -- Is_Known_Guaranteed_ABE
7910 ------------------------
7911 -- Compound Statement --
7912 ------------------------
7914 -- This node is created by the analyzer/expander to handle some
7915 -- expansion cases where a sequence of actions needs to be captured
7916 -- within a single node (which acts as a container and allows the
7917 -- entire list of actions to be moved around as a whole) appearing
7918 -- in a sequence of statements.
7920 -- This is the statement counterpart to the expression node
7921 -- N_Expression_With_Actions.
7923 -- The required semantics is that the set of actions is executed in
7924 -- the order in which it appears, as though they appeared by themselves
7925 -- in the enclosing list of declarations or statements. Unlike what
7926 -- happens when using an N_Block_Statement, no new scope is introduced.
7928 -- Note: for the time being, this is used only as a transient
7929 -- representation during expansion, and all compound statement nodes
7930 -- must be exploded back to their constituent statements before handing
7931 -- the tree to the back end.
7933 -- Sprint syntax: do
7934 -- action;
7935 -- action;
7936 -- ...
7937 -- action;
7938 -- end;
7940 -- N_Compound_Statement
7941 -- Actions
7943 --------------
7944 -- Contract --
7945 --------------
7947 -- This node is used to hold the various parts of an entry, subprogram
7948 -- [body] or package [body] contract, in particular:
7949 -- Abstract states declared by a package declaration
7950 -- Contract cases that apply to a subprogram
7951 -- Dependency relations of inputs and output of a subprogram
7952 -- Global annotations classifying data as input or output
7953 -- Initialization sequences for a package declaration
7954 -- Pre- and postconditions that apply to a subprogram
7956 -- The node appears in an entry and [generic] subprogram [body] entity.
7958 -- Sprint syntax: <none> as the node should not appear in the tree, but
7959 -- only attached to an entry or [generic] subprogram
7960 -- entity.
7962 -- N_Contract
7963 -- Sloc points to the subprogram's name
7964 -- Pre_Post_Conditions (set to Empty if none)
7965 -- Contract_Test_Cases (set to Empty if none)
7966 -- Classifications (set to Empty if none)
7967 -- Is_Expanded_Contract
7969 -- Pre_Post_Conditions contains a collection of pragmas that correspond
7970 -- to pre- and postconditions associated with an entry or a subprogram
7971 -- [body or stub]. The pragmas can either come from source or be the
7972 -- byproduct of aspect expansion. Currently the following pragmas appear
7973 -- in this list:
7974 -- Post
7975 -- Postcondition
7976 -- Pre
7977 -- Precondition
7978 -- Refined_Post
7979 -- The ordering in the list is in LIFO fashion.
7981 -- Note that there might be multiple preconditions or postconditions
7982 -- in this list, either because they come from separate pragmas in the
7983 -- source, or because a Pre (resp. Post) aspect specification has been
7984 -- broken into AND THEN sections. See Split_PPC for details.
7986 -- In GNATprove mode, the inherited classwide pre- and postconditions
7987 -- (suitably specialized for the specific type of the overriding
7988 -- operation) are also in this list.
7990 -- Contract_Test_Cases contains a collection of pragmas that correspond
7991 -- to aspects/pragmas Contract_Cases, Exceptional_Cases, Test_Case and
7992 -- Subprogram_Variant. The ordering in the list is in LIFO fashion.
7994 -- Classifications contains pragmas that either declare, categorize, or
7995 -- establish dependencies between subprogram or package inputs and
7996 -- outputs. Currently the following pragmas appear in this list:
7997 -- Abstract_States
7998 -- Always_Terminates
7999 -- Async_Readers
8000 -- Async_Writers
8001 -- Constant_After_Elaboration
8002 -- Depends
8003 -- Effective_Reads
8004 -- Effective_Writes
8005 -- Extensions_Visible
8006 -- Global
8007 -- Initial_Condition
8008 -- Initializes
8009 -- Part_Of
8010 -- Refined_Depends
8011 -- Refined_Global
8012 -- Refined_States
8013 -- Volatile_Function
8014 -- The ordering is in LIFO fashion.
8016 -------------------
8017 -- Expanded Name --
8018 -------------------
8020 -- The N_Expanded_Name node is used to represent a selected component
8021 -- name that has been resolved to an expanded name. The semantic phase
8022 -- replaces N_Selected_Component nodes that represent names by the use
8023 -- of this node, leaving the N_Selected_Component node used only when
8024 -- the prefix is a record or protected type.
8026 -- The fields of the N_Expanded_Name node are laid out identically
8027 -- to those of the N_Selected_Component node, allowing conversion of
8028 -- an expanded name node to a selected component node to be done
8029 -- easily, see Sinfo.CN.Change_Selected_Component_To_Expanded_Name.
8031 -- There is no special sprint syntax for an expanded name
8033 -- N_Expanded_Name
8034 -- Sloc points to the period
8035 -- Chars copy of Chars field of selector name
8036 -- Prefix
8037 -- Selector_Name
8038 -- Entity
8039 -- Associated_Node
8040 -- Is_Elaboration_Checks_OK_Node
8041 -- Is_SPARK_Mode_On_Node
8042 -- Is_Elaboration_Warnings_OK_Node
8043 -- Has_Private_View (set in generic units)
8044 -- Has_Secondary_Private_View (set in generic units)
8045 -- Redundant_Use
8046 -- Atomic_Sync_Required
8047 -- plus fields for expression
8049 -----------------------------
8050 -- Expression With Actions --
8051 -----------------------------
8053 -- This node is created by the analyzer/expander to handle some
8054 -- expansion cases, notably short-circuit forms where there are
8055 -- actions associated with the right-hand side operand.
8057 -- The N_Expression_With_Actions node represents an expression with
8058 -- an associated set of actions (which are executable statements and
8059 -- declarations, as might occur in a handled statement sequence).
8061 -- The required semantics is that the set of actions is executed in
8062 -- the order in which it appears just before the expression is
8063 -- evaluated (and these actions must only be executed if the value
8064 -- of the expression is evaluated). The node is considered to be
8065 -- a subexpression, whose value is the value of the Expression after
8066 -- executing all the actions.
8068 -- If the actions contain declarations, then these declarations may
8069 -- be referenced within the expression.
8071 -- (AI12-0236-1): In Ada 2022, for a declare_expression, the parser
8072 -- generates an N_Expression_With_Actions. Declare_expressions have
8073 -- various restrictions, which we do not enforce on
8074 -- N_Expression_With_Actions nodes that are generated by the
8075 -- expander. The two cases can be distinguished by looking at
8076 -- Comes_From_Source.
8078 -- ???Perhaps we should change the name of this node to
8079 -- N_Declare_Expression, and perhaps we should change the Sprint syntax
8080 -- to match the RM syntax for declare_expression.
8082 -- Sprint syntax: do
8083 -- action;
8084 -- action;
8085 -- ...
8086 -- action;
8087 -- in expression end
8089 -- N_Expression_With_Actions
8090 -- Actions
8091 -- Expression
8092 -- plus fields for expression
8094 -- Note: In the final generated tree presented to the code generator,
8095 -- the actions list is always non-null, since there is no point in this
8096 -- node if the actions are Empty. During semantic analysis there are
8097 -- cases where it is convenient to temporarily generate an empty actions
8098 -- list. This arises in cases where we create such an empty actions
8099 -- list, and it may or may not end up being a place where additional
8100 -- actions are inserted. The expander removes such empty cases after
8101 -- the expression of the node is fully analyzed and expanded, at which
8102 -- point it is safe to remove it, since no more actions can be inserted.
8104 -- Note: In Modify_Tree_For_C, we never generate any declarations in
8105 -- the action list, which can contain only non-declarative statements.
8107 --------------------
8108 -- Free Statement --
8109 --------------------
8111 -- The N_Free_Statement node is generated as a result of a call to an
8112 -- instantiation of Unchecked_Deallocation. The instantiation of this
8113 -- generic is handled specially and generates this node directly.
8115 -- Sprint syntax: free expression
8117 -- N_Free_Statement
8118 -- Sloc is copied from the unchecked deallocation call
8119 -- Expression argument to unchecked deallocation call
8120 -- Storage_Pool
8121 -- Procedure_To_Call
8122 -- Actual_Designated_Subtype
8124 -- Note: in the case where a debug source file is generated, the Sloc
8125 -- for this node points to the FREE keyword in the Sprint file output.
8127 -------------------
8128 -- Freeze Entity --
8129 -------------------
8131 -- This node marks the point in a declarative part at which an entity
8132 -- declared therein becomes frozen. The expander places initialization
8133 -- procedures for types at those points. Gigi uses the freezing point
8134 -- to elaborate entities that may depend on previous private types.
8136 -- See the section in Einfo "Delayed Freezing and Elaboration" for
8137 -- a full description of the use of this node.
8139 -- The Entity field points back to the entity for the type (whose
8140 -- Freeze_Node field points back to this freeze node).
8142 -- The Actions field contains a list of declarations and statements
8143 -- generated by the expander which are associated with the freeze
8144 -- node, and are elaborated as though the freeze node were replaced
8145 -- by this sequence of actions.
8147 -- Note: the Sloc field in the freeze node references a construct
8148 -- associated with the freezing point. This is used for posting
8149 -- messages in some error/warning situations, e.g. the case where
8150 -- a primitive operation of a tagged type is declared too late.
8152 -- Sprint syntax: freeze entity-name [
8153 -- freeze actions
8154 -- ]
8156 -- N_Freeze_Entity
8157 -- Sloc points near freeze point (see above special note)
8158 -- Entity
8159 -- Access_Types_To_Process (set to No_Elist if none)
8160 -- TSS_Elist (set to No_Elist if no associated TSS's)
8161 -- Actions (set to No_List if no freeze actions)
8162 -- First_Subtype_Link (set to Empty if no link)
8164 -- The Actions field holds actions associated with the freeze. These
8165 -- actions are elaborated at the point where the type is frozen.
8167 -- Note: in the case where a debug source file is generated, the Sloc
8168 -- for this node points to the FREEZE keyword in the Sprint file output.
8170 ---------------------------
8171 -- Freeze Generic Entity --
8172 ---------------------------
8174 -- The freeze point of an entity indicates the point at which the
8175 -- information needed to generate code for the entity is complete.
8176 -- The freeze node for an entity triggers expander activities, such as
8177 -- build initialization procedures, and backend activities, such as
8178 -- completing the elaboration of packages.
8180 -- For entities declared within a generic unit, for which no code is
8181 -- generated, the freeze point is not equally meaningful. However, in
8182 -- Ada 2012 several semantic checks on declarations must be delayed to
8183 -- the freeze point, and we need to include such a mark in the tree to
8184 -- trigger these checks. The Freeze_Generic_Entity node plays no other
8185 -- role, and is ignored by the expander and the back-end.
8187 -- Sprint syntax: freeze_generic entity-name
8189 -- N_Freeze_Generic_Entity
8190 -- Sloc points near freeze point
8191 -- Entity
8193 --------------------------------
8194 -- Implicit Label Declaration --
8195 --------------------------------
8197 -- An implicit label declaration is created for every occurrence of a
8198 -- label on a statement or a label on a block or loop. It is chained
8199 -- in the declarations of the innermost enclosing block as specified
8200 -- in RM section 5.1 (3).
8202 -- The Defining_Identifier is the actual identifier for the statement
8203 -- identifier. Note that the occurrence of the label is a reference, NOT
8204 -- the defining occurrence. The defining occurrence occurs at the head
8205 -- of the innermost enclosing block, and is represented by this node.
8207 -- Note: from the grammar, this might better be called an implicit
8208 -- statement identifier declaration, but the term we choose seems
8209 -- friendlier, since at least informally statement identifiers are
8210 -- called labels in both cases (i.e. when used in labels, and when
8211 -- used as the identifiers of blocks and loops).
8213 -- Note: although this is logically a semantic node, since it does not
8214 -- correspond directly to a source syntax construction, these nodes are
8215 -- actually created by the parser in a post pass done just after parsing
8216 -- is complete, before semantic analysis is started (see Par.Labl).
8218 -- Sprint syntax: labelname : label;
8220 -- N_Implicit_Label_Declaration
8221 -- Sloc points to the << token for a statement identifier, or to the
8222 -- LOOP, DECLARE, or BEGIN token for a loop or block identifier
8223 -- Defining_Identifier
8224 -- Label_Construct
8226 -- Note: in the case where a debug source file is generated, the Sloc
8227 -- for this node points to the label name in the generated declaration.
8229 ---------------------
8230 -- Itype Reference --
8231 ---------------------
8233 -- This node is used to create a reference to an Itype. The only purpose
8234 -- is to make sure the Itype is defined if this is the first reference.
8236 -- A typical use of this node is when an Itype is to be referenced in
8237 -- two branches of an IF statement. In this case it is important that
8238 -- the first use of the Itype not be inside the conditional, since then
8239 -- it might not be defined if the other branch of the IF is taken, in
8240 -- the case where the definition generates elaboration code.
8242 -- The Itype field points to the referenced Itype
8244 -- Sprint syntax: reference itype-name
8246 -- N_Itype_Reference
8247 -- Sloc points to the node generating the reference
8248 -- Itype
8250 -- Note: in the case where a debug source file is generated, the Sloc
8251 -- for this node points to the REFERENCE keyword in the file output.
8253 ---------------------
8254 -- Raise xxx Error --
8255 ---------------------
8257 -- One of these nodes is created during semantic analysis to replace
8258 -- a node for an expression that is determined to definitely raise
8259 -- the corresponding exception.
8261 -- The N_Raise_xxx_Error node may also stand alone in place
8262 -- of a declaration or statement, in which case it simply causes
8263 -- the exception to be raised (i.e. it is equivalent to a raise
8264 -- statement that raises the corresponding exception). This use
8265 -- is distinguished by the fact that the Etype in this case is
8266 -- Standard_Void_Type; in the subexpression case, the Etype is the
8267 -- same as the type of the subexpression which it replaces.
8269 -- If Condition is empty, then the raise is unconditional. If the
8270 -- Condition field is non-empty, it is a boolean expression which is
8271 -- first evaluated, and the exception is raised only if the value of the
8272 -- expression is True. In the unconditional case, the creation of this
8273 -- node is usually accompanied by a warning message (unless it appears
8274 -- within the right operand of a short-circuit form whose left argument
8275 -- is static and decisively eliminates elaboration of the raise
8276 -- operation). The condition field can ONLY be present when the node is
8277 -- used as a statement form; it must NOT be present in the case where
8278 -- the node appears within an expression.
8280 -- The exception is generated with a message that contains the
8281 -- file name and line number, and then appended text. The Reason
8282 -- code shows the text to be added. The Reason code is an element
8283 -- of the type Types.RT_Exception_Code, and indicates both the
8284 -- message to be added, and the exception to be raised (which must
8285 -- match the node type). The value is stored by storing a Uint which
8286 -- is the Pos value of the enumeration element in this type.
8288 -- Gigi restriction: This expander ensures that the type of the
8289 -- Condition field is always Standard.Boolean, even if the type
8290 -- in the source is some non-standard boolean type.
8292 -- Sprint syntax: [xxx_error "msg"]
8293 -- or: [xxx_error when condition "msg"]
8295 -- N_Raise_Constraint_Error
8296 -- Sloc references related construct
8297 -- Condition (set to Empty if no condition)
8298 -- Reason
8299 -- plus fields for expression
8301 -- N_Raise_Program_Error
8302 -- Sloc references related construct
8303 -- Condition (set to Empty if no condition)
8304 -- Reason
8305 -- plus fields for expression
8307 -- N_Raise_Storage_Error
8308 -- Sloc references related construct
8309 -- Condition (set to Empty if no condition)
8310 -- Reason
8311 -- plus fields for expression
8313 -- Note: Sloc is copied from the expression generating the exception.
8314 -- In the case where a debug source file is generated, the Sloc for
8315 -- this node points to the left bracket in the Sprint file output.
8317 -- Note: the back end may be required to translate these nodes into
8318 -- appropriate goto statements. See description of N_Push/Pop_xxx_Label.
8320 ---------------------------------------------
8321 -- Optimization of Exception Raise to Goto --
8322 ---------------------------------------------
8324 -- In some cases, the front end will determine that any exception raised
8325 -- by the back end for a certain exception should be transformed into a
8326 -- goto statement.
8328 -- There are three kinds of exceptions raised by the back end (note that
8329 -- for this purpose we consider gigi to be part of the back end in the
8330 -- gcc case):
8332 -- 1. Exceptions resulting from N_Raise_xxx_Error nodes
8333 -- 2. Exceptions from checks triggered by Do_xxx_Check flags
8334 -- 3. Other cases not specifically marked by the front end
8336 -- Normally all such exceptions are translated into calls to the proper
8337 -- Rcheck_xx procedure, where xx encodes both the exception to be raised
8338 -- and the exception message.
8340 -- The front end may determine that for a particular sequence of code,
8341 -- exceptions in any of these three categories for a particular builtin
8342 -- exception should result in a goto, rather than a call to Rcheck_xx.
8343 -- The exact sequence to be generated is:
8345 -- Local_Raise (exception'Identity);
8346 -- goto Label
8348 -- The front end marks such a sequence of code by bracketing it with
8349 -- push and pop nodes:
8351 -- N_Push_xxx_Label (referencing the label)
8352 -- ...
8353 -- (code where transformation is expected for exception xxx)
8354 -- ...
8355 -- N_Pop_xxx_Label
8357 -- The use of push/pop reflects the fact that such regions can properly
8358 -- nest, and one special case is a subregion in which no transformation
8359 -- is allowed. Such a region is marked by a N_Push_xxx_Label node whose
8360 -- Exception_Label field is Empty.
8362 -- N_Push_Constraint_Error_Label
8363 -- Sloc references first statement in region covered
8364 -- Exception_Label
8366 -- N_Push_Program_Error_Label
8367 -- Sloc references first statement in region covered
8368 -- Exception_Label
8370 -- N_Push_Storage_Error_Label
8371 -- Sloc references first statement in region covered
8372 -- Exception_Label
8374 -- N_Pop_Constraint_Error_Label
8375 -- Sloc references last statement in region covered
8377 -- N_Pop_Program_Error_Label
8378 -- Sloc references last statement in region covered
8380 -- N_Pop_Storage_Error_Label
8381 -- Sloc references last statement in region covered
8383 ---------------
8384 -- Reference --
8385 ---------------
8387 -- For a number of purposes, we need to construct references to objects.
8388 -- These references are subsequently treated as normal access values.
8389 -- An example is the construction of the parameter block passed to a
8390 -- task entry. The N_Reference node is provided for this purpose. It is
8391 -- similar in effect to the use of the Unrestricted_Access attribute,
8392 -- and like Unrestricted_Access can be applied to objects which would
8393 -- not be valid prefixes for the Unchecked_Access attribute (e.g.
8394 -- objects which are not aliased, and slices). In addition it can be
8395 -- applied to composite type values as well as objects, including string
8396 -- values and aggregates.
8398 -- Note: we use the Prefix field for this expression so that the
8399 -- resulting node can be treated using common code with the attribute
8400 -- nodes for the 'Access and related attributes. Logically it would make
8401 -- more sense to call it an Expression field, but then we would have to
8402 -- special case the treatment of the N_Reference node.
8404 -- Note: evaluating a N_Reference node is guaranteed to yield a non-null
8405 -- value at run time. Therefore, it is valid to set Is_Known_Non_Null on
8406 -- a temporary initialized to a N_Reference node in order to eliminate
8407 -- superfluous access checks.
8409 -- Sprint syntax: prefix'reference
8411 -- N_Reference
8412 -- Sloc is copied from the expression
8413 -- Prefix
8414 -- plus fields for expression
8416 -- Note: in the case where a debug source file is generated, the Sloc
8417 -- for this node points to the quote in the Sprint file output.
8419 ----------------
8420 -- SCIL Nodes --
8421 ----------------
8423 -- SCIL nodes are special nodes added to the tree when the CodePeer mode
8424 -- is active. They are only generated if SCIL generation is enabled.
8425 -- A standard tree-walk will not encounter these nodes even if they
8426 -- are present; these nodes are only accessible via the function
8427 -- SCIL_LL.Get_SCIL_Node. These nodes have no associated dynamic
8428 -- semantics.
8430 -- Sprint syntax: [ <node kind> ]
8431 -- No semantic field values are displayed.
8433 -- N_SCIL_Dispatch_Table_Tag_Init
8434 -- Sloc references a node for a tag initialization
8435 -- SCIL_Entity
8437 -- An N_SCIL_Dispatch_Table_Tag_Init node may be associated (via
8438 -- Get_SCIL_Node) with the N_Object_Declaration node corresponding to
8439 -- the declaration of the dispatch table for a tagged type.
8441 -- N_SCIL_Dispatching_Call
8442 -- Sloc references the node of a dispatching call
8443 -- SCIL_Target_Prim
8444 -- SCIL_Entity
8445 -- SCIL_Controlling_Tag
8447 -- An N_Scil_Dispatching call node may be associated (via Get_SCIL_Node)
8448 -- with the N_Procedure_Call_Statement or N_Function_Call node (or a
8449 -- rewriting thereof) corresponding to a dispatching call.
8451 -- N_SCIL_Membership_Test
8452 -- Sloc references the node of a membership test
8453 -- SCIL_Tag_Value
8454 -- SCIL_Entity
8456 -- An N_Scil_Membership_Test node may be associated (via Get_SCIL_Node)
8457 -- with the N_In node (or a rewriting thereof) corresponding to a
8458 -- classwide membership test.
8460 --------------------------
8461 -- Unchecked Expression --
8462 --------------------------
8464 -- An unchecked expression is one that must be analyzed and resolved
8465 -- with all checks off, regardless of the current setting of scope
8466 -- suppress flags.
8468 -- Sprint syntax: `(expression)
8470 -- Note: this node is always removed from the tree (and replaced by
8471 -- its constituent expression) on completion of analysis, so it only
8472 -- appears in intermediate trees, and will never be seen by Gigi.
8474 -- N_Unchecked_Expression
8475 -- Sloc is a copy of the Sloc of the expression
8476 -- Expression
8477 -- plus fields for expression
8479 -- Note: in the case where a debug source file is generated, the Sloc
8480 -- for this node points to the back quote in the Sprint file output.
8482 -------------------------------
8483 -- Unchecked Type Conversion --
8484 -------------------------------
8486 -- An unchecked type conversion node represents the semantic action
8487 -- corresponding to a call to an instantiation of Unchecked_Conversion.
8488 -- It is generated as a result of actual use of Unchecked_Conversion
8489 -- and also by the expander.
8491 -- Unchecked type conversion nodes should be created by calling
8492 -- Tbuild.Unchecked_Convert_To, rather than by directly calling
8493 -- Nmake.Make_Unchecked_Type_Conversion.
8495 -- Note: an unchecked type conversion is a variable as far as the
8496 -- semantics are concerned, which is convenient for the expander.
8497 -- This does not change what Ada source programs are legal, since
8498 -- clearly a function call to an instantiation of Unchecked_Conversion
8499 -- is not a variable in any case.
8501 -- Sprint syntax: subtype-mark!(expression)
8503 -- N_Unchecked_Type_Conversion
8504 -- Sloc points to related node in source
8505 -- Subtype_Mark
8506 -- Expression
8507 -- Kill_Range_Check
8508 -- No_Truncation
8509 -- plus fields for expression
8511 -- Note: in the case where a debug source file is generated, the Sloc
8512 -- for this node points to the exclamation in the Sprint file output.
8514 -----------------------------------
8515 -- Validate_Unchecked_Conversion --
8516 -----------------------------------
8518 -- The front end does most of the validation of unchecked conversion,
8519 -- including checking sizes (this is done after the back end is called
8520 -- to take advantage of back-annotation of calculated sizes).
8522 -- The front end also deals with specific cases that are not allowed
8523 -- e.g. involving unconstrained array types.
8525 -- For the case of the standard gigi backend, this means that all
8526 -- checks are done in the front end.
8528 -- However, in the case of specialized back-ends, in particular the JVM
8529 -- backend in the past, additional requirements and restrictions may
8530 -- apply to unchecked conversion, and these are most conveniently
8531 -- performed in the specialized back-end.
8533 -- To accommodate this requirement, for such back ends, the following
8534 -- special node is generated recording an unchecked conversion that
8535 -- needs to be validated. The back end should post an appropriate
8536 -- error message if the unchecked conversion is invalid or warrants
8537 -- a special warning message.
8539 -- Source_Type and Target_Type point to the entities for the two
8540 -- types involved in the unchecked conversion instantiation that
8541 -- is to be validated.
8543 -- Sprint syntax: validate Unchecked_Conversion (source, target);
8545 -- N_Validate_Unchecked_Conversion
8546 -- Sloc points to instantiation (location for warning message)
8547 -- Source_Type
8548 -- Target_Type
8550 -- Note: in the case where a debug source file is generated, the Sloc
8551 -- for this node points to the VALIDATE keyword in the file output.
8553 -------------------------------
8554 -- Variable_Reference_Marker --
8555 -------------------------------
8557 -- This node is created during the analysis of direct or expanded names,
8558 -- and the resolution of entry and subprogram calls. It performs several
8559 -- functions:
8561 -- * Variable reference markers provide a uniform model for handling
8562 -- variable references by the ABE mechanism, regardless of whether
8563 -- expansion took place.
8565 -- * The variable reference marker captures the entity of the variable
8566 -- being read or written.
8568 -- * The variable reference markers aid the ABE Processing phase by
8569 -- signaling the presence of a call in case the original variable
8570 -- reference was transformed by expansion.
8572 -- Sprint syntax: r#target# -- for a read
8573 -- rw#target# -- for a read/write
8574 -- w#target# -- for a write
8576 -- The Sprint syntax shown above is not enabled by default
8578 -- N_Variable_Reference_Marker
8579 -- Sloc points to Sloc of original variable reference
8580 -- Target
8581 -- Is_Elaboration_Checks_OK_Node
8582 -- Is_SPARK_Mode_On_Node
8583 -- Is_Elaboration_Warnings_OK_Node
8584 -- Is_Read
8585 -- Is_Write
8587 -----------
8588 -- Empty --
8589 -----------
8591 -- Used as the contents of the Nkind field of the dummy Empty node and in
8592 -- some other situations to indicate an uninitialized value.
8594 -- N_Empty
8595 -- Chars is set to No_Name
8597 -----------
8598 -- Error --
8599 -----------
8601 -- Used as the contents of the Nkind field of the dummy Error node.
8602 -- Has an Etype field, which gets set to Any_Type later on, to help
8603 -- error recovery (Error_Posted is also set in the Error node).
8605 -- N_Error
8606 -- Chars is set to Error_Name
8607 -- Etype
8609 end Sinfo;