1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This package defines the structure of the abstract syntax tree. The Tree
35 -- package provides a basic tree structure. Sinfo describes how this
36 -- structure is used to represent the syntax of an Ada program.
38 -- Note: the grammar used here is taken from Version 5.95 of the RM, dated
39 -- November 1994. The grammar in the RM is followed very closely in the tree
40 -- design, and is repeated as part of this source file.
42 -- The tree contains not only the full syntactic representation of the
43 -- program, but also the results of semantic analysis. In particular, the
44 -- nodes for defining identifiers, defining character literals and defining
45 -- operator symbols, collectively referred to as entities, represent what
46 -- would normally be regarded as the symbol table information. In addition
47 -- a number of the tree nodes contain semantic information.
49 -- WARNING: There is a C version of this package. Any changes to this
50 -- source file must be properly reflected in this C header file sinfo.h
51 -- which is created automatically from sinfo.ads using xsinfo.adb.
53 with Types; use Types;
54 with Uintp; use Uintp;
55 with Urealp; use Urealp;
59 ---------------------------------
60 -- Making Changes to This File --
61 ---------------------------------
63 -- If changes are made to this file, a number of related steps must be
64 -- carried out to ensure consistency. First, if a field access function
65 -- is added, it appears in seven places:
67 -- The documentation associated with the node
68 -- The spec of the access function in sinfo.ads
69 -- The body of the access function in sinfo.adb
70 -- The pragma Inline at the end of sinfo.ads for the access function
71 -- The spec of the set procedure in sinfo.ads
72 -- The body of the set procedure in sinfo.adb
73 -- The pragma Inline at the end of sinfo.ads for the set procedure
75 -- The field chosen must be consistent in all places, and, for a node
76 -- that is a subexpression, must not overlap any of the standard
79 -- In addition, if any of the standard expression fields is changed, then
80 -- the utiliy program which creates the Treeprs spec (in file treeprs.ads)
81 -- must be updated appropriately, since it special cases expression fields.
83 -- If a new tree node is added, then the following changes are made
85 -- Add it to the documentation in the appropriate place
86 -- Add its fields to this documentation section
87 -- Define it in the appropriate classification in Node_Kind
88 -- In the body (sinfo), add entries to the access functions for all
89 -- its fields (except standard expression fields) to include the new
90 -- node in the checks.
91 -- Add an appropriate section to the case statement in sprint.adb
92 -- Add an appropriate section to the case statement in sem.adb
93 -- Add an appropraite section to the case statement in exp_util.adb
94 -- (Insert_Actions procedure)
95 -- For a subexpression, add an appropriate sections to the case
96 -- statement in sem_eval.adb
97 -- For a subexpression, add an appropriate sections to the case
98 -- statement in sem_res.adb
100 -- Finally, four utility programs must be run:
102 -- Run CSinfo to check that you have made the changes consistently.
103 -- It checks most of the rules given above, with clear error messages.
104 -- This utility reads sinfo.ads and sinfo.adb and generates a report
105 -- to standard output.
107 -- Run XSinfo to create a-sinfo.h, the corresponding C header. This
108 -- utility reads sinfo.ads and generates a-sinfo.h. Note that it
109 -- does not need to read sinfo.adb, since the contents of the body
110 -- are algorithmically determinable from the spec.
112 -- Run XTreeprs to create treeprs.ads, an updated version of
113 -- the module that is used to drive the tree print routine. This
114 -- utility reads (but does not modify) treeprs.adt, the template
115 -- that provides the basic structure of the file, and then fills
116 -- in the data from the comments in sinfo.ads.
118 -- Run XNmake to create nmake.ads and nmake.adb, the package body
119 -- and spec of the Nmake package which contains functions for
120 -- constructing nodes.
122 -- Note: sometime we could write a utility that actually generated the
123 -- body of sinfo from the spec instead of simply checking it, since, as
124 -- noted above, the contents of the body can be determined from the spec.
126 --------------------------------
127 -- Implicit Nodes in the Tree --
128 --------------------------------
130 -- Generally the structure of the tree very closely follows the grammar
131 -- as defined in the RM. However, certain nodes are omitted to save
132 -- space and simplify semantic processing. Two general classes of such
133 -- omitted nodes are as follows:
135 -- If the only possibilities for a non-terminal are one or more other
136 -- non terminals (i.e. the rule is a "skinny" rule), then usually the
137 -- corresponding node is omitted from the tree, and the target construct
138 -- appears directly. For example, a real type definition is either a
139 -- floating point definition or a fixed point definition. No explicit
140 -- node appears for real type definition. Instead either the floating
141 -- point definition or fixed point definition appears directly.
143 -- If a non-terminal corresponds to a list of some other non-terminal
144 -- (possibly with separating punctuation), then usually it is omitted
145 -- from the tree, and a list of components appears instead. For
146 -- example, sequence of statements does not appear explicitly in the
147 -- tree. Instead a list of statements appears directly.
149 -- Some additional cases of omitted nodes occur and are documented
150 -- individually. In particular, many nodes are omitted in the tree
151 -- generated for an expression.
153 -------------------------------------------
154 -- Handling of Defining Identifier Lists --
155 -------------------------------------------
157 -- In several declarative forms in the syntax, lists of defining
158 -- identifiers appear (object declarations, component declarations,
159 -- number declarations etc.)
161 -- The semantics of such statements are equivalent to a series of
162 -- identical declarations of single defining identifiers (except that
163 -- conformance checks require the same grouping of identifiers in the
166 -- To simplify semantic processing, the parser breaks down such multiple
167 -- declaration cases into sequences of single declarations, duplicating
168 -- type and initialization information as required. The flags More_Ids
169 -- and Prev_Ids are used to record the original form of the source in
170 -- the case where the original source used a list of names, More_Ids
171 -- being set on all but the last name and Prev_Ids being set on all
172 -- but the first name. These flags are used to reconstruct the original
173 -- source (e.g. in the Sprint package), and also are included in the
174 -- conformance checks, but otherwise have no semantic significance.
176 -- Note: the reason that we use More_Ids and Prev_Ids rather than
177 -- First_Name and Last_Name flags is so that the flags are off in the
178 -- normal one identifier case, which minimizes tree print output.
180 -----------------------
181 -- Use of Node Lists --
182 -----------------------
184 -- With a few exceptions, if a construction of the form {non-terminal}
185 -- appears in the tree, lists are used in the corresponding tree node
186 -- (see package Nlists for handling of node lists). In this case a field
187 -- of the parent node points to a list of nodes for the non-terminal. The
188 -- field name for such fields has a plural name which always ends in "s".
189 -- For example, a case statement has a field Alternatives pointing to a
190 -- list of case statement alternative nodes.
192 -- Only fields pointing to lists have names ending in "s", so generally
193 -- the structure is strongly typed, fields not ending in s point to
194 -- single nodes, and fields ending in s point to lists.
196 -- The following example shows how a traversal of a list is written. We
197 -- suppose here that Stmt points to a N_Case_Statement node which has
198 -- a list field called Alternatives:
200 -- Alt := First (Alternatives (Stmt));
201 -- while Present (Alt) loop
203 -- -- processing for case statement alternative Alt
205 -- Alt := Next (Alt);
208 -- The Present function tests for Empty, which in this case signals the
209 -- end of the list. First returns Empty immediately if the list is empty.
210 -- Present is defined in Atree, First and Next are defined in Nlists.
212 -- The exceptions to this rule occur with {DEFINING_IDENTIFIERS} in all
213 -- contexts, which is handled as described in the previous section, and
214 -- with {,library_unit_NAME} in the N_With_Clause mode, which is handled
215 -- using the First_Name and Last_Name flags, as further detailed in the
216 -- description of the N_With_Clause node.
222 -- Pragmas can appear in many different context, but are not included
223 -- in the grammar. Still they must appear in the tree, so they can be
224 -- properly processed.
226 -- Two approaches are used. In some cases, an extra field is defined
227 -- in an appropriate node that contains a list of pragmas appearing
228 -- in the expected context. For example pragmas can appear before an
229 -- Accept_Alternative in a Selective_Accept_Statement, and these pragmas
230 -- appear in the Pragmas_Before field of the N_Accept_Alternative node.
232 -- The other approach is to simply allow pragmas to appear in syntactic
233 -- lists where the grammar (of course) does not include the possibility.
234 -- For example, the Variants field of an N_Variant_Part node points to
235 -- a list that can contain both N_Pragma and N_Variant nodes.
237 -- To make processing easier in the latter case, the Nlists package
238 -- provides a set of routines (First_Non_Pragma, Last_Non_Pragma,
239 -- Next_Non_Pragma, Prev_Non_Pragma) that allow such lists to be
240 -- handled ignoring all pragmas.
242 -- In the case of the variants list, we can either write:
244 -- Variant := First (Variants (N));
245 -- while Present (Variant) loop
247 -- Variant := Next (Variant);
252 -- Variant := First_Non_Pragma (Variants (N));
253 -- while Present (Variant) loop
255 -- Variant := Next_Non_Pragma (Variant);
258 -- In the first form of the loop, Variant can either be an N_Pragma or
259 -- an N_Variant node. In the second form, Variant can only be N_Variant
260 -- since all pragmas are skipped.
262 ---------------------
263 -- Optional Fields --
264 ---------------------
266 -- Fields which correspond to a section of the syntax enclosed in square
267 -- brackets are generally omitted (and the corresponding field set to
268 -- Empty for a node, or No_List for a list). The documentation of such
269 -- fields notes these cases. One exception to this rule occurs in the
270 -- case of possibly empty statement sequences (such as the sequence of
271 -- statements in an entry call alternative). Such cases appear in the
272 -- syntax rules as [SEQUENCE_OF_STATEMENTS] and the fields corresponding
273 -- to such optional statement sequences always contain an empty list (not
274 -- No_List) if no statements are present.
276 -- Note: the utility program that constructs the body and spec of the
277 -- Nmake package relies on the format of the comments to determine if
278 -- a field should have a default value in the corresponding make routine.
279 -- The rule is that if the first line of the description of the field
280 -- contains the string "(set to xxx if", then a default value of xxx is
281 -- provided for this field in the corresponding Make_yyy routine.
283 -----------------------------------
284 -- Note on Body/Spec Terminology --
285 -----------------------------------
287 -- In informal discussions about Ada, it is customary to refer to package
288 -- and subprogram specs and bodies. However, this is not technically
289 -- correct, what is normally referred to as a spec or specification is in
290 -- fact a package declaration or subprogram declaration. We are careful
291 -- in GNAT to use the correct terminology and in particular, the full
292 -- word specification is never used as an incorrect substitute for
293 -- declaration. The structure and terminology used in the tree also
294 -- reflects the grammar and thus uses declaration and specification in
295 -- the technically correct manner.
297 -- However, there are contexts in which the informal terminology is
298 -- useful. We have the word "body" to refer to the Interp_Etype declared by
299 -- the declaration of a unit body, and in some contexts we need a
300 -- similar term to refer to the entity declared by the package or
301 -- subprogram declaration, and simply using declaration can be confusing
302 -- since the body also has a declaration.
304 -- An example of such a context is the link between the package body
305 -- and its declaration. With_Declaration is confusing, since
306 -- the package body itself is a declaration.
308 -- To deal with this problem, we reserve the informal term Spec, i.e.
309 -- the popular abbreviation used in this context, to refer to the entity
310 -- declared by the package or subprogram declaration. So in the above
311 -- example case, the field in the body is called With_Spec.
313 -- Another important context for the use of the word Spec is in error
314 -- messages, where a hyper-correct use of declaration would be confusing
315 -- to a typical Ada programmer, and even for an expert programmer can
316 -- cause confusion since the body has a declaration as well.
320 -- Declaration always refers to the syntactic entity that is called
321 -- a declaration. In particular, subprogram declaration
322 -- and package declaration are used to describe the
323 -- syntactic entity that includes the semicolon.
325 -- Specification always refers to the syntactic entity that is called
326 -- a specification. In particular, the terms procedure
327 -- specification, function specification, package
328 -- specification, subprogram specification always refer
329 -- to the syntactic entity that has no semicolon.
331 -- Spec is an informal term, used to refer to the entity
332 -- that is declared by a task declaration, protected
333 -- declaration, generic declaration, subprogram
334 -- declaration or package declaration.
336 -- This convention is followed throughout the GNAT documentation
337 -- both internal and external, and in all error message text.
339 ------------------------
340 -- Internal Use Nodes --
341 ------------------------
343 -- These are Node_Kind settings used in the internal implementation
344 -- which are not logically part of the specification.
347 -- Completely unused entry at the start of the enumeration type. This
348 -- is inserted so that no legitimate value is zero, which helps to get
349 -- better debugging behavior, since zero is a likely uninitialized value).
352 -- Completely unused entry at the end of the enumeration type. This is
353 -- handy so that arrays with Node_Kind as the index type have an extra
354 -- entry at the end (see for example the use of the Pchar_Pos_Array in
355 -- Treepr, where the extra entry provides the limit value when dealing
356 -- with the last used entry in the array).
358 -----------------------------------------
359 -- Note on the settings of Sloc fields --
360 -----------------------------------------
362 -- The Sloc field of nodes that come from the source is set by the
363 -- parser. For internal nodes, and nodes generated during expansion
364 -- the Sloc is usually set in the call to the constructor for the node.
365 -- In general the Sloc value chosen for an internal node is the Sloc of
366 -- the source node whose processing is responsible for the expansion. For
367 -- example, the Sloc of an inherited primitive operation is the Sloc of
368 -- the corresponding derived type declaration.
370 -- For the nodes of a generic instantiation, the Sloc value is encoded
371 -- to represent both the original Sloc in the generic unit, and the Sloc
372 -- of the instantiation itself. See Sinput.ads for details.
374 -- Subprogram instances create two callable entities: one is the visible
375 -- subprogram instance, and the other is an anonymous subprogram nested
376 -- within a wrapper package that contains the renamings for the actuals.
377 -- Both of these entities have the Sloc of the defining entity in the
378 -- instantiation node. This simplifies some ASIS queries.
380 -----------------------
381 -- Field Definitions --
382 -----------------------
384 -- In the following node definitions, all fields, both syntactic and
385 -- semantic, are documented. The one exception is in the case of entities
386 -- (defining indentifiers, character literals and operator symbols),
387 -- where the usage of the fields depends on the entity kind. Entity
388 -- fields are fully documented in the separate package Einfo.
390 -- In the node definitions, three common sets of fields are abbreviated
391 -- to save both space in the documentation, and also space in the string
392 -- (defined in Tree_Print_Strings) used to print trees. The following
393 -- abbreviations are used:
395 -- Note: the utility program that creates the Treeprs spec (in the file
396 -- xtreeprs.adb) knows about the special fields here, so it must be
397 -- modified if any change is made to these fields.
399 -- "plus fields for binary operator"
400 -- Chars (Name1) Name_Id for the operator
401 -- Left_Opnd (Node2) left operand expression
402 -- Right_Opnd (Node3) right operand expression
403 -- Entity (Node4-Sem) defining entity for operator
404 -- Associated_Node (Node4-Sem) for generic processing
405 -- Do_Overflow_Check (Flag17-Sem) set if overflow check needed
406 -- Has_Private_View (Flag11-Sem) set in generic units.
408 -- "plus fields for unary operator"
409 -- Chars (Name1) Name_Id for the operator
410 -- Right_Opnd (Node3) right operand expression
411 -- Entity (Node4-Sem) defining entity for operator
412 -- Associated_Node (Node4-Sem) for generic processing
413 -- Do_Overflow_Check (Flag17-Sem) set if overflow check needed
414 -- Has_Private_View (Flag11-Sem) set in generic units.
416 -- "plus fields for expression"
417 -- Paren_Count number of parentheses levels
418 -- Etype (Node5-Sem) type of the expression
419 -- Is_Overloaded (Flag5-Sem) >1 type interpretation exists
420 -- Is_Static_Expression (Flag6-Sem) set for static expression
421 -- Raises_Constraint_Error (Flag7-Sem) evaluation raises CE
422 -- Must_Not_Freeze (Flag8-Sem) set if must not freeze
423 -- Do_Range_Check (Flag9-Sem) set if a range check needed
424 -- Assignment_OK (Flag15-Sem) set if modification is OK
425 -- Is_Controlling_Actual (Flag16-Sem) set for controlling argument
427 -- Note: see under (EXPRESSION) for further details on the use of
428 -- the Paren_Count field to record the number of parentheses levels.
430 -- Node_Kind is the type used in the Nkind field to indicate the node
431 -- kind. The actual definition of this type is given later (the reason
432 -- for this is that we want the descriptions ordered by logical chapter
433 -- in the RM, but the type definition is reordered to facilitate the
434 -- definition of some subtype ranges. The individual descriptions of
435 -- the nodes show how the various fields are used in each node kind,
436 -- as well as providing logical names for the fields. Functions and
437 -- procedures are provided for accessing and setting these fields
438 -- using these logical names.
440 -----------------------
441 -- Gigi Restrictions --
442 -----------------------
444 -- The tree passed to Gigi is more restricted than the general tree form.
445 -- For example, as a result of expansion, most of the tasking nodes can
446 -- never appear. For each node to which either a complete or partial
447 -- restriction applies, a note entitled "Gigi restriction" appears which
448 -- documents the restriction.
450 -- Note that most of these restrictions apply only to trees generated when
451 -- code is being generated, since they involved expander actions that
454 ------------------------
455 -- Common Flag Fields --
456 ------------------------
458 -- The following flag fields appear in all nodes
461 -- This flag is used to indicate that a node (and all its children
462 -- have been analyzed. It is used to avoid reanalysis of a node that
463 -- has already been analyzed, both for efficiency and functional
464 -- correctness reasons.
467 -- This flag is used to avoid multiple error messages being posted
468 -- on or referring to the same node. This flag is set if an error
469 -- message refers to a node or is posted on its source location,
470 -- and has the effect of inhibiting further messages involving
474 -- This flag is on for any nodes built by the scanner or parser from
475 -- the source program, and off for any nodes built by the analyzer or
476 -- expander. It indicates that a node comes from the original source.
477 -- This flag is defined in Atree.
479 -- Has_Dynamic_Length_Check and Has_Dynamic_Range_Check also appear on
480 -- all nodes. They are fully described in the next section.
482 ------------------------------------
483 -- Description of Semantic Fields --
484 ------------------------------------
486 -- The meaning of the syntactic fields is generally clear from their
487 -- names without any further description, since the names are chosen
488 -- to correspond very closely to the syntax in the reference manual.
489 -- This section describes the usage of the semantic fields, which are
490 -- used to contain additional information determined during semantic
493 -- ABE_Is_Certain (Flag18-Sem)
494 -- This flag is set in an instantiation node or a call node is
495 -- determined to be sure to raise an ABE. This is used to trigger
496 -- special handling of such cases, particularly in the instantiation
497 -- case where we avoid instantiating the body if this flag is set.
498 -- This flag is also present in an N_Formal_Package_Declaration_Node
499 -- since formal package declarations are treated like instantiations,
500 -- but it is always set to False in this context.
502 -- Accept_Handler_Records (List5-Sem)
503 -- This field is present only in an N_Accept_Alternative node. It is
504 -- used to temporarily hold the exception handler records from an
505 -- accept statement in a selective accept. These exception handlers
506 -- will eventually be placed in the Handler_Records list of the
507 -- procedure built for this accept (see Expand_N_Selective_Accept
508 -- procedure in Exp_Ch9 for further details).
510 -- Access_Types_To_Process (Elist2-Sem)
511 -- Present in N_Freeze_Entity nodes for Incomplete or private types.
512 -- Contains the list of access types which may require specific
513 -- treatment when the nature of the type completion is completely
514 -- known. An example of such treatement is the generation of the
515 -- associated_final_chain.
517 -- Actions (List1-Sem)
518 -- This field contains a sequence of actions that are associated
519 -- with the node holding the field. See the individual node types
520 -- for details of how this field is used, as well as the description
521 -- of the specific use for a particular node type.
523 -- Activation_Chain_Entity (Node3-Sem)
524 -- This is used in tree nodes representing task activators (blocks,
525 -- subprogram bodies, package declarations, and task bodies). It is
526 -- initially Empty, and then gets set to point to the entity for the
527 -- declared Activation_Chain variable when the first task is declared.
528 -- When tasks are declared in the corresponding declarative region
529 -- this entity is located by name (its name is always _Chain) and
530 -- the declared tasks are added to the chain.
532 -- Acts_As_Spec (Flag4-Sem)
533 -- A flag set in the N_Subprogram_Body node for a subprogram body
534 -- which is acting as its own spec. This flag also appears in the
535 -- compilation unit node at the library level for such a subprogram
536 -- (see further description in spec of Lib package).
538 -- Aggregate_Bounds (Node3-Sem)
539 -- Present in array N_Aggregate nodes. If the aggregate contains
540 -- component associations this field points to an N_Range node whose
541 -- bounds give the lowest and highest discrete choice values. If the
542 -- named aggregate contains a dynamic or null choice this field is
543 -- empty. If the aggregate contains positional elements this field
544 -- points to an N_Integer_Literal node giving the number of positional
545 -- elements. Note that if the aggregate contains positional elements
546 -- and an other choice the N_Integer_Literal only accounts for the
547 -- number of positional elements.
549 -- All_Others (Flag11-Sem)
550 -- Present in an N_Others_Choice node. This flag is set in the case
551 -- of an others exception where all exceptions are to be caught, even
552 -- those that are not normally handled (in particular the tasking abort
553 -- signal). This is used for translation of the at end handler into
554 -- a normal exception handler.
556 -- Assignment_OK (Flag15-Sem)
557 -- This flag is set in a subexpression node for an object, indicating
558 -- that the associated object can be modified, even if this would not
559 -- normally be permissible (either by direct assignment, or by being
560 -- passed as an out or in-out parameter). This is used by the expander
561 -- for a number of purposes, including initialzation of constants and
562 -- limited type objects (such as tasks), setting discriminant fields,
563 -- setting tag values, etc. N_Object_Declaration nodes also have this
564 -- flag defined. Here it is used to indicate that an initialization
565 -- expression is valid, even where it would normally not be allowed
566 -- (e.g. where the type involved is limited).
568 -- Associated_Node (Node4-Sem)
569 -- Present in nodes that can denote an entity: identifiers, character
570 -- literals, operator symbols, expanded names, operator nodes, and
571 -- attribute reference nodes (all these nodes have an Entity field).
572 -- This field is also present in N_Aggregate, N_Selected_Component,
573 -- and N_Extension_Aggregate nodes. This field is used in generic
574 -- processing to create links between the generic template and the
575 -- generic copy. See Sem_Ch12.Get_Associated_Node for full details.
576 -- Note that this field overlaps Entity, which is fine, since, as
577 -- explained in Sem_Ch12, the normal function of Entity is not
578 -- required at the point where the Associated_Node is set. Note
579 -- also, that in generic templates, this means that the Entity field
580 -- does not necessarily point to an Entity. Since the back end is
581 -- expected to ignore generic templates, this is harmless.
583 -- At_End_Proc (Node1)
584 -- This field is present in an N_Handled_Sequence_Of_Statements node.
585 -- It contains an identifier reference for the cleanup procedure to
586 -- be called. See description of this node for further details.
588 -- Backwards_OK (Flag6-Sem)
589 -- A flag present in the N_Assignment_Statement node. It is used only
590 -- if the type being assigned is an array type, and is set if analysis
591 -- determines that it is definitely safe to do the copy backwards, i.e.
592 -- starting at the highest addressed element. Note that if neither of
593 -- the flags Forwards_OK or Backwards_OK is set, it means that the
594 -- front end could not determine that either direction is definitely
595 -- safe, and a runtime check is required.
597 -- Body_To_Inline (Node3-Sem)
598 -- present in subprogram declarations. Denotes analyzed but unexpanded
599 -- body of subprogram, to be used when inlining calls. Present when the
600 -- subprogram has an Inline pragma and inlining is enabled. If the
601 -- declaration is completed by a renaming_as_body, and the renamed en-
602 -- tity is a subprogram, the Body_To_Inline is the name of that entity,
603 -- which is used directly in later calls to the original subprogram.
605 -- Body_Required (Flag13-Sem)
606 -- A flag that appears in the N_Compilation_Unit node indicating that
607 -- the corresponding unit requires a body. For the package case, this
608 -- indicates that a completion is required. In Ada 95, if the flag
609 -- is not set for the package case, then a body may not be present.
610 -- In Ada 83, if the flag is not set for the package case, then a
611 -- body is optional. For a subprogram declaration, the flag is set
612 -- except in the case where a pragma Import or Interface applies,
613 -- in which case no body is permitted (in Ada 83 or Ada 95).
615 -- By_Ref (Flag5-Sem)
616 -- A flag present in the N_Return_Statement_Node. It is set when the
617 -- returned expression is already allocated on the secondary stack
618 -- and thus the result is passed by reference rather than copied
621 -- Check_Address_Alignment (Flag11-Sem)
622 -- A flag present in N_Attribute_Definition clause for a 'Address
623 -- attribute definition. This flag is set if a dynamic check should
624 -- be generated at the freeze point for the entity to which this
625 -- address clause applies. The reason that we need this flag is that
626 -- we want to check for range checks being suppressed at the point
627 -- where the attribute definition clause is given, rather than
628 -- testing this at the freeze point.
630 -- Compile_Time_Known_Aggregate (Flag18-Sem)
631 -- Present in N_Aggregate nodes. Set for aggregates which can be
632 -- fully evaluated at compile time without raising constraint error.
633 -- Such aggregates can be passed as is to Gigi without any expansion.
634 -- See Sem_Aggr for the specific conditions under which an aggregate
635 -- has this flag set. See also the flag Static_Processing_OK.
637 -- Condition_Actions (List3-Sem)
638 -- This field appears in else-if nodes and in the iteration scheme
639 -- node for while loops. This field is only used during semantic
640 -- processing to temporarily hold actions inserted into the tree.
641 -- In the tree passed to gigi, the condition actions field is always
642 -- set to No_List. For details on how this field is used, see the
643 -- routine Insert_Actions in package Exp_Util, and also the expansion
644 -- routines for the relevant nodes.
646 -- Controlling_Argument (Node1-Sem)
647 -- This field is set in procedure and function call nodes if the call
648 -- is a dispatching call (it is Empty for a non-dispatching call).
649 -- It indicates the source of the controlling tag for the call. For
650 -- Procedure calls, the Controlling_Argument is one of the actuals.
651 -- For a function that has a dispatching result, it is an entity in
652 -- the context of the call that can provide a tag, or else it is the
653 -- tag of the root type of the class. It can also specify a tag
654 -- directly rather than being a tagged object. The latter is needed
655 -- by the implementations of AI-239 and AI-260.
657 -- Conversion_OK (Flag14-Sem)
658 -- A flag set on type conversion nodes to indicate that the conversion
659 -- is to be considered as being valid, even though it is the case that
660 -- the conversion is not valid Ada. This is used for the Enum_Rep,
661 -- Fixed_Value and Integer_Value attributes, for internal conversions
662 -- done for fixed-point operations, and for certain conversions for
663 -- calls to initialization procedures. If Conversion_OK is set, then
664 -- Etype must be set (the analyzer assumes that Etype has been set).
665 -- For the case of fixed-point operands, it also indicates that the
666 -- conversion is to be a direct conversion of the underlying integer
667 -- result, with no regard to the small operand.
669 -- Corresponding_Body (Node5-Sem)
670 -- This field is set in subprogram declarations, package declarations,
671 -- entry declarations of protected types, and in generic units. It
672 -- points to the defining entity for the corresponding body (NOT the
673 -- node for the body itself).
675 -- Corresponding_Formal_Spec (Node3-Sem)
676 -- This field is set in subprogram renaming declarations, where it points
677 -- to the defining entity for a formal subprogram in the case where the
678 -- renaming corresponds to a generic formal subprogram association in an
679 -- instantiation. The field is Empty if the renaming does not correspond
680 -- to such a formal association.
682 -- Corresponding_Generic_Association (Node5-Sem)
683 -- This field is defined for object declarations and object renaming
684 -- declarations. It is set for the declarations within an instance that
685 -- map generic formals to their actuals. If set, the field points to
686 -- a generic_association which is the original parent of the expression
687 -- or name appearing in the declaration. This simplifies ASIS queries.
689 -- Corresponding_Integer_Value (Uint4-Sem)
690 -- This field is set in real literals of fixed-point types (it is not
691 -- used for floating-point types). It contains the integer value used
692 -- to represent the fixed-point value. It is also set on the universal
693 -- real literals used to represent bounds of fixed-point base types
694 -- and their first named subtypes.
696 -- Corresponding_Spec (Node5-Sem)
697 -- This field is set in subprogram, package, task, and protected body
698 -- nodes, where it points to the defining entity in the corresponding
699 -- spec. The attribute is also set in N_With_Clause nodes, where
700 -- it points to the defining entity for the with'ed spec, and in
701 -- a subprogram renaming declaration when it is a Renaming_As_Body.
702 -- The field is Empty if there is no corresponding spec, as in the
703 -- case of a subprogram body that serves as its own spec.
705 -- Corresponding_Stub (Node3-Sem)
706 -- This field is present in an N_Subunit node. It holds the node in
707 -- the parent unit that is the stub declaration for the subunit. it is
708 -- set when analysis of the stub forces loading of the proper body. If
709 -- expansion of the proper body creates new declarative nodes, they are
710 -- inserted at the point of the corresponding_stub.
712 -- Dcheck_Function (Node5-Sem)
713 -- This field is present in an N_Variant node, It references the entity
714 -- for the discriminant checking function for the variant.
716 -- Debug_Statement (Node3)
717 -- This field is present in an N_Pragma node. It is used only for
718 -- a Debug pragma or pragma Assert with a second parameter. The
719 -- parameter is of the form of an expression, as required by the
720 -- pragma syntax, but is actually a procedure call. To simplify
721 -- semantic processing, the parser creates a copy of the argument
722 -- rearranged into a procedure call statement and places it in the
723 -- Debug_Statement field. Note that this field is considered a
724 -- syntactic field, since it is created by the parser.
726 -- Default_Expression (Node5-Sem)
727 -- This field is Empty if there is no default expression. If there
728 -- is a simple default expression (one with no side effects), then
729 -- this field simply contains a copy of the Expression field (both
730 -- point to the tree for the default expression). Default_Expression
731 -- is used for conformance checking.
733 -- Delay_Finalize_Attach (Flag14-Sem)
734 -- This flag is present in an N_Object_Declaration node. If it is set,
735 -- then in the case of a controlled type being declared and initialized,
736 -- the normal code for attaching the result to the appropriate local
737 -- finalization list is suppressed. This is used for functions that
738 -- return controlled types without using the secondary stack, where
739 -- it is the caller who must do the attachment.
741 -- Discr_Check_Funcs_Built (Flag11-Sem)
742 -- This flag is present in N_Full_Type_Declaration nodes. It is set when
743 -- discriminant checking functions are constructed. The purpose is to
744 -- avoid attempting to set these functions more than once.
746 -- Do_Accessibility_Check (Flag13-Sem)
747 -- This flag is set on N_Parameter_Specification nodes to indicate
748 -- that an accessibility check is required for the parameter. It is
749 -- not yet decided who takes care of this check (TBD ???).
751 -- Do_Discriminant_Check (Flag13-Sem)
752 -- This flag is set on N_Selected_Component nodes to indicate that a
753 -- discriminant check is required using the discriminant check routine
754 -- associated with the selector. The actual check is generated by the
755 -- expander when processing selected components.
757 -- Do_Division_Check (Flag13-Sem)
758 -- This flag is set on a division operator (/ mod rem) to indicate
759 -- that a zero divide check is required. The actual check is dealt
760 -- with by the backend (all the front end does is to set the flag).
762 -- Do_Length_Check (Flag4-Sem)
763 -- This flag is set in an N_Assignment_Statement, N_Op_And, N_Op_Or,
764 -- N_Op_Xor, or N_Type_Conversion node to indicate that a length check
765 -- is required. It is not determined who deals with this flag (???).
767 -- Do_Overflow_Check (Flag17-Sem)
768 -- This flag is set on an operator where an overflow check is required
769 -- on the operation. The actual check is dealt with by the backend
770 -- (all the front end does is to set the flag). The other cases where
771 -- this flag is used is on a Type_Conversion node and for attribute
772 -- reference nodes. For a type conversion, it means that the conversion
773 -- is from one base type to another, and the value may not fit in the
774 -- target base type. See also the description of Do_Range_Check for
775 -- this case. The only attribute references which use this flag are
776 -- Pred and Succ, where it means that the result should be checked
777 -- for going outside the base range.
779 -- Do_Range_Check (Flag9-Sem)
780 -- This flag is set on an expression which appears in a context where
781 -- a range check is required. The target type is clear from the
782 -- context. The contexts in which this flag can appear are limited to
785 -- Right side of an assignment. In this case the target type is
786 -- taken from the left side of the assignment, which is referenced
787 -- by the Name of the N_Assignment_Statement node.
789 -- Subscript expressions in an indexed component. In this case the
790 -- target type is determined from the type of the array, which is
791 -- referenced by the Prefix of the N_Indexed_Component node.
793 -- Argument expression for a parameter, appearing either directly
794 -- in the Parameter_Associations list of a call or as the Expression
795 -- of an N_Parameter_Association node that appears in this list. In
796 -- either case, the check is against the type of the formal. Note
797 -- that the flag is relevant only in IN and IN OUT parameters, and
798 -- will be ignored for OUT parameters, where no check is required
799 -- in the call, and if a check is required on the return, it is
800 -- generated explicitly with a type conversion.
802 -- Initialization expression for the initial value in an object
803 -- declaration. In this case the Do_Range_Check flag is set on
804 -- the initialization expression, and the check is against the
805 -- range of the type of the object being declared.
807 -- The expression of a type conversion. In this case the range check
808 -- is against the target type of the conversion. See also the use of
809 -- Do_Overflow_Check on a type conversion. The distinction is that
810 -- the overflow check protects against a value that is outside the
811 -- range of the target base type, whereas a range check checks that
812 -- the resulting value (which is a value of the base type of the
813 -- target type), satisfies the range constraint of the target type.
815 -- Note: when a range check is required in contexts other than those
816 -- listed above (e.g. in a return statement), an additional type
817 -- conversion node is introduced to represent the required check.
819 -- Do_Storage_Check (Flag17-Sem)
820 -- This flag is set in an N_Allocator node to indicate that a storage
821 -- check is required for the allocation, or in an N_Subprogram_Body
822 -- node to indicate that a stack check is required in the subprogram
823 -- prolog. The N_Allocator case is handled by the routine that expands
824 -- the call to the runtime routine. The N_Subprogram_Body case is
825 -- handled by the backend, and all the semantics does is set the flag.
827 -- Do_Tag_Check (Flag13-Sem)
828 -- This flag is set on an N_Assignment_Statement, N_Function_Call,
829 -- N_Procedure_Call_Statement, N_Type_Conversion or N_Return_Statememt
830 -- node to indicate that the tag check can be suppressed. It is not
831 -- yet decided how this flag is used (TBD ???).
833 -- Elaborate_Present (Flag4-Sem)
834 -- This flag is set in the N_With_Clause node to indicate that a
835 -- pragma Elaborate pragma appears for the with'ed units.
837 -- Elaborate_All_Present (Flag14-Sem)
838 -- This flag is set in the N_With_Clause node to indicate that a
839 -- pragma Elaborate_All pragma appears for the with'ed units.
841 -- Elaboration_Boolean (Node2-Sem)
842 -- This field is present in function and procedure specification
843 -- nodes. If set, it points to the entity for a Boolean flag that
844 -- must be tested for certain calls to check for access before
845 -- elaboration. See body of Sem_Elab for further details. This
846 -- field is Empty if no elaboration boolean is required.
848 -- Else_Actions (List3-Sem)
849 -- This field is present in conditional expression nodes. During code
850 -- expansion we use the Insert_Actions procedure (in Exp_Util) to insert
851 -- actions at an appropriate place in the tree to get elaborated at the
852 -- right time. For conditional expressions, we have to be sure that the
853 -- actions for the Else branch are only elaborated if the condition is
854 -- False. The Else_Actions field is used as a temporary parking place
855 -- for these actions. The final tree is always rewritten to eliminate
856 -- the need for this field, so in the tree passed to Gigi, this field
857 -- is always set to No_List.
859 -- Enclosing_Variant (Node2-Sem)
860 -- This field is present in the N_Variant node and identifies the
861 -- Node_Id corresponding to the immediately enclosing variant when
862 -- the variant is nested, and N_Empty otherwise. Set during semantic
863 -- processing of the variant part of a record type.
865 -- Entity (Node4-Sem)
866 -- Appears in all direct names (identifier, character literal,
867 -- operator symbol), as well as expanded names, and attributes that
868 -- denote entities, such as 'Class. Points to the entity for the
869 -- corresponding defining occurrence. Set after name resolution.
870 -- In the case of identifiers in a WITH list, the corresponding
871 -- defining occurrence is in a separately compiled file, and this
872 -- pointer must be set using the library Load procedure. Note that
873 -- during name resolution, the value in Entity may be temporarily
874 -- incorrect (e.g. during overload resolution, Entity is initially
875 -- set to the first possible correct interpretation, and then later
876 -- modified if necessary to contain the correct value after resolution).
877 -- Note that this field overlaps Associated_Node, which is used during
878 -- generic processing (see Sem_Ch12 for details). Note also that in
879 -- generic templates, this means that the Entity field does not always
880 -- point to an Entity. Since the back end is expected to ignore
881 -- generic templates, this is harmless.
883 -- Entity_Or_Associated_Node (Node4-Sem)
884 -- A synonym for both Entity and Associated_Node. Used by convention
885 -- in the code when referencing this field in cases where it is not
886 -- known whether the field contains an Entity or an Associated_Node.
889 -- Appears in all expression nodes, all direct names, and all
890 -- entities. Points to the entity for the related type. Set after
891 -- type resolution. Normally this is the actual subtype of the
892 -- expression. However, in certain contexts such as the right side
893 -- of an assignment, subscripts, arguments to calls, returned value
894 -- in a function, initial value etc. it is the desired target type.
895 -- In the event that this is different from the actual type, the
896 -- Do_Range_Check flag will be set if a range check is required.
897 -- Note: if the Is_Overloaded flag is set, then Etype points to
898 -- an essentially arbitrary choice from the possible set of types.
900 -- Exception_Junk (Flag7-Sem)
901 -- This flag is set in a various nodes appearing in a statement
902 -- sequence to indicate that the corresponding node is an artifact
903 -- of the generated code for exception handling, and should be
904 -- ignored when analyzing the control flow of the relevant sequence
905 -- of statements (e.g. to check that it does not end with a bad
906 -- return statement).
908 -- Expansion_Delayed (Flag11-Sem)
909 -- Set on aggregates and extension aggregates that need a top-down
910 -- rather than bottom up expansion. Typically aggregate expansion
911 -- happens bottom up. For nested aggregates the expansion is delayed
912 -- until the enclosing aggregate itself is expanded, e.g. in the context
913 -- of a declaration. To delay it we set this flag. This is done to
914 -- avoid creating a temporary for each level of a nested aggregates,
915 -- and also to prevent the premature generation of constraint checks.
916 -- This is also a requirement if we want to generate the proper
917 -- attachment to the internal finalization lists (for record with
918 -- controlled components). Top down expansion of aggregates is also
919 -- used for in-place array aggregate assignment or initialization.
920 -- When the full context is known, the target of the assignment or
921 -- initialization is used to generate the left-hand side of individual
922 -- assignment to each sub-component.
924 -- First_Inlined_Subprogram (Node3-Sem)
925 -- Present in the N_Compilation_Unit node for the main program. Points
926 -- to a chain of entities for subprograms that are to be inlined. The
927 -- Next_Inlined_Subprogram field of these entities is used as a link
928 -- pointer with Empty marking the end of the list. This field is Empty
929 -- if there are no inlined subprograms or inlining is not active.
931 -- First_Named_Actual (Node4-Sem)
932 -- Present in procedure call statement and function call nodes, and
933 -- also in Intrinsic nodes. Set during semantic analysis to point to
934 -- the first named parameter where parameters are ordered by declaration
935 -- order (as opposed to the actual order in the call which may be
936 -- different due to named associations). Note: this field points to the
937 -- explicit actual parameter itself, not the N_Parameter_Association
938 -- node (its parent).
940 -- First_Real_Statement (Node2-Sem)
941 -- Present in N_Handled_Sequence_Of_Statements node. Normally set to
942 -- Empty. Used only when declarations are moved into the statement
943 -- part of a construct as a result of wrapping an AT END handler that
944 -- is required to cover the declarations. In this case, this field is
945 -- used to remember the location in the statements list of the first
946 -- real statement, i.e. the statement that used to be first in the
947 -- statement list before the declarations were prepended.
949 -- First_Subtype_Link (Node5-Sem)
950 -- Present in N_Freeze_Entity node for an anonymous base type that
951 -- is implicitly created by the declaration of a first subtype. It
952 -- points to the entity for the first subtype.
954 -- Float_Truncate (Flag11-Sem)
955 -- A flag present in type conversion nodes. This is used for float
956 -- to integer conversions where truncation is required rather than
957 -- rounding. Note that Gigi does not handle type conversions from real
958 -- to integer with rounding (see Expand_N_Type_Conversion).
960 -- Forwards_OK (Flag5-Sem)
961 -- A flag present in the N_Assignment_Statement node. It is used only
962 -- if the type being assigned is an array type, and is set if analysis
963 -- determines that it is definitely safe to do the copy forwards, i.e.
964 -- starting at the lowest addressed element. Note that if neither of
965 -- the flags Forwards_OK or Backwards_OK is set, it means that the
966 -- front end could not determine that either direction is definitely
967 -- safe, and a runtime check is required.
969 -- From_At_Mod (Flag4-Sem)
970 -- This flag is set on the attribute definition clause node that is
971 -- generated by a transformation of an at mod phrase in a record
972 -- representation clause. This is used to give slightly different
973 -- (Ada 83 compatible) semantics to such a clause, namely it is
974 -- used to specify a minimum acceptable alignment for the base type
975 -- and all subtypes. In Ada 95 terms, the actual alignment of the
976 -- base type and all subtypes must be a multiple of the given value,
977 -- and the representation clause is considered to be type specific
978 -- instead of subtype specific.
980 -- From_Default (Flag6-Sem)
981 -- This flag is set on the subprogram renaming declaration created in
982 -- an instance for a formal subprogram, when the formal is declared
983 -- with a box, and there is no explicit actual. If the flag is present,
984 -- the declaration is treated as an implicit reference to the formal in
987 -- Generic_Parent (Node5-Sem)
988 -- Generic_parent is defined on declaration nodes that are instances.
989 -- The value of Generic_Parent is the generic entity from which the
990 -- instance is obtained. Generic_Parent is also defined for the renaming
991 -- declarations and object declarations created for the actuals in an
992 -- instantiation. The generic parent of such a declaration is the
993 -- corresponding generic association in the Instantiation node.
995 -- Generic_Parent_Type (Node4-Sem)
996 -- Generic_Parent_Type is defined on Subtype_Declaration nodes for
997 -- the actuals of formal private and derived types. Within the instance,
998 -- the operations on the actual are those inherited from the parent.
999 -- For a formal private type, the parent type is the generic type
1000 -- itself. The Generic_Parent_Type is also used in an instance to
1001 -- determine whether a private operation overrides an inherited one.
1003 -- Handler_List_Entry (Node2-Sem)
1004 -- This field is present in N_Object_Declaration nodes. It is set only
1005 -- for the Handler_Record entry generated for an exception in zero cost
1006 -- exception handling mode. It references the corresponding item in the
1007 -- handler list, and is used to delete this entry if the corresponding
1008 -- handler is deleted during optimization. For further details on why
1009 -- this is required, see Exp_Ch11.Remove_Handler_Entries.
1011 -- Has_Dynamic_Length_Check (Flag10-Sem)
1012 -- This flag is present on all nodes. It is set to indicate that one
1013 -- of the routines in unit Checks has generated a length check action
1014 -- which has been inserted at the flagged node. This is used to avoid
1015 -- the generation of duplicate checks.
1017 -- Has_Dynamic_Range_Check (Flag12-Sem)
1018 -- This flag is present on all nodes. It is set to indicate that one
1019 -- of the routines in unit Checks has generated a range check action
1020 -- which has been inserted at the flagged node. This is used to avoid
1021 -- the generation of duplicate checks.
1023 -- Has_No_Elaboration_Code (Flag17-Sem)
1024 -- A flag that appears in the N_Compilation_Unit node to indicate
1025 -- whether or not elaboration code is present for this unit. It is
1026 -- initially set true for subprogram specs and bodies and for all
1027 -- generic units and false for non-generic package specs and bodies.
1028 -- Gigi may set the flag in the non-generic package case if it
1029 -- determines that no elaboration code is generated. Note that this
1030 -- flag is not related to the Is_Preelaborated status, there can be
1031 -- preelaborated packages that generate elaboration code, and non-
1032 -- preelaborated packages which do not generate elaboration code.
1034 -- Has_Priority_Pragma (Flag6-Sem)
1035 -- A flag present in N_Subprogram_Body, N_Task_Definition and
1036 -- N_Protected_Definition nodes to flag the presence of either
1037 -- a Priority or Interrupt_Priority pragma in the declaration
1038 -- sequence (public or private in the task and protected cases)
1040 -- Has_Private_View (Flag11-Sem)
1041 -- A flag present in generic nodes that have an entity, to indicate
1042 -- that the node has a private type. Used to exchange private
1043 -- and full declarations if the visibility at instantiation is
1044 -- different from the visibility at generic definition.
1046 -- Has_Storage_Size_Pragma (Flag5-Sem)
1047 -- A flag present in an N_Task_Definition node to flag the presence
1048 -- of a Storage_Size pragma
1050 -- Has_Task_Info_Pragma (Flag7-Sem)
1051 -- A flag present in an N_Task_Definition node to flag the presence
1052 -- of a Task_Info pragma. Used to detect duplicate pragmas.
1054 -- Has_Task_Name_Pragma (Flag8-Sem)
1055 -- A flag present in N_Task_Definition nodes to flag the presence
1056 -- of a Task_Name pragma in the declaration sequence for the task.
1058 -- Has_Wide_Character (Flag11-Sem)
1059 -- Present in string literals, set if any wide character (i.e. a
1060 -- character code outside the Character range) appears in the string.
1062 -- Hidden_By_Use_Clause (Elist4-Sem)
1063 -- An entity list present in use clauses that appear within
1064 -- instantiations. For the resolution of local entities, entities
1065 -- introduced by these use clauses have priority over global ones,
1066 -- and outer entities must be explicitly hidden/restored on exit.
1068 -- Implicit_With (Flag16-Sem)
1069 -- This flag is set in the N_With_Clause node that is implicitly
1070 -- generated for runtime units that are loaded by the expander, and
1071 -- also for package System, if it is loaded implicitly by a use of
1072 -- the 'Address or 'Tag attribute
1074 -- Includes_Infinities (Flag11-Sem)
1075 -- This flag is present in N_Range nodes. It is set for the range
1076 -- of unconstrained float types defined in Standard, which include
1077 -- not only the given range of values, but also legtitimately can
1078 -- include infinite values. This flag is false for any float type
1079 -- for which an explicit range is given by the programmer, even if
1080 -- that range is identical to the range for float.
1082 -- Instance_Spec (Node5-Sem)
1083 -- This field is present in generic instantiation nodes, and also in
1084 -- formal package declaration nodes (formal package declarations are
1085 -- treated in a manner very similar to package instantiations). It
1086 -- points to the node for the spec of the instance, inserted as part
1087 -- of the semantic processing for instantiations in Sem_Ch12.
1089 -- Is_Asynchronous_Call_Block (Flag7-Sem)
1090 -- A flag set in a Block_Statement node to indicate that it is the
1091 -- expansion of an asynchronous entry call. Such a block needs a
1092 -- cleanup handler to assure that the call is cancelled.
1094 -- Is_Component_Left_Opnd (Flag13-Sem)
1095 -- Is_Component_Right_Opnd (Flag14-Sem)
1096 -- Present in concatenation nodes, to indicate that the corresponding
1097 -- operand is of the component type of the result. Used in resolving
1098 -- concatenation nodes in instances.
1100 -- Is_Controlling_Actual (Flag16-Sem)
1101 -- This flag is set on in an expression that is a controlling argument
1102 -- in a dispatching call. It is off in all other cases. See Sem_Disp
1103 -- for details of its use.
1105 -- Is_In_Discriminant_Check (Flag11-Sem)
1106 -- This flag is present in a selected component, and is used to
1107 -- indicate that the reference occurs within a discriminant check.
1108 -- The significance is that optimizations based on assuming that
1109 -- the discriminant check has a correct value cannot be performed
1110 -- in this case (or the disriminant check may be optimized away!)
1112 -- Is_Machine_Number (Flag11-Sem)
1113 -- This flag is set in an N_Real_Literal node to indicate that the
1114 -- value is a machine number. This avoids some unnecessary cases
1115 -- of converting real literals to machine numbers.
1117 -- Is_Null_Loop (Flag16-Sem)
1118 -- This flag is set in an N_Loop_Statement node if the corresponding
1119 -- loop can be determined to be null at compile time. This is used to
1120 -- suppress any warnings that would otherwise be issued inside the
1121 -- loop since they are probably not useful.
1123 -- Is_Power_Of_2_For_Shift (Flag13-Sem)
1124 -- A flag present only in N_Op_Expon nodes. It is set when the
1125 -- exponentiation is of the forma 2 ** N, where the type of N is
1126 -- an unsigned integral subtype whose size does not exceed the size
1127 -- of Standard_Integer (i.e. a type that can be safely converted to
1128 -- Natural), and the exponentiation appears as the right operand of
1129 -- an integer multiplication or an integer division where the dividend
1130 -- is unsigned. It is also required that overflow checking is off for
1131 -- both the exponentiation and the multiply/divide node. If this set
1132 -- of conditions holds, and the flag is set, then the division or
1133 -- multiplication can be (and is) converted to a shift.
1135 -- Is_Overloaded (Flag5-Sem)
1136 -- A flag present in all expression nodes. Used temporarily during
1137 -- overloading determination. The setting of this flag is not
1138 -- relevant once overloading analysis is complete.
1140 -- Is_Protected_Subprogram_Body (Flag7-Sem)
1141 -- A flag set in a Subprogram_Body block to indicate that it is the
1142 -- implemenation of a protected subprogram. Such a body needs a
1143 -- cleanup handler to make sure that the associated protected object
1144 -- is unlocked when the subprogram completes.
1146 -- Is_Static_Expression (Flag6-Sem)
1147 -- Indicates that an expression is a static expression (RM 4.9). See
1148 -- spec of package Sem_Eval for full details on the use of this flag.
1150 -- Is_Subprogram_Descriptor (Flag16-Sem)
1151 -- Present in N_Object_Declaration, and set only for the object
1152 -- declaration generated for a subprogram descriptor in fast exception
1153 -- mode. See Exp_Ch11 for details of use.
1155 -- Is_Task_Allocation_Block (Flag6-Sem)
1156 -- A flag set in a Block_Statement node to indicate that it is the
1157 -- expansion of a task allocator, or the allocator of an object
1158 -- containing tasks. Such a block requires a cleanup handler to call
1159 -- Expunge_Unactivted_Tasks to complete any tasks that have been
1160 -- allocated but not activated when the allocator completes abnormally.
1162 -- Is_Task_Master (Flag5-Sem)
1163 -- A flag set in a Subprogram_Body, Block_Statement or Task_Body node
1164 -- to indicate that the construct is a task master (i.e. has declared
1165 -- tasks or declares an access to a task type).
1167 -- Itype (Node1-Sem)
1168 -- Used in N_Itype_Reference node to reference an itype for which it
1169 -- is important to ensure that it is defined. See description of this
1170 -- node for further details.
1172 -- Kill_Range_Check (Flag11-Sem)
1173 -- Used in an N_Unchecked_Type_Conversion node to indicate that the
1174 -- result should not be subjected to range checks. This is used for
1175 -- the implementation of Normalize_Scalars.
1177 -- Label_Construct (Node2-Sem)
1178 -- Used in an N_Implicit_Label_Declaration node. Refers to an N_Label,
1179 -- N_Block_Statement or N_Loop_Statement node to which the label
1180 -- declaration applies. This is not currently used in the compiler
1181 -- itself, but it is useful in the implementation of ASIS queries.
1183 -- Library_Unit (Node4-Sem)
1184 -- In a stub node, the Library_Unit field points to the compilation unit
1185 -- node of the corresponding subunit.
1187 -- In a with clause node, the Library_Unit field points to the spec
1188 -- of the with'ed unit.
1190 -- In a compilation unit node, the use of this field depends on
1193 -- For a subprogram body, the Library_Unit field points to the
1194 -- compilation unit node of the corresponding spec, unless
1195 -- Acts_As_Spec is set, in which case it points to itself.
1197 -- For a package body, the Library_Unit field points to the
1198 -- compilation unit node of the corresponding spec.
1200 -- For a subprogram spec to which pragma Inline applies, the
1201 -- Library_Unit field points to the compilation unit node of
1202 -- the corresponding body, if inlining is active.
1204 -- For a generic declaration, the Library_Unit field points
1205 -- to the compilation unit node of the corresponding generic body.
1207 -- For a subunit, the Library_Unit field points to the compilation
1208 -- unit node of the parent body.
1210 -- Note that this field is not used to hold the parent pointer for a
1211 -- child unit (which might in any case need to use it for some other
1212 -- purpose as described above). Instead for a child unit, implicit
1213 -- with's are generated for all parents.
1215 -- Loop_Actions (List2-Sem)
1216 -- A list present in Component_Association nodes in array aggregates.
1217 -- Used to collect actions that must be executed within the loop because
1218 -- they may need to be evaluated anew each time through.
1220 -- Limited_View_Installed (Flag18-Sem)
1221 -- Present in With_Clauses and in package specifications. If set on a
1222 -- with_clause, it indicates that this clause has created the current
1223 -- limited view of the designated package. On a package specification,
1224 -- it indicates that the limited view has already been created because
1225 -- the package is mentioned in a limited_with_clause in the closure of
1226 -- the unit being compiled.
1228 -- Must_Be_Byte_Aligned (Flag14-Sem)
1229 -- This flag is present in N_Attribute_Reference nodes. It can be set
1230 -- only for the Address and Unrestricted_Access attributes. If set it
1231 -- means that the object for which the address/access is given must be
1232 -- on a byte (more accurately a storage unit) boundary. If necessary,
1233 -- a copy of the object is to be made before taking the address (this
1234 -- copy is in the current scope on the stack frame). This is used for
1235 -- certain cases of code generated by the expander that passes
1236 -- parameters by address.
1238 -- The reason the copy is not made by the front end is that the back
1239 -- end has more information about type layout and may be able to (but
1240 -- is not guaranteed to) prevent making unnecessary copies.
1242 -- Must_Not_Freeze (Flag8-Sem)
1243 -- A flag present in all expression nodes. Normally expressions cause
1244 -- freezing as described in the RM. If this flag is set, then this
1245 -- is inhibited. This is used by the analyzer and expander to label
1246 -- nodes that are created by semantic analysis or expansion and which
1247 -- must not cause freezing even though they normally would. This flag
1248 -- is also present in an N_Subtype_Indication node, since we also use
1249 -- these in calls to Freeze_Expression.
1251 -- Next_Entity (Node2-Sem)
1252 -- Present in defining identifiers, defining character literals and
1253 -- defining operator symbols (i.e. in all entities). The entities of
1254 -- a scope are chained, and this field is used as the forward pointer
1255 -- for this list. See Einfo for further details.
1257 -- Next_Named_Actual (Node4-Sem)
1258 -- Present in parameter association node. Set during semantic
1259 -- analysis to point to the next named parameter, where parameters
1260 -- are ordered by declaration order (as opposed to the actual order
1261 -- in the call, which may be different due to named associations).
1262 -- Not that this field points to the explicit actual parameter itself,
1263 -- not to the N_Parameter_Association node (its parent).
1265 -- Next_Rep_Item (Node4-Sem)
1266 -- Present in pragma nodes and attribute definition nodes. Used to
1267 -- link representation items that apply to an entity. See description
1268 -- of First_Rep_Item field in Einfo for full details.
1270 -- Next_Use_Clause (Node3-Sem)
1271 -- While use clauses are active during semantic processing, they
1272 -- are chained from the scope stack entry, using Next_Use_Clause
1273 -- as a link pointer, with Empty marking the end of the list. The
1274 -- head pointer is in the scope stack entry (First_Use_Clause). At
1275 -- the end of semantic processing (i.e. when Gigi sees the tree,
1276 -- the contents of this field is undefined and should not be read).
1278 -- No_Ctrl_Actions (Flag7-Sem)
1279 -- Present in N_Assignment_Statement to indicate that no finalize nor
1280 -- nor adjust should take place on this assignment eventhough the rhs
1281 -- is controlled. This is used in init procs and aggregate expansions
1282 -- where the generated assignments are more initialisations than real
1285 -- No_Elaboration_Check (Flag14-Sem)
1286 -- Present in N_Function_Call and N_Procedure_Call_Statement. Indicates
1287 -- that no elaboration check is needed on the call, because it appears
1288 -- in the context of a local Suppress pragma. This is used on calls
1289 -- within task bodies, where the actual elaboration checks are applied
1290 -- after analysis, when the local scope stack is not present.
1292 -- No_Entities_Ref_In_Spec (Flag8-Sem)
1293 -- Present in N_With_Clause nodes. Set if the with clause is on the
1294 -- package or subprogram spec where the main unit is the corresponding
1295 -- body, and no entities of the with'ed unit are referenced by the spec
1296 -- (an entity may still be referenced in the body, so this flag is used
1297 -- to generate the proper message (see Sem_Util.Check_Unused_Withs for
1300 -- No_Initialization (Flag13-Sem)
1301 -- Present in N_Object_Declaration & N_Allocator to indicate
1302 -- that the object must not be initialized (by Initialize or a
1303 -- call to an init proc). This is needed for controlled aggregates.
1304 -- When the Object declaration has an expression, this flag means
1305 -- that this expression should not be taken into account (needed
1306 -- for in place initialization with aggregates)
1308 -- No_Truncation (Flag17-Sem)
1309 -- Present in N_Unchecked_Type_Conversion node. This flag has an effect
1310 -- only if the RM_Size of the source is greater than the RM_Size of the
1311 -- target for scalar operands. Normally in such a case we truncate some
1312 -- higher order bits of the source, and then sign/zero extend the result
1313 -- to form the output value. But if this flag is set, then we do not do
1314 -- any truncation, so for example, if an 8 bit input is converted to a
1315 -- 5 bit result which is in fact stored in 8 bits, then the high order
1316 -- three bits of the target result will be copied from the source. This
1317 -- is used for properly setting out of range values for use by pragmas
1318 -- Initialize_Scalars and Normalize_Scalars.
1320 -- Original_Discriminant (Node2-Sem)
1321 -- Present in identifiers. Used in references to discriminants that
1322 -- appear in generic units. Because the names of the discriminants
1323 -- may be different in an instance, we use this field to recover the
1324 -- position of the discriminant in the original type, and replace it
1325 -- with the discriminant at the same position in the instantiated type.
1327 -- Original_Entity (Node2-Sem)
1328 -- Present in numeric literals. Used to denote the named number that
1329 -- has been constant-folded into the given literal. If literal is from
1330 -- source, or the result of some other constant-folding operation, then
1331 -- Original_Entity is empty. This field is needed to handle properly
1332 -- named numbers in generic units, where the Associated_Node field
1333 -- interferes with the Entity field, making it impossible to preserve
1334 -- the original entity at the point of instantiation (ASIS problem).
1336 -- Others_Discrete_Choices (List1-Sem)
1337 -- When a case statement or variant is analyzed, the semantic checks
1338 -- determine the actual list of choices that correspond to an others
1339 -- choice. This list is materialized for later use by the expander
1340 -- and the Others_Discrete_Choices field of an N_Others_Choice node
1341 -- points to this materialized list of choices, which is in standard
1342 -- format for a list of discrete choices, except that of course it
1343 -- cannot contain an N_Others_Choice entry.
1345 -- Parameter_List_Truncated (Flag17-Sem)
1346 -- Present in N_Function_Call and N_Procedure_Call_Statement nodes.
1347 -- Set (for OpenVMS ports of GNAT only) if the parameter list is
1348 -- truncated as a result of a First_Optional_Parameter specification
1349 -- in an Import_Function, Import_Procedure, or Import_Valued_Procedure
1350 -- pragma. The truncation is done by the expander by removing trailing
1351 -- parameters from the argument list, in accordance with the set of
1352 -- rules allowing such parameter removal. In particular, parameters
1353 -- can be removed working from the end of the parameter list backwards
1354 -- up to and including the entry designated by First_Optional_Parameter
1355 -- in the Import pragma. Parameters can be removed if they are implicit
1356 -- and the default value is a known-at-compile-time value, including
1357 -- the use of the Null_Parameter attribute, or if explicit parameter
1358 -- values are present that match the corresponding defaults.
1360 -- Parent_Spec (Node4-Sem)
1361 -- For a library unit that is a child unit spec (package or subprogram
1362 -- declaration, generic declaration or instantiation, or library level
1363 -- rename, this field points to the compilation unit node for the parent
1364 -- package specification. This field is Empty for library bodies (the
1365 -- parent spec in this case can be found from the corresponding spec).
1367 -- Present_Expr (Uint3-Sem)
1368 -- Present in an N_Variant node. This has a meaningful value only after
1369 -- Gigi has back annotated the tree with representation information.
1370 -- At this point, it contains a reference to a gcc expression that
1371 -- depends on the values of one or more discriminants. Give a set of
1372 -- discriminant values, this expression evaluates to False (zero) if
1373 -- variant is not present, and True (non-zero) if it is present. See
1374 -- unit Repinfo for further details on gigi back annotation. This
1375 -- field is used during ASIS processing (data decomposition annex)
1376 -- to determine if a field is present or not.
1378 -- Print_In_Hex (Flag13-Sem)
1379 -- Set on an N_Integer_Literal node to indicate that the value should
1380 -- be printed in hexadecimal in the sprint listing. Has no effect on
1381 -- legality or semantics of program, only on the displayed output.
1382 -- This is used to clarify output from the packed array cases.
1384 -- Procedure_To_Call (Node4-Sem)
1385 -- Present in N_Allocator, N_Free_Statement, and N_Return_Statement
1386 -- nodes. References the entity for the declaration of the procedure
1387 -- to be called to accomplish the required operation (i.e. for the
1388 -- Allocate procedure in the case of N_Allocator and N_Return_Statement
1389 -- (for allocating the return value), and for the Deallocate procedure
1390 -- in the case of N_Free_Statement.
1392 -- Raises_Constraint_Error (Flag7-Sem)
1393 -- Set on an expression whose evaluation will definitely fail a
1394 -- constraint error check. In the case of static expressions, this
1395 -- flag must be set accurately (and if it is set, the expression is
1396 -- typically illegal unless it appears as a non-elaborated branch of
1397 -- a short-circuit form). For a non-static expression, this flag may
1398 -- be set whenever an expression (e.g. an aggregate) is known to raise
1399 -- constraint error. If set, the expression definitely will raise CE
1400 -- if elaborated at runtime. If not set, the expression may or may
1401 -- not raise CE. In other words, on static expressions, the flag is
1402 -- set accurately, on non-static expressions it is set conservatively.
1404 -- Redundant_Use (Flag13-Sem)
1405 -- A flag present in nodes that can appear as an operand in a use
1406 -- clause or use type clause (identifiers, expanded names, attribute
1407 -- references). Set to indicate that a use is redundant (and therefore
1408 -- need not be undone on scope exit).
1410 -- Return_Type (Node2-Sem)
1411 -- Present in N_Return_Statement node. For a procedure, this is set
1412 -- to Standard_Void_Type. For a function it references the entity
1413 -- for the returned type.
1415 -- Rounded_Result (Flag18-Sem)
1416 -- Present in N_Type_Conversion, N_Op_Divide and N_Op_Multiply nodes.
1417 -- Used in the fixed-point cases to indicate that the result must be
1418 -- rounded as a result of the use of the 'Round attribute. Also used
1419 -- for integer N_Op_Divide nodes to indicate that the result should
1420 -- be rounded to the nearest integer (breaking ties away from zero),
1421 -- rather than truncated towards zero as usual. These rounded integer
1422 -- operations are the result of expansion of rounded fixed-point
1423 -- divide, conversion and multiplication operations.
1425 -- Scope (Node3-Sem)
1426 -- Present in defining identifiers, defining character literals and
1427 -- defining operator symbols (i.e. in all entities). The entities of
1428 -- a scope all use this field to reference the corresponding scope
1429 -- entity. See Einfo for further details.
1431 -- Shift_Count_OK (Flag4-Sem)
1432 -- A flag present in shift nodes to indicate that the shift count is
1433 -- known to be in range, i.e. is in the range from zero to word length
1434 -- minus one. If this flag is not set, then the shift count may be
1435 -- outside this range, i.e. larger than the word length, and the code
1436 -- must ensure that such shift counts give the appropriate result.
1438 -- Source_Type (Node1-Sem)
1439 -- Used in an N_Validate_Unchecked_Conversion node to point to the
1440 -- source type entity for the unchecked conversion instantiation
1441 -- which gigi must do size validation for.
1443 -- Static_Processing_OK (Flag4-Sem)
1444 -- Present in N_Aggregate nodes. When the Compile_Time_Known_Aggregate
1445 -- flag is set, the full value of the aggregate can be determined at
1446 -- compile time and the aggregate can be passed as is to the back-end.
1447 -- In this event it is irrelevant whether this flag is set or not.
1448 -- However, if the Compile_Time_Known_Aggregate flag is not set but
1449 -- Static_Processing_OK is set, the aggregate can (but need not) be
1450 -- converted into a compile time known aggregate by the expander.
1451 -- See Sem_Aggr for the specific conditions under which an aggregate
1452 -- has its Static_Processing_OK flag set.
1454 -- Storage_Pool (Node1-Sem)
1455 -- Present in N_Allocator, N_Free_Statement and N_Return_Statement
1456 -- nodes. References the entity for the storage pool to be used for
1457 -- the allocate or free call or for the allocation of the returned
1458 -- value from a function. Empty indicates that the global default
1459 -- default pool is to be used. Note that in the case of a return
1460 -- statement, this field is set only if the function returns a
1461 -- value of a type whose size is not known at compile time on the
1462 -- secondary stack. It is never set on targets for which the target
1463 -- parameter Targparm.Functions_Return_By_DSP_On_Target is True.
1465 -- Target_Type (Node2-Sem)
1466 -- Used in an N_Validate_Unchecked_Conversion node to point to the
1467 -- target type entity for the unchecked conversion instantiation
1468 -- which gigi must do size validation for.
1470 -- Then_Actions (List3-Sem)
1471 -- This field is present in conditional expression nodes. During code
1472 -- expansion we use the Insert_Actions procedure (in Exp_Util) to insert
1473 -- actions at an appropriate place in the tree to get elaborated at the
1474 -- right time. For conditional expressions, we have to be sure that the
1475 -- actions for the Then branch are only elaborated if the condition is
1476 -- True. The Then_Actions field is used as a temporary parking place
1477 -- for these actions. The final tree is always rewritten to eliminate
1478 -- the need for this field, so in the tree passed to Gigi, this field
1479 -- is always set to No_List.
1481 -- Treat_Fixed_As_Integer (Flag14-Sem)
1482 -- This flag appears in operator nodes for divide, multiply, mod and
1483 -- rem on fixed-point operands. It indicates that the operands are
1484 -- to be treated as integer values, ignoring small values. This flag
1485 -- is only set as a result of expansion of fixed-point operations.
1486 -- Typically a fixed-point multplication in the source generates
1487 -- subsidiary multiplication and division operations that work with
1488 -- the underlying integer values and have this flag set. Note that
1489 -- this flag is not needed on other arithmetic operations (add, neg,
1490 -- subtract etc) since in these cases it is always the case that fixed
1491 -- is treated as integer. The Etype field MUST be set if this flag
1492 -- is set. The analyzer knows to leave such nodes alone, and whoever
1493 -- makes them must set the correct Etype value.
1495 -- TSS_Elist (Elist3-Sem)
1496 -- Present in N_Freeze_Entity nodes. Holds an element list containing
1497 -- entries for each TSS (type support subprogram) associated with the
1498 -- frozen type. The elements of the list are the entities for the
1499 -- subprograms (see package Exp_TSS for further details). Set to
1500 -- No_Elist if there are no type support subprograms for the type
1501 -- or if the freeze node is not for a type.
1503 -- Unreferenced_In_Spec (Flag7-Sem)
1504 -- Present in N_With_Clause nodes. Set if the with clause is on the
1505 -- package or subprogram spec where the main unit is the corresponding
1506 -- body, and is not referenced by the spec (it may still be referenced
1507 -- by the body, so this flag is used to generate the proper message
1508 -- (see Sem_Util.Check_Unused_Withs for details)
1510 -- Was_Originally_Stub (Flag13-Sem)
1511 -- This flag is set in the node for a proper body that replaces a
1512 -- stub. During the analysis procedure, stubs in some situations
1513 -- get rewritten by the corresponding bodies, and we set this flag
1514 -- to remember that this happened. Note that it is not good enough
1515 -- to rely on the use of Original_Node here because of the case of
1516 -- nested instantiations where the substituted node can be copied.
1518 -- Zero_Cost_Handling (Flag5-Sem)
1519 -- This flag is set in all handled sequence of statement and exception
1520 -- handler nodes if eceptions are to be handled using the zero-cost
1521 -- mechanism (see Ada.Exceptions and System.Exceptions in files
1522 -- a-except.ads/adb and s-except.ads for full details). What gigi
1523 -- needs to do for such a handler is simply to put the code in the
1524 -- handler somewhere. The front end has generated all necessary labels.
1526 --------------------------------------------------
1527 -- Note on Use of End_Label and End_Span Fields --
1528 --------------------------------------------------
1530 -- Several constructs have end lines:
1532 -- Loop Statement end loop [loop_IDENTIFIER];
1533 -- Package Specification end [[PARENT_UNIT_NAME .] IDENTIFIER]
1534 -- Task Definition end [task_IDENTIFIER]
1535 -- Protected Definition end [protected_IDENTIFIER]
1536 -- Protected Body end [protected_IDENTIFIER]
1538 -- Block Statement end [block_IDENTIFIER];
1539 -- Subprogram Body end [DESIGNATOR];
1540 -- Package Body end [[PARENT_UNIT_NAME .] IDENTIFIER];
1541 -- Task Body end [task_IDENTIFIER];
1542 -- Accept Statement end [entry_IDENTIFIER]];
1543 -- Entry Body end [entry_IDENTIFIER];
1545 -- If Statement end if;
1546 -- Case Statement end case;
1548 -- Record Definition end record;
1549 -- Enumeration Definition );
1551 -- The End_Label and End_Span fields are used to mark the locations
1552 -- of these lines, and also keep track of the label in the case where
1553 -- a label is present.
1555 -- For the first group above, the End_Label field of the corresponding
1556 -- node is used to point to the label identifier. In the case where
1557 -- there is no label in the source, the parser supplies a dummy
1558 -- identifier (with Comes_From_Source set to False), and the Sloc
1559 -- of this dummy identifier marks the location of the token following
1562 -- For the second group, the use of End_Label is similar, but the
1563 -- End_Label is found in the N_Handled_Sequence_Of_Statements node.
1564 -- This is done simply because in some cases there is no room in
1567 -- For the third group, there is never any label, and instead of
1568 -- using End_Label, we use the End_Span field which gives the
1569 -- location of the token following END, relative to the starting
1570 -- Sloc of the construct, i.e. add Sloc (Node) + End_Span (Node)
1571 -- to get the Sloc of the IF or CASE following the End_Label.
1573 -- The record definition case is handled specially, we treat it
1574 -- as though it required an optional label which is never present,
1575 -- and so the parser always builds a dummy identifier with Comes
1576 -- From Source set False. The reason we do this, rather than using
1577 -- End_Span in this case, is that we want to generate a cross-ref
1578 -- entry for the end of a record, since it represents a scope for
1579 -- name declaration purposes.
1581 -- The enumeration definition case is handled in an exactly similar
1582 -- manner, building a dummy identifier to get a cross-reference.
1584 -- Note: the reason we store the difference as a Uint, instead of
1585 -- storing the Source_Ptr value directly, is that Source_Ptr values
1586 -- cannot be distinguished from other types of values, and we count
1587 -- on all general use fields being self describing. To make things
1588 -- easier for clients, note that we provide function End_Location,
1589 -- and procedure Set_End_Location to allow access to the logical
1590 -- value (which is the Source_Ptr value for the end token).
1592 ---------------------
1593 -- Syntactic Nodes --
1594 ---------------------
1596 ---------------------
1597 -- 2.3 Identifier --
1598 ---------------------
1600 -- IDENTIFIER ::= IDENTIFIER_LETTER {[UNDERLINE] LETTER_OR_DIGIT}
1601 -- LETTER_OR_DIGIT ::= IDENTIFIER_LETTER | DIGIT
1603 -- An IDENTIFIER shall not be a reserved word
1605 -- In the Ada grammar identifiers are the bottom level tokens which
1606 -- have very few semantics. Actual program identifiers are direct
1607 -- names. If we were being 100% honest with the grammar, then we would
1608 -- have a node called N_Direct_Name which would point to an identifier.
1609 -- However, that's too many extra nodes, so we just use the N_Identifier
1610 -- node directly as a direct name, and it contains the expression fields
1611 -- and Entity field that correspond to its use as a direct name. In
1612 -- those few cases where identifiers appear in contexts where they are
1613 -- not direct names (pragmas, pragma argument associations, attribute
1614 -- references and attribute definition clauses), the Chars field of the
1615 -- node contains the Name_Id for the identifier name.
1617 -- Note: in GNAT, a reserved word can be treated as an identifier
1618 -- in two cases. First, an incorrect use of a reserved word as an
1619 -- identifier is diagnosed and then treated as a normal identifier.
1620 -- Second, an attribute designator of the form of a reserved word
1621 -- (access, delta, digits, range) is treated as an identifier.
1623 -- Note: The set of letters that is permitted in an identifier depends
1624 -- on the character set in use. See package Csets for full details.
1627 -- Sloc points to identifier
1628 -- Chars (Name1) contains the Name_Id for the identifier
1629 -- Entity (Node4-Sem)
1630 -- Associated_Node (Node4-Sem)
1631 -- Original_Discriminant (Node2-Sem)
1632 -- Redundant_Use (Flag13-Sem)
1633 -- Has_Private_View (Flag11-Sem) (set in generic units)
1634 -- plus fields for expression
1636 --------------------------
1637 -- 2.4 Numeric Literal --
1638 --------------------------
1640 -- NUMERIC_LITERAL ::= DECIMAL_LITERAL | BASED_LITERAL
1642 ----------------------------
1643 -- 2.4.1 Decimal Literal --
1644 ----------------------------
1646 -- DECIMAL_LITERAL ::= NUMERAL [.NUMERAL] [EXPONENT]
1648 -- NUMERAL ::= DIGIT {[UNDERLINE] DIGIT}
1650 -- EXPONENT ::= E [+] NUMERAL | E - NUMERAL
1652 -- Decimal literals appear in the tree as either integer literal nodes
1653 -- or real literal nodes, depending on whether a period is present.
1655 -- Note: literal nodes appear as a result of direct use of literals
1656 -- in the source program, and also as the result of evaluating
1657 -- expressions at compile time. In the latter case, it is possible
1658 -- to construct real literals that have no syntactic representation
1659 -- using the standard literal format. Such literals are listed by
1660 -- Sprint using the notation [numerator / denominator].
1662 -- Note: the value of an integer literal node created by the front end
1663 -- is never outside the range of values of the base type. However, it
1664 -- can be the case that the value is outside the range of the
1665 -- particular subtype. This happens in the case of integer overflows
1666 -- with checks suppressed.
1668 -- N_Integer_Literal
1669 -- Sloc points to literal
1670 -- Original_Entity (Node2-Sem) If not Empty, holds Named_Number that
1671 -- has been constant-folded into its literal value.
1672 -- Intval (Uint3) contains integer value of literal
1673 -- plus fields for expression
1674 -- Print_In_Hex (Flag13-Sem)
1677 -- Sloc points to literal
1678 -- Original_Entity (Node2-Sem) If not Empty, holds Named_Number that
1679 -- has been constant-folded into its literal value.
1680 -- Realval (Ureal3) contains real value of literal
1681 -- Corresponding_Integer_Value (Uint4-Sem)
1682 -- Is_Machine_Number (Flag11-Sem)
1683 -- plus fields for expression
1685 --------------------------
1686 -- 2.4.2 Based Literal --
1687 --------------------------
1689 -- BASED_LITERAL ::=
1690 -- BASE # BASED_NUMERAL [.BASED_NUMERAL] # [EXPONENT]
1694 -- BASED_NUMERAL ::=
1695 -- EXTENDED_DIGIT {[UNDERLINE] EXTENDED_DIGIT}
1697 -- EXTENDED_DIGIT ::= DIGIT | A | B | C | D | E | F
1699 -- Based literals appear in the tree as either integer literal nodes
1700 -- or real literal nodes, depending on whether a period is present.
1702 ----------------------------
1703 -- 2.5 Character Literal --
1704 ----------------------------
1706 -- CHARACTER_LITERAL ::= ' GRAPHIC_CHARACTER '
1708 -- N_Character_Literal
1709 -- Sloc points to literal
1710 -- Chars (Name1) contains the Name_Id for the identifier
1711 -- Char_Literal_Value (Uint2) contains the literal value
1712 -- Entity (Node4-Sem)
1713 -- Associated_Node (Node4-Sem)
1714 -- Has_Private_View (Flag11-Sem) set in generic units.
1715 -- plus fields for expression
1717 -- Note: the Entity field will be missing (and set to Empty) for
1718 -- character literals whose type is Standard.Wide_Character or
1719 -- Standard.Character or a type derived from one of these two.
1720 -- In this case the character literal stands for its own coding.
1721 -- The reason we take this irregular short cut is to avoid the
1722 -- need to build lots of junk defining character literal nodes.
1724 -------------------------
1725 -- 2.6 String Literal --
1726 -------------------------
1728 -- STRING LITERAL ::= "{STRING_ELEMENT}"
1730 -- A STRING_ELEMENT is either a pair of quotation marks ("), or a
1731 -- single GRAPHIC_CHARACTER other than a quotation mark.
1734 -- Sloc points to literal
1735 -- Strval (Str3) contains Id of string value
1736 -- Has_Wide_Character (Flag11-Sem)
1737 -- plus fields for expression
1743 -- A COMMENT starts with two adjacent hyphens and extends up to the
1744 -- end of the line. A COMMENT may appear on any line of a program.
1746 -- Comments are skipped by the scanner and do not appear in the tree.
1747 -- It is possible to reconstruct the position of comments with respect
1748 -- to the elements of the tree by using the source position (Sloc)
1749 -- pointers that appear in every tree node.
1755 -- PRAGMA ::= pragma IDENTIFIER
1756 -- [(PRAGMA_ARGUMENT_ASSOCIATION {, PRAGMA_ARGUMENT_ASSOCIATION})];
1758 -- Note that a pragma may appear in the tree anywhere a declaration
1759 -- or a statement may appear, as well as in some other situations
1760 -- which are explicitly documented.
1763 -- Sloc points to PRAGMA
1764 -- Chars (Name1) identifier name from pragma identifier
1765 -- Pragma_Argument_Associations (List2) (set to No_List if none)
1766 -- Debug_Statement (Node3) (set to Empty if not Debug, Assert)
1767 -- Next_Rep_Item (Node4-Sem)
1769 -- Note: we should have a section on what pragmas are passed on to
1770 -- the back end to be processed. This section should note that pragma
1771 -- Psect_Object is always converted to Common_Object, but there are
1772 -- undoubtedly many other similar notes required ???
1774 --------------------------------------
1775 -- 2.8 Pragma Argument Association --
1776 --------------------------------------
1778 -- PRAGMA_ARGUMENT_ASSOCIATION ::=
1779 -- [pragma_argument_IDENTIFIER =>] NAME
1780 -- | [pragma_argument_IDENTIFIER =>] EXPRESSION
1782 -- N_Pragma_Argument_Association
1783 -- Sloc points to first token in association
1784 -- Chars (Name1) (set to No_Name if no pragma argument identifier)
1785 -- Expression (Node3)
1787 ------------------------
1788 -- 2.9 Reserved Word --
1789 ------------------------
1791 -- Reserved words are parsed by the scanner, and returned as the
1792 -- corresponding token types (e.g. PACKAGE is returned as Tok_Package)
1794 ----------------------------
1795 -- 3.1 Basic Declaration --
1796 ----------------------------
1798 -- BASIC_DECLARATION ::=
1799 -- TYPE_DECLARATION | SUBTYPE_DECLARATION
1800 -- | OBJECT_DECLARATION | NUMBER_DECLARATION
1801 -- | SUBPROGRAM_DECLARATION | ABSTRACT_SUBPROGRAM_DECLARATION
1802 -- | PACKAGE_DECLARATION | RENAMING_DECLARATION
1803 -- | EXCEPTION_DECLARATION | GENERIC_DECLARATION
1804 -- | GENERIC_INSTANTIATION
1806 -- Basic declaration also includes IMPLICIT_LABEL_DECLARATION
1807 -- see further description in section on semantic nodes.
1809 -- Also, in the tree that is constructed, a pragma may appear
1810 -- anywhere that a declaration may appear.
1812 ------------------------------
1813 -- 3.1 Defining Identifier --
1814 ------------------------------
1816 -- DEFINING_IDENTIFIER ::= IDENTIFIER
1818 -- A defining identifier is an entity, which has additional fields
1819 -- depending on the setting of the Ekind field. These additional
1820 -- fields are defined (and access subprograms declared) in package
1823 -- Note: N_Defining_Identifier is an extended node whose fields are
1824 -- deliberate layed out to match the layout of fields in an ordinary
1825 -- N_Identifier node allowing for easy alteration of an identifier
1826 -- node into a defining identifier node. For details, see procedure
1827 -- Sinfo.CN.Change_Identifier_To_Defining_Identifier.
1829 -- N_Defining_Identifier
1830 -- Sloc points to identifier
1831 -- Chars (Name1) contains the Name_Id for the identifier
1832 -- Next_Entity (Node2-Sem)
1833 -- Scope (Node3-Sem)
1834 -- Etype (Node5-Sem)
1836 -----------------------------
1837 -- 3.2.1 Type Declaration --
1838 -----------------------------
1840 -- TYPE_DECLARATION ::=
1841 -- FULL_TYPE_DECLARATION
1842 -- | INCOMPLETE_TYPE_DECLARATION
1843 -- | PRIVATE_TYPE_DECLARATION
1844 -- | PRIVATE_EXTENSION_DECLARATION
1846 ----------------------------------
1847 -- 3.2.1 Full Type Declaration --
1848 ----------------------------------
1850 -- FULL_TYPE_DECLARATION ::=
1851 -- type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
1852 -- is TYPE_DEFINITION;
1853 -- | TASK_TYPE_DECLARATION
1854 -- | PROTECTED_TYPE_DECLARATION
1856 -- The full type declaration node is used only for the first case. The
1857 -- second case (concurrent type declaration), is represented directly
1858 -- by a task type declaration or a protected type declaration.
1860 -- N_Full_Type_Declaration
1861 -- Sloc points to TYPE
1862 -- Defining_Identifier (Node1)
1863 -- Discriminant_Specifications (List4) (set to No_List if none)
1864 -- Type_Definition (Node3)
1865 -- Discr_Check_Funcs_Built (Flag11-Sem)
1867 ----------------------------
1868 -- 3.2.1 Type Definition --
1869 ----------------------------
1871 -- TYPE_DEFINITION ::=
1872 -- ENUMERATION_TYPE_DEFINITION | INTEGER_TYPE_DEFINITION
1873 -- | REAL_TYPE_DEFINITION | ARRAY_TYPE_DEFINITION
1874 -- | RECORD_TYPE_DEFINITION | ACCESS_TYPE_DEFINITION
1875 -- | DERIVED_TYPE_DEFINITION | INTERFACE_TYPE_DEFINITION
1877 --------------------------------
1878 -- 3.2.2 Subtype Declaration --
1879 --------------------------------
1881 -- SUBTYPE_DECLARATION ::=
1882 -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION;
1884 -- The subtype indication field is set to Empty for subtypes
1885 -- declared in package Standard (Positive, Natural).
1887 -- N_Subtype_Declaration
1888 -- Sloc points to SUBTYPE
1889 -- Defining_Identifier (Node1)
1890 -- Null_Exclusion_Present (Flag11)
1891 -- Subtype_Indication (Node5)
1892 -- Generic_Parent_Type (Node4-Sem) (set for an actual derived type).
1893 -- Exception_Junk (Flag7-Sem)
1895 -------------------------------
1896 -- 3.2.2 Subtype Indication --
1897 -------------------------------
1899 -- SUBTYPE_INDICATION ::= SUBTYPE_MARK [CONSTRAINT]
1901 -- Note: if no constraint is present, the subtype indication appears
1902 -- directly in the tree as a subtype mark. The N_Subtype_Indication
1903 -- node is used only if a constraint is present.
1905 -- Note: [For Ada 2005 (AI-231)]: Because Ada 2005 extends this rule
1906 -- with the null-exclusion part (see AI-231), we had to introduce a new
1907 -- attribute in all the parents of subtype_indication nodes to indicate
1908 -- if the null-exclusion is present.
1910 -- Note: the reason that this node has expression fields is that a
1911 -- subtype indication can appear as an operand of a membership test.
1913 -- N_Subtype_Indication
1914 -- Sloc points to first token of subtype mark
1915 -- Subtype_Mark (Node4)
1916 -- Constraint (Node3)
1917 -- Etype (Node5-Sem)
1918 -- Must_Not_Freeze (Flag8-Sem)
1920 -- Note: Etype is a copy of the Etype field of the Subtype_Mark. The
1921 -- reason for this redundancy is so that in a list of array index types,
1922 -- the Etype can be uniformly accessed to determine the subscript type.
1923 -- This means that no Itype is constructed for the actual subtype that
1924 -- is created by the subtype indication. If such an Itype is required,
1925 -- it is constructed in the context in which the indication appears.
1927 -------------------------
1928 -- 3.2.2 Subtype Mark --
1929 -------------------------
1931 -- SUBTYPE_MARK ::= subtype_NAME
1933 -----------------------
1934 -- 3.2.2 Constraint --
1935 -----------------------
1937 -- CONSTRAINT ::= SCALAR_CONSTRAINT | COMPOSITE_CONSTRAINT
1939 ------------------------------
1940 -- 3.2.2 Scalar Constraint --
1941 ------------------------------
1943 -- SCALAR_CONSTRAINT ::=
1944 -- RANGE_CONSTRAINT | DIGITS_CONSTRAINT | DELTA_CONSTRAINT
1946 ---------------------------------
1947 -- 3.2.2 Composite Constraint --
1948 ---------------------------------
1950 -- COMPOSITE_CONSTRAINT ::=
1951 -- INDEX_CONSTRAINT | DISCRIMINANT_CONSTRAINT
1953 -------------------------------
1954 -- 3.3.1 Object Declaration --
1955 -------------------------------
1957 -- OBJECT_DECLARATION ::=
1958 -- DEFINING_IDENTIFIER_LIST : [aliased] [constant]
1959 -- [NULL_EXCLUSION] SUBTYPE_INDICATION [:= EXPRESSION];
1960 -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant]
1961 -- ACCESS_DEFINITION [:= EXPRESSION];
1962 -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant]
1963 -- ARRAY_TYPE_DEFINITION [:= EXPRESSION];
1964 -- | SINGLE_TASK_DECLARATION
1965 -- | SINGLE_PROTECTED_DECLARATION
1967 -- Note: aliased is not permitted in Ada 83 mode
1969 -- The N_Object_Declaration node is only for the first two cases.
1970 -- Single task declaration is handled by P_Task (9.1)
1971 -- Single protected declaration is handled by P_protected (9.5)
1973 -- Although the syntax allows multiple identifiers in the list, the
1974 -- semantics is as though successive declarations were given with
1975 -- identical type definition and expression components. To simplify
1976 -- semantic processing, the parser represents a multiple declaration
1977 -- case as a sequence of single declarations, using the More_Ids and
1978 -- Prev_Ids flags to preserve the original source form as described
1979 -- in the section on "Handling of Defining Identifier Lists".
1981 -- Note: if a range check is required for the initialization
1982 -- expression then the Do_Range_Check flag is set in the Expression,
1983 -- with the check being done against the type given by the object
1984 -- definition, which is also the Etype of the defining identifier.
1986 -- Note: the contents of the Expression field must be ignored (i.e.
1987 -- treated as though it were Empty) if No_Initialization is set True.
1989 -- Note: the back end places some restrictions on the form of the
1990 -- Expression field. If the object being declared is Atomic, then
1991 -- the Expression may not have the form of an aggregate (since this
1992 -- might cause the back end to generate separate assignments). It
1993 -- also cannot be a reference to an object marked as a true constant
1994 -- (Is_True_Constant flag set), where the object is itself initalized
1995 -- with an aggregate. If necessary the front end must generate an
1996 -- extra temporary (with Is_True_Constant set False), and initialize
1997 -- this temporary as required (the temporary itself is not atomic).
1999 -- Note: there is not node kind for object definition. Instead, the
2000 -- corresponding field holds a subtype indication, an array type
2001 -- definition, or (Ada 2005, AI-406) an access definition.
2003 -- N_Object_Declaration
2004 -- Sloc points to first identifier
2005 -- Defining_Identifier (Node1)
2006 -- Aliased_Present (Flag4) set if ALIASED appears
2007 -- Constant_Present (Flag17) set if CONSTANT appears
2008 -- Null_Exclusion_Present (Flag11)
2009 -- Object_Definition (Node4) subtype indic./array type def./ access def.
2010 -- Expression (Node3) (set to Empty if not present)
2011 -- Handler_List_Entry (Node2-Sem)
2012 -- Corresponding_Generic_Association (Node5-Sem)
2013 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2014 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2015 -- No_Initialization (Flag13-Sem)
2016 -- Assignment_OK (Flag15-Sem)
2017 -- Exception_Junk (Flag7-Sem)
2018 -- Delay_Finalize_Attach (Flag14-Sem)
2019 -- Is_Subprogram_Descriptor (Flag16-Sem)
2021 -------------------------------------
2022 -- 3.3.1 Defining Identifier List --
2023 -------------------------------------
2025 -- DEFINING_IDENTIFIER_LIST ::=
2026 -- DEFINING_IDENTIFIER {, DEFINING_IDENTIFIER}
2028 -------------------------------
2029 -- 3.3.2 Number Declaration --
2030 -------------------------------
2032 -- NUMBER_DECLARATION ::=
2033 -- DEFINING_IDENTIFIER_LIST : constant := static_EXPRESSION;
2035 -- Although the syntax allows multiple identifiers in the list, the
2036 -- semantics is as though successive declarations were given with
2037 -- identical expressions. To simplify semantic processing, the parser
2038 -- represents a multiple declaration case as a sequence of single
2039 -- declarations, using the More_Ids and Prev_Ids flags to preserve
2040 -- the original source form as described in the section on "Handling
2041 -- of Defining Identifier Lists".
2043 -- N_Number_Declaration
2044 -- Sloc points to first identifier
2045 -- Defining_Identifier (Node1)
2046 -- Expression (Node3)
2047 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2048 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2050 ----------------------------------
2051 -- 3.4 Derived Type Definition --
2052 ----------------------------------
2054 -- DERIVED_TYPE_DEFINITION ::=
2055 -- [abstract] new [NULL_EXCLUSION] parent_SUBTYPE_INDICATION
2056 -- [[and INTERFACE_LIST] RECORD_EXTENSION_PART]
2058 -- Note: ABSTRACT, record extension part not permitted in Ada 83 mode
2060 -- Note: a record extension part is required if ABSTRACT is present
2062 -- N_Derived_Type_Definition
2063 -- Sloc points to NEW
2064 -- Abstract_Present (Flag4)
2065 -- Null_Exclusion_Present (Flag11) (set to False if not present)
2066 -- Subtype_Indication (Node5)
2067 -- Record_Extension_Part (Node3) (set to Empty if not present)
2068 -- Limited_Present (Flag17) set in interfaces
2069 -- Task_Present (Flag5) set in task interfaces
2070 -- Protected_Present (Flag6) set in protected interfaces
2071 -- Synchronized_Present (Flag7) set in interfaces
2072 -- Interface_List (List2) (set to No_List if none)
2073 -- Interface_Present (Flag16) set in abstract interfaces
2075 -- Note: The attributes Limited_Present, Task_Present, Protected_Present
2076 -- Synchronized_Present, Interface_List and Interface_Present are
2077 -- used for abstract interfaces (see comment in the definition
2078 -- of INTERFACE_TYPE_DEFINITION)
2080 ---------------------------
2081 -- 3.5 Range Constraint --
2082 ---------------------------
2084 -- RANGE_CONSTRAINT ::= range RANGE
2086 -- N_Range_Constraint
2087 -- Sloc points to RANGE
2088 -- Range_Expression (Node4)
2095 -- RANGE_ATTRIBUTE_REFERENCE
2096 -- | SIMPLE_EXPRESSION .. SIMPLE_EXPRESSION
2098 -- Note: the case of a range given as a range attribute reference
2099 -- appears directly in the tree as an attribute reference.
2101 -- Note: the field name for a reference to a range is Range_Expression
2102 -- rather than Range, because range is a reserved keyword in Ada!
2104 -- Note: the reason that this node has expression fields is that a
2105 -- range can appear as an operand of a membership test. The Etype
2106 -- field is the type of the range (we do NOT construct an implicit
2107 -- subtype to represent the range exactly).
2110 -- Sloc points to ..
2111 -- Low_Bound (Node1)
2112 -- High_Bound (Node2)
2113 -- Includes_Infinities (Flag11)
2114 -- plus fields for expression
2116 -- Note: if the range appears in a context, such as a subtype
2117 -- declaration, where range checks are required on one or both of
2118 -- the expression fields, then type conversion nodes are inserted
2119 -- to represent the required checks.
2121 ----------------------------------------
2122 -- 3.5.1 Enumeration Type Definition --
2123 ----------------------------------------
2125 -- ENUMERATION_TYPE_DEFINITION ::=
2126 -- (ENUMERATION_LITERAL_SPECIFICATION
2127 -- {, ENUMERATION_LITERAL_SPECIFICATION})
2129 -- Note: the Literals field in the node described below is null for
2130 -- the case of the standard types CHARACTER and WIDE_CHARACTER, for
2131 -- which special processing handles these types as special cases.
2133 -- N_Enumeration_Type_Definition
2134 -- Sloc points to left parenthesis
2135 -- Literals (List1) (Empty for CHARACTER or WIDE_CHARACTER)
2136 -- End_Label (Node4) (set to Empty if internally generated record)
2138 ----------------------------------------------
2139 -- 3.5.1 Enumeration Literal Specification --
2140 ----------------------------------------------
2142 -- ENUMERATION_LITERAL_SPECIFICATION ::=
2143 -- DEFINING_IDENTIFIER | DEFINING_CHARACTER_LITERAL
2145 ---------------------------------------
2146 -- 3.5.1 Defining Character Literal --
2147 ---------------------------------------
2149 -- DEFINING_CHARACTER_LITERAL ::= CHARACTER_LITERAL
2151 -- A defining character literal is an entity, which has additional
2152 -- fields depending on the setting of the Ekind field. These
2153 -- additional fields are defined (and access subprograms declared)
2154 -- in package Einfo.
2156 -- Note: N_Defining_Character_Literal is an extended node whose fields
2157 -- are deliberate layed out to match the layout of fields in an ordinary
2158 -- N_Character_Literal node allowing for easy alteration of a character
2159 -- literal node into a defining character literal node. For details, see
2160 -- Sinfo.CN.Change_Character_Literal_To_Defining_Character_Literal.
2162 -- N_Defining_Character_Literal
2163 -- Sloc points to literal
2164 -- Chars (Name1) contains the Name_Id for the identifier
2165 -- Next_Entity (Node2-Sem)
2166 -- Scope (Node3-Sem)
2167 -- Etype (Node5-Sem)
2169 ------------------------------------
2170 -- 3.5.4 Integer Type Definition --
2171 ------------------------------------
2173 -- Note: there is an error in this rule in the latest version of the
2174 -- grammar, so we have retained the old rule pending clarification.
2176 -- INTEGER_TYPE_DEFINITION ::=
2177 -- SIGNED_INTEGER_TYPE_DEFINITION
2178 -- | MODULAR_TYPE_DEFINITION
2180 -------------------------------------------
2181 -- 3.5.4 Signed Integer Type Definition --
2182 -------------------------------------------
2184 -- SIGNED_INTEGER_TYPE_DEFINITION ::=
2185 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
2187 -- Note: the Low_Bound and High_Bound fields are set to Empty
2188 -- for integer types defined in package Standard.
2190 -- N_Signed_Integer_Type_Definition
2191 -- Sloc points to RANGE
2192 -- Low_Bound (Node1)
2193 -- High_Bound (Node2)
2195 ------------------------------------
2196 -- 3.5.4 Modular Type Definition --
2197 ------------------------------------
2199 -- MODULAR_TYPE_DEFINITION ::= mod static_EXPRESSION
2201 -- N_Modular_Type_Definition
2202 -- Sloc points to MOD
2203 -- Expression (Node3)
2205 ---------------------------------
2206 -- 3.5.6 Real Type Definition --
2207 ---------------------------------
2209 -- REAL_TYPE_DEFINITION ::=
2210 -- FLOATING_POINT_DEFINITION | FIXED_POINT_DEFINITION
2212 --------------------------------------
2213 -- 3.5.7 Floating Point Definition --
2214 --------------------------------------
2216 -- FLOATING_POINT_DEFINITION ::=
2217 -- digits static_SIMPLE_EXPRESSION [REAL_RANGE_SPECIFICATION]
2219 -- Note: The Digits_Expression and Real_Range_Specifications fields
2220 -- are set to Empty for floating-point types declared in Standard.
2222 -- N_Floating_Point_Definition
2223 -- Sloc points to DIGITS
2224 -- Digits_Expression (Node2)
2225 -- Real_Range_Specification (Node4) (set to Empty if not present)
2227 -------------------------------------
2228 -- 3.5.7 Real Range Specification --
2229 -------------------------------------
2231 -- REAL_RANGE_SPECIFICATION ::=
2232 -- range static_SIMPLE_EXPRESSION .. static_SIMPLE_EXPRESSION
2234 -- N_Real_Range_Specification
2235 -- Sloc points to RANGE
2236 -- Low_Bound (Node1)
2237 -- High_Bound (Node2)
2239 -----------------------------------
2240 -- 3.5.9 Fixed Point Definition --
2241 -----------------------------------
2243 -- FIXED_POINT_DEFINITION ::=
2244 -- ORDINARY_FIXED_POINT_DEFINITION | DECIMAL_FIXED_POINT_DEFINITION
2246 --------------------------------------------
2247 -- 3.5.9 Ordinary Fixed Point Definition --
2248 --------------------------------------------
2250 -- ORDINARY_FIXED_POINT_DEFINITION ::=
2251 -- delta static_EXPRESSION REAL_RANGE_SPECIFICATION
2253 -- Note: In Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
2255 -- N_Ordinary_Fixed_Point_Definition
2256 -- Sloc points to DELTA
2257 -- Delta_Expression (Node3)
2258 -- Real_Range_Specification (Node4)
2260 -------------------------------------------
2261 -- 3.5.9 Decimal Fixed Point Definition --
2262 -------------------------------------------
2264 -- DECIMAL_FIXED_POINT_DEFINITION ::=
2265 -- delta static_EXPRESSION
2266 -- digits static_EXPRESSION [REAL_RANGE_SPECIFICATION]
2268 -- Note: decimal types are not permitted in Ada 83 mode
2270 -- N_Decimal_Fixed_Point_Definition
2271 -- Sloc points to DELTA
2272 -- Delta_Expression (Node3)
2273 -- Digits_Expression (Node2)
2274 -- Real_Range_Specification (Node4) (set to Empty if not present)
2276 ------------------------------
2277 -- 3.5.9 Digits Constraint --
2278 ------------------------------
2280 -- DIGITS_CONSTRAINT ::=
2281 -- digits static_EXPRESSION [RANGE_CONSTRAINT]
2283 -- Note: in Ada 83, the EXPRESSION must be a SIMPLE_EXPRESSION
2284 -- Note: in Ada 95, reduced accuracy subtypes are obsolescent
2286 -- N_Digits_Constraint
2287 -- Sloc points to DIGITS
2288 -- Digits_Expression (Node2)
2289 -- Range_Constraint (Node4) (set to Empty if not present)
2291 --------------------------------
2292 -- 3.6 Array Type Definition --
2293 --------------------------------
2295 -- ARRAY_TYPE_DEFINITION ::=
2296 -- UNCONSTRAINED_ARRAY_DEFINITION | CONSTRAINED_ARRAY_DEFINITION
2298 -----------------------------------------
2299 -- 3.6 Unconstrained Array Definition --
2300 -----------------------------------------
2302 -- UNCONSTRAINED_ARRAY_DEFINITION ::=
2303 -- array (INDEX_SUBTYPE_DEFINITION {, INDEX_SUBTYPE_DEFINITION}) of
2304 -- COMPONENT_DEFINITION
2306 -- Note: dimensionality of array is indicated by number of entries in
2307 -- the Subtype_Marks list, which has one entry for each dimension.
2309 -- N_Unconstrained_Array_Definition
2310 -- Sloc points to ARRAY
2311 -- Subtype_Marks (List2)
2312 -- Component_Definition (Node4)
2314 -----------------------------------
2315 -- 3.6 Index Subtype Definition --
2316 -----------------------------------
2318 -- INDEX_SUBTYPE_DEFINITION ::= SUBTYPE_MARK range <>
2320 -- There is no explicit node in the tree for an index subtype
2321 -- definition since the N_Unconstrained_Array_Definition node
2322 -- incorporates the type marks which appear in this context.
2324 ---------------------------------------
2325 -- 3.6 Constrained Array Definition --
2326 ---------------------------------------
2328 -- CONSTRAINED_ARRAY_DEFINITION ::=
2329 -- array (DISCRETE_SUBTYPE_DEFINITION
2330 -- {, DISCRETE_SUBTYPE_DEFINITION})
2331 -- of COMPONENT_DEFINITION
2333 -- Note: dimensionality of array is indicated by number of entries
2334 -- in the Discrete_Subtype_Definitions list, which has one entry
2335 -- for each dimension.
2337 -- N_Constrained_Array_Definition
2338 -- Sloc points to ARRAY
2339 -- Discrete_Subtype_Definitions (List2)
2340 -- Component_Definition (Node4)
2342 --------------------------------------
2343 -- 3.6 Discrete Subtype Definition --
2344 --------------------------------------
2346 -- DISCRETE_SUBTYPE_DEFINITION ::=
2347 -- discrete_SUBTYPE_INDICATION | RANGE
2349 -------------------------------
2350 -- 3.6 Component Definition --
2351 -------------------------------
2353 -- COMPONENT_DEFINITION ::=
2354 -- [aliased] [NULL_EXCLUSION] SUBTYPE_INDICATION | ACCESS_DEFINITION
2356 -- Note: although the syntax does not permit a component definition to
2357 -- be an anonymous array (and the parser will diagnose such an attempt
2358 -- with an appropriate message), it is possible for anonymous arrays
2359 -- to appear as component definitions. The semantics and back end handle
2360 -- this case properly, and the expander in fact generates such cases.
2361 -- Access_Definition is an optional field that gives support to
2362 -- Ada 2005 (AI-230). The parser generates nodes that have either the
2363 -- Subtype_Indication field or else the Access_Definition field.
2365 -- N_Component_Definition
2366 -- Sloc points to ALIASED, ACCESS or to first token of subtype mark
2367 -- Aliased_Present (Flag4)
2368 -- Null_Exclusion_Present (Flag11)
2369 -- Subtype_Indication (Node5) (set to Empty if not present)
2370 -- Access_Definition (Node3) (set to Empty if not present)
2372 -----------------------------
2373 -- 3.6.1 Index Constraint --
2374 -----------------------------
2376 -- INDEX_CONSTRAINT ::= (DISCRETE_RANGE {, DISCRETE_RANGE})
2378 -- It is not in general possible to distinguish between discriminant
2379 -- constraints and index constraints at parse time, since a simple
2380 -- name could be either the subtype mark of a discrete range, or an
2381 -- expression in a discriminant association with no name. Either
2382 -- entry appears simply as the name, and the semantic parse must
2383 -- distinguish between the two cases. Thus we use a common tree
2384 -- node format for both of these constraint types.
2386 -- See Discriminant_Constraint for format of node
2388 ---------------------------
2389 -- 3.6.1 Discrete Range --
2390 ---------------------------
2392 -- DISCRETE_RANGE ::= discrete_SUBTYPE_INDICATION | RANGE
2394 ----------------------------
2395 -- 3.7 Discriminant Part --
2396 ----------------------------
2398 -- DISCRIMINANT_PART ::=
2399 -- UNKNOWN_DISCRIMINANT_PART | KNOWN_DISCRIMINANT_PART
2401 ------------------------------------
2402 -- 3.7 Unknown Discriminant Part --
2403 ------------------------------------
2405 -- UNKNOWN_DISCRIMINANT_PART ::= (<>)
2407 -- Note: unknown discriminant parts are not permitted in Ada 83 mode
2409 -- There is no explicit node in the tree for an unknown discriminant
2410 -- part. Instead the Unknown_Discriminants_Present flag is set in the
2413 ----------------------------------
2414 -- 3.7 Known Discriminant Part --
2415 ----------------------------------
2417 -- KNOWN_DISCRIMINANT_PART ::=
2418 -- (DISCRIMINANT_SPECIFICATION {; DISCRIMINANT_SPECIFICATION})
2420 -------------------------------------
2421 -- 3.7 Discriminant Specification --
2422 -------------------------------------
2424 -- DISCRIMINANT_SPECIFICATION ::=
2425 -- DEFINING_IDENTIFIER_LIST : [NULL_EXCLUSION] SUBTYPE_MARK
2426 -- [:= DEFAULT_EXPRESSION]
2427 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
2428 -- [:= DEFAULT_EXPRESSION]
2430 -- Although the syntax allows multiple identifiers in the list, the
2431 -- semantics is as though successive specifications were given with
2432 -- identical type definition and expression components. To simplify
2433 -- semantic processing, the parser represents a multiple declaration
2434 -- case as a sequence of single specifications, using the More_Ids and
2435 -- Prev_Ids flags to preserve the original source form as described
2436 -- in the section on "Handling of Defining Identifier Lists".
2438 -- N_Discriminant_Specification
2439 -- Sloc points to first identifier
2440 -- Defining_Identifier (Node1)
2441 -- Null_Exclusion_Present (Flag11)
2442 -- Discriminant_Type (Node5) subtype mark or access parameter definition
2443 -- Expression (Node3) (set to Empty if no default expression)
2444 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2445 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2447 -----------------------------
2448 -- 3.7 Default Expression --
2449 -----------------------------
2451 -- DEFAULT_EXPRESSION ::= EXPRESSION
2453 ------------------------------------
2454 -- 3.7.1 Discriminant Constraint --
2455 ------------------------------------
2457 -- DISCRIMINANT_CONSTRAINT ::=
2458 -- (DISCRIMINANT_ASSOCIATION {, DISCRIMINANT_ASSOCIATION})
2460 -- It is not in general possible to distinguish between discriminant
2461 -- constraints and index constraints at parse time, since a simple
2462 -- name could be either the subtype mark of a discrete range, or an
2463 -- expression in a discriminant association with no name. Either
2464 -- entry appears simply as the name, and the semantic parse must
2465 -- distinguish between the two cases. Thus we use a common tree
2466 -- node format for both of these constraint types.
2468 -- N_Index_Or_Discriminant_Constraint
2469 -- Sloc points to left paren
2470 -- Constraints (List1) points to list of discrete ranges or
2471 -- discriminant associations
2473 -------------------------------------
2474 -- 3.7.1 Discriminant Association --
2475 -------------------------------------
2477 -- DISCRIMINANT_ASSOCIATION ::=
2478 -- [discriminant_SELECTOR_NAME
2479 -- {| discriminant_SELECTOR_NAME} =>] EXPRESSION
2481 -- Note: a discriminant association that has no selector name list
2482 -- appears directly as an expression in the tree.
2484 -- N_Discriminant_Association
2485 -- Sloc points to first token of discriminant association
2486 -- Selector_Names (List1) (always non-empty, since if no selector
2487 -- names are present, this node is not used, see comment above)
2488 -- Expression (Node3)
2490 ---------------------------------
2491 -- 3.8 Record Type Definition --
2492 ---------------------------------
2494 -- RECORD_TYPE_DEFINITION ::=
2495 -- [[abstract] tagged] [limited] RECORD_DEFINITION
2497 -- Note: ABSTRACT, TAGGED, LIMITED are not permitted in Ada 83 mode
2499 -- There is no explicit node in the tree for a record type definition.
2500 -- Instead the flags for Tagged_Present and Limited_Present appear in
2501 -- the N_Record_Definition node for a record definition appearing in
2502 -- the context of a record type definition.
2504 ----------------------------
2505 -- 3.8 Record Definition --
2506 ----------------------------
2508 -- RECORD_DEFINITION ::=
2514 -- Note: the Abstract_Present, Tagged_Present and Limited_Present
2515 -- flags appear only for a record definition appearing in a record
2518 -- Note: the NULL RECORD case is not permitted in Ada 83
2520 -- N_Record_Definition
2521 -- Sloc points to RECORD or NULL
2522 -- End_Label (Node4) (set to Empty if internally generated record)
2523 -- Abstract_Present (Flag4)
2524 -- Tagged_Present (Flag15)
2525 -- Limited_Present (Flag17)
2526 -- Component_List (Node1) empty in null record case
2527 -- Null_Present (Flag13) set in null record case
2528 -- Task_Present (Flag5) set in task interfaces
2529 -- Protected_Present (Flag6) set in protected interfaces
2530 -- Synchronized_Present (Flag7) set in interfaces
2531 -- Interface_Present (Flag16) set in abstract interfaces
2532 -- Interface_List (List2) (set to No_List if none)
2534 -- Note: The attributes Task_Present, Protected_Present, Synchronized
2535 -- _Present, Interface_List and Interface_Present are
2536 -- used for abstract interfaces (see comment in the definition
2537 -- of INTERFACE_TYPE_DEFINITION)
2539 -------------------------
2540 -- 3.8 Component List --
2541 -------------------------
2543 -- COMPONENT_LIST ::=
2544 -- COMPONENT_ITEM {COMPONENT_ITEM}
2545 -- | {COMPONENT_ITEM} VARIANT_PART
2549 -- Sloc points to first token of component list
2550 -- Component_Items (List3)
2551 -- Variant_Part (Node4) (set to Empty if no variant part)
2552 -- Null_Present (Flag13)
2554 -------------------------
2555 -- 3.8 Component Item --
2556 -------------------------
2558 -- COMPONENT_ITEM ::= COMPONENT_DECLARATION | REPRESENTATION_CLAUSE
2560 -- Note: A component item can also be a pragma, and in the tree
2561 -- that is obtained after semantic processing, a component item
2562 -- can be an N_Null node resulting from a non-recognized pragma.
2564 --------------------------------
2565 -- 3.8 Component Declaration --
2566 --------------------------------
2568 -- COMPONENT_DECLARATION ::=
2569 -- DEFINING_IDENTIFIER_LIST : COMPONENT_DEFINITION
2570 -- [:= DEFAULT_EXPRESSION]
2572 -- Note: although the syntax does not permit a component definition to
2573 -- be an anonymous array (and the parser will diagnose such an attempt
2574 -- with an appropriate message), it is possible for anonymous arrays
2575 -- to appear as component definitions. The semantics and back end handle
2576 -- this case properly, and the expander in fact generates such cases.
2578 -- Although the syntax allows multiple identifiers in the list, the
2579 -- semantics is as though successive declarations were given with the
2580 -- same component definition and expression components. To simplify
2581 -- semantic processing, the parser represents a multiple declaration
2582 -- case as a sequence of single declarations, using the More_Ids and
2583 -- Prev_Ids flags to preserve the original source form as described
2584 -- in the section on "Handling of Defining Identifier Lists".
2586 -- N_Component_Declaration
2587 -- Sloc points to first identifier
2588 -- Defining_Identifier (Node1)
2589 -- Component_Definition (Node4)
2590 -- Expression (Node3) (set to Empty if no default expression)
2591 -- More_Ids (Flag5) (set to False if no more identifiers in list)
2592 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
2594 -------------------------
2595 -- 3.8.1 Variant Part --
2596 -------------------------
2599 -- case discriminant_DIRECT_NAME is
2604 -- Note: the variants list can contain pragmas as well as variants.
2605 -- In a properly formed program there is at least one variant.
2608 -- Sloc points to CASE
2612 --------------------
2614 --------------------
2617 -- when DISCRETE_CHOICE_LIST =>
2621 -- Sloc points to WHEN
2622 -- Discrete_Choices (List4)
2623 -- Component_List (Node1)
2624 -- Enclosing_Variant (Node2-Sem)
2625 -- Present_Expr (Uint3-Sem)
2626 -- Dcheck_Function (Node5-Sem)
2628 ---------------------------------
2629 -- 3.8.1 Discrete Choice List --
2630 ---------------------------------
2632 -- DISCRETE_CHOICE_LIST ::= DISCRETE_CHOICE {| DISCRETE_CHOICE}
2634 ----------------------------
2635 -- 3.8.1 Discrete Choice --
2636 ----------------------------
2638 -- DISCRETE_CHOICE ::= EXPRESSION | DISCRETE_RANGE | others
2640 -- Note: in Ada 83 mode, the expression must be a simple expression
2642 -- The only choice that appears explicitly is the OTHERS choice, as
2643 -- defined here. Other cases of discrete choice (expression and
2644 -- discrete range) appear directly. This production is also used
2645 -- for the OTHERS possibility of an exception choice.
2647 -- Note: in accordance with the syntax, the parser does not check that
2648 -- OTHERS appears at the end on its own in a choice list context. This
2649 -- is a semantic check.
2652 -- Sloc points to OTHERS
2653 -- Others_Discrete_Choices (List1-Sem)
2654 -- All_Others (Flag11-Sem)
2656 ----------------------------------
2657 -- 3.9.1 Record Extension Part --
2658 ----------------------------------
2660 -- RECORD_EXTENSION_PART ::= with RECORD_DEFINITION
2662 -- Note: record extension parts are not permitted in Ada 83 mode
2664 --------------------------------------
2665 -- 3.9.4 Interface Type Definition --
2666 --------------------------------------
2668 -- INTERFACE_TYPE_DEFINITION ::=
2669 -- [limited | task | protected | synchronized]
2670 -- interface [interface_list]
2672 -- Note: Interfaces are implemented with N_Record_Definition and
2673 -- N_Derived_Type_Definition nodes because most of the support
2674 -- for the analysis of abstract types has been reused to
2675 -- analyze abstract interfaces.
2677 ----------------------------------
2678 -- 3.10 Access Type Definition --
2679 ----------------------------------
2681 -- ACCESS_TYPE_DEFINITION ::=
2682 -- ACCESS_TO_OBJECT_DEFINITION
2683 -- | ACCESS_TO_SUBPROGRAM_DEFINITION
2685 --------------------------
2686 -- 3.10 Null Exclusion --
2687 --------------------------
2689 -- NULL_EXCLUSION ::= not null
2691 ---------------------------------------
2692 -- 3.10 Access To Object Definition --
2693 ---------------------------------------
2695 -- ACCESS_TO_OBJECT_DEFINITION ::=
2696 -- [NULL_EXCLUSION] access [GENERAL_ACCESS_MODIFIER]
2697 -- SUBTYPE_INDICATION
2699 -- N_Access_To_Object_Definition
2700 -- Sloc points to ACCESS
2701 -- All_Present (Flag15)
2702 -- Null_Exclusion_Present (Flag11)
2703 -- Subtype_Indication (Node5)
2704 -- Constant_Present (Flag17)
2706 -----------------------------------
2707 -- 3.10 General Access Modifier --
2708 -----------------------------------
2710 -- GENERAL_ACCESS_MODIFIER ::= all | constant
2712 -- Note: general access modifiers are not permitted in Ada 83 mode
2714 -- There is no explicit node in the tree for general access modifier.
2715 -- Instead the All_Present or Constant_Present flags are set in the
2718 -------------------------------------------
2719 -- 3.10 Access To Subprogram Definition --
2720 -------------------------------------------
2722 -- ACCESS_TO_SUBPROGRAM_DEFINITION
2723 -- [NULL_EXCLUSION] access [protected] procedure PARAMETER_PROFILE
2724 -- | [NULL_EXCLUSION] access [protected] function
2725 -- PARAMETER_AND_RESULT_PROFILE
2727 -- Note: access to subprograms are not permitted in Ada 83 mode
2729 -- N_Access_Function_Definition
2730 -- Sloc points to ACCESS
2731 -- Null_Exclusion_Present (Flag11)
2732 -- Protected_Present (Flag6)
2733 -- Parameter_Specifications (List3) (set to No_List if no formal part)
2734 -- Subtype_Mark (Node4) result subtype
2736 -- N_Access_Procedure_Definition
2737 -- Sloc points to ACCESS
2738 -- Null_Exclusion_Present (Flag11)
2739 -- Protected_Present (Flag6)
2740 -- Parameter_Specifications (List3) (set to No_List if no formal part)
2742 -----------------------------
2743 -- 3.10 Access Definition --
2744 -----------------------------
2746 -- ACCESS_DEFINITION ::=
2747 -- [NULL_EXCLUSION] access [GENERAL_ACCESS_MODIFIER] SUBTYPE_MARK
2748 -- | ACCESS_TO_SUBPROGRAM_DEFINITION
2750 -- Note: access to subprograms are an Ada 2005 (AI-254) extension
2752 -- N_Access_Definition
2753 -- Sloc points to ACCESS
2754 -- Null_Exclusion_Present (Flag11)
2755 -- All_Present (Flag15)
2756 -- Constant_Present (Flag17)
2757 -- Subtype_Mark (Node4)
2758 -- Access_To_Subprogram_Definition (Node3) (set to Empty if not present)
2760 -----------------------------------------
2761 -- 3.10.1 Incomplete Type Declaration --
2762 -----------------------------------------
2764 -- INCOMPLETE_TYPE_DECLARATION ::=
2765 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] [IS TAGGED];
2767 -- N_Incomplete_Type_Declaration
2768 -- Sloc points to TYPE
2769 -- Defining_Identifier (Node1)
2770 -- Discriminant_Specifications (List4) (set to No_List if no
2771 -- discriminant part, or if the discriminant part is an
2772 -- unknown discriminant part)
2773 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
2774 -- Tagged_Present (Flag15)
2776 ----------------------------
2777 -- 3.11 Declarative Part --
2778 ----------------------------
2780 -- DECLARATIVE_PART ::= {DECLARATIVE_ITEM}
2782 -- Note: although the parser enforces the syntactic requirement that
2783 -- a declarative part can contain only declarations, the semantic
2784 -- processing may add statements to the list of actions in a
2785 -- declarative part, so the code generator should be prepared
2786 -- to accept a statement in this position.
2788 ----------------------------
2789 -- 3.11 Declarative Item --
2790 ----------------------------
2792 -- DECLARATIVE_ITEM ::= BASIC_DECLARATIVE_ITEM | BODY
2794 ----------------------------------
2795 -- 3.11 Basic Declarative Item --
2796 ----------------------------------
2798 -- BASIC_DECLARATIVE_ITEM ::=
2799 -- BASIC_DECLARATION | REPRESENTATION_CLAUSE | USE_CLAUSE
2805 -- BODY ::= PROPER_BODY | BODY_STUB
2807 -----------------------
2808 -- 3.11 Proper Body --
2809 -----------------------
2812 -- SUBPROGRAM_BODY | PACKAGE_BODY | TASK_BODY | PROTECTED_BODY
2819 -- DIRECT_NAME | EXPLICIT_DEREFERENCE
2820 -- | INDEXED_COMPONENT | SLICE
2821 -- | SELECTED_COMPONENT | ATTRIBUTE_REFERENCE
2822 -- | TYPE_CONVERSION | FUNCTION_CALL
2823 -- | CHARACTER_LITERAL
2825 ----------------------
2826 -- 4.1 Direct Name --
2827 ----------------------
2829 -- DIRECT_NAME ::= IDENTIFIER | OPERATOR_SYMBOL
2835 -- PREFIX ::= NAME | IMPLICIT_DEREFERENCE
2837 -------------------------------
2838 -- 4.1 Explicit Dereference --
2839 -------------------------------
2841 -- EXPLICIT_DEREFERENCE ::= NAME . all
2843 -- N_Explicit_Dereference
2844 -- Sloc points to ALL
2846 -- plus fields for expression
2848 -------------------------------
2849 -- 4.1 Implicit Dereference --
2850 -------------------------------
2852 -- IMPLICIT_DEREFERENCE ::= NAME
2854 ------------------------------
2855 -- 4.1.1 Indexed Component --
2856 ------------------------------
2858 -- INDEXED_COMPONENT ::= PREFIX (EXPRESSION {, EXPRESSION})
2860 -- Note: the parser may generate this node in some situations where it
2861 -- should be a function call. The semantic pass must correct this
2862 -- misidentification (which is inevitable at the parser level).
2864 -- N_Indexed_Component
2865 -- Sloc contains a copy of the Sloc value of the Prefix
2867 -- Expressions (List1)
2868 -- plus fields for expression
2870 -- Note: if any of the subscripts requires a range check, then the
2871 -- Do_Range_Check flag is set on the corresponding expression, with
2872 -- the index type being determined from the type of the Prefix, which
2873 -- references the array being indexed.
2875 -- Note: in a fully analyzed and expanded indexed component node, and
2876 -- hence in any such node that gigi sees, if the prefix is an access
2877 -- type, then an explicit dereference operation has been inserted.
2883 -- SLICE ::= PREFIX (DISCRETE_RANGE)
2885 -- Note: an implicit subtype is created to describe the resulting
2886 -- type, so that the bounds of this type are the bounds of the slice.
2889 -- Sloc points to first token of prefix
2891 -- Discrete_Range (Node4)
2892 -- plus fields for expression
2894 -------------------------------
2895 -- 4.1.3 Selected Component --
2896 -------------------------------
2898 -- SELECTED_COMPONENT ::= PREFIX . SELECTOR_NAME
2900 -- Note: selected components that are semantically expanded names get
2901 -- changed during semantic processing into the separate N_Expanded_Name
2902 -- node. See description of this node in the section on semantic nodes.
2904 -- N_Selected_Component
2905 -- Sloc points to period
2907 -- Selector_Name (Node2)
2908 -- Associated_Node (Node4-Sem)
2909 -- Do_Discriminant_Check (Flag13-Sem)
2910 -- Is_In_Discriminant_Check (Flag11-Sem)
2911 -- plus fields for expression
2913 --------------------------
2914 -- 4.1.3 Selector Name --
2915 --------------------------
2917 -- SELECTOR_NAME ::= IDENTIFIER | CHARACTER_LITERAL | OPERATOR_SYMBOL
2919 --------------------------------
2920 -- 4.1.4 Attribute Reference --
2921 --------------------------------
2923 -- ATTRIBUTE_REFERENCE ::= PREFIX ' ATTRIBUTE_DESIGNATOR
2925 -- Note: the syntax is quite ambiguous at this point. Consider:
2927 -- A'Length (X) X is part of the attribute designator
2928 -- A'Pos (X) X is an explicit actual parameter of function A'Pos
2929 -- A'Class (X) X is the expression of a type conversion
2931 -- It would be possible for the parser to distinguish these cases
2932 -- by looking at the attribute identifier. However, that would mean
2933 -- more work in introducing new implementation defined attributes,
2934 -- and also it would mean that special processing for attributes
2935 -- would be scattered around, instead of being centralized in the
2936 -- semantic routine that handles an N_Attribute_Reference node.
2937 -- Consequently, the parser in all the above cases stores the
2938 -- expression (X in these examples) as a single element list in
2939 -- in the Expressions field of the N_Attribute_Reference node.
2941 -- Similarly, for attributes like Max which take two arguments,
2942 -- we store the two arguments as a two element list in the
2943 -- Expressions field. Of course it is clear at parse time that
2944 -- this case is really a function call with an attribute as the
2945 -- prefix, but it turns out to be convenient to handle the two
2946 -- argument case in a similar manner to the one argument case,
2947 -- and indeed in general the parser will accept any number of
2948 -- expressions in this position and store them as a list in the
2949 -- attribute reference node. This allows for future addition of
2950 -- attributes that take more than two arguments.
2952 -- Note: named associates are not permitted in function calls where
2953 -- the function is an attribute (see RM 6.4(3)) so it is legitimate
2954 -- to skip the normal subprogram argument processing.
2956 -- Note: for the attributes whose designators are technically keywords,
2957 -- i.e. digits, access, delta, range, the Attribute_Name field contains
2958 -- the corresponding name, even though no identifier is involved.
2960 -- Note: the generated code may contain stream attributes applied to
2961 -- limited types for which no stream routines exist officially. In such
2962 -- case, the result is to use the stream attribute for the underlying
2963 -- full type, or in the case of a protected type, the components
2964 -- (including any disriminants) are merely streamed in order.
2966 -- See Exp_Attr for a complete description of which attributes are
2967 -- passed onto Gigi, and which are handled entirely by the front end.
2969 -- Gigi restriction: For the Pos attribute, the prefix cannot be
2970 -- a non-standard enumeration type or a nonzero/zero semantics
2971 -- boolean type, so the value is simply the stored representation.
2973 -- Note: In generated code, the Address and Unrestricted_Access
2974 -- attributes can be applied to any expression, and the meaning is
2975 -- to create an object containing the value (the object is in the
2976 -- current stack frame), and pass the address of this value. If the
2977 -- Must_Be_Byte_Aligned flag is set, then the object whose address
2978 -- is taken must be on a byte (storage unit) boundary, and if it is
2979 -- not (or may not be), then the generated code must create a copy
2980 -- that is byte aligned, and pass the address of this copy.
2982 -- N_Attribute_Reference
2983 -- Sloc points to apostrophe
2985 -- Attribute_Name (Name2) identifier name from attribute designator
2986 -- Expressions (List1) (set to No_List if no associated expressions)
2987 -- Entity (Node4-Sem) used if the attribute yields a type
2988 -- Associated_Node (Node4-Sem)
2989 -- Do_Overflow_Check (Flag17-Sem)
2990 -- Redundant_Use (Flag13-Sem)
2991 -- Must_Be_Byte_Aligned (Flag14)
2992 -- plus fields for expression
2994 ---------------------------------
2995 -- 4.1.4 Attribute Designator --
2996 ---------------------------------
2998 -- ATTRIBUTE_DESIGNATOR ::=
2999 -- IDENTIFIER [(static_EXPRESSION)]
3000 -- | access | delta | digits
3002 -- There is no explicit node in the tree for an attribute designator.
3003 -- Instead the Attribute_Name and Expressions fields of the parent
3004 -- node (N_Attribute_Reference node) hold the information.
3006 -- Note: if ACCESS, DELTA or DIGITS appears in an attribute
3007 -- designator, then they are treated as identifiers internally
3008 -- rather than the keywords of the same name.
3010 --------------------------------------
3011 -- 4.1.4 Range Attribute Reference --
3012 --------------------------------------
3014 -- RANGE_ATTRIBUTE_REFERENCE ::= PREFIX ' RANGE_ATTRIBUTE_DESIGNATOR
3016 -- A range attribute reference is represented in the tree using the
3017 -- normal N_Attribute_Reference node.
3019 ---------------------------------------
3020 -- 4.1.4 Range Attribute Designator --
3021 ---------------------------------------
3023 -- RANGE_ATTRIBUTE_DESIGNATOR ::= Range [(static_EXPRESSION)]
3025 -- A range attribute designator is represented in the tree using the
3026 -- normal N_Attribute_Reference node.
3028 --------------------
3030 --------------------
3033 -- RECORD_AGGREGATE | EXTENSION_AGGREGATE | ARRAY_AGGREGATE
3035 -----------------------------
3036 -- 4.3.1 Record Aggregate --
3037 -----------------------------
3039 -- RECORD_AGGREGATE ::= (RECORD_COMPONENT_ASSOCIATION_LIST)
3042 -- Sloc points to left parenthesis
3043 -- Expressions (List1) (set to No_List if none or null record case)
3044 -- Component_Associations (List2) (set to No_List if none)
3045 -- Null_Record_Present (Flag17)
3046 -- Aggregate_Bounds (Node3-Sem)
3047 -- Associated_Node (Node4-Sem)
3048 -- Static_Processing_OK (Flag4-Sem)
3049 -- Compile_Time_Known_Aggregate (Flag18-Sem)
3050 -- Expansion_Delayed (Flag11-Sem)
3051 -- plus fields for expression
3053 -- Note: this structure is used for both record and array aggregates
3054 -- since the two cases are not separable by the parser. The parser
3055 -- makes no attempt to enforce consistency here, so it is up to the
3056 -- semantic phase to make sure that the aggregate is consistent (i.e.
3057 -- that it is not a "half-and-half" case that mixes record and array
3058 -- syntax. In particular, for a record aggregate, the expressions
3059 -- field will be set if there are positional associations.
3061 -- Note: gigi/gcc can handle array aggregates correctly providing that
3062 -- they are entirely positional, and the array subtype involved has a
3063 -- known at compile time length and is not bit packed, or a convention
3064 -- Fortran array with more than one dimension. If these conditions
3065 -- are not met, then the front end must translate the aggregate into
3066 -- an appropriate set of assignments into a temporary.
3068 -- Note: for the record aggregate case, gigi/gcc can handle all cases
3069 -- of record aggregates, including those for packed, and rep-claused
3070 -- records, and also variant records, providing that there are no
3071 -- variable length fields whose size is not known at runtime, and
3072 -- providing that the aggregate is presented in fully named form.
3074 ----------------------------------------------
3075 -- 4.3.1 Record Component Association List --
3076 ----------------------------------------------
3078 -- RECORD_COMPONENT_ASSOCIATION_LIST ::=
3079 -- RECORD_COMPONENT_ASSOCIATION {, RECORD_COMPONENT_ASSOCIATION}
3082 -- There is no explicit node in the tree for a record component
3083 -- association list. Instead the Null_Record_Present flag is set in
3084 -- the parent node for the NULL RECORD case.
3086 ------------------------------------------------------
3087 -- 4.3.1 Record Component Association (also 4.3.3) --
3088 ------------------------------------------------------
3090 -- RECORD_COMPONENT_ASSOCIATION ::=
3091 -- [COMPONENT_CHOICE_LIST =>] EXPRESSION
3093 -- N_Component_Association
3094 -- Sloc points to first selector name
3096 -- Loop_Actions (List2-Sem)
3097 -- Expression (Node3)
3098 -- Box_Present (Flag15)
3100 -- Note: this structure is used for both record component associations
3101 -- and array component associations, since the two cases aren't always
3102 -- separable by the parser. The choices list may represent either a
3103 -- list of selector names in the record aggregate case, or a list of
3104 -- discrete choices in the array aggregate case or an N_Others_Choice
3105 -- node (which appears as a singleton list). Box_Present gives support
3106 -- to Ada 2005 (AI-287).
3108 -----------------------------------
3109 -- 4.3.1 Commponent Choice List --
3110 -----------------------------------
3112 -- COMPONENT_CHOICE_LIST ::=
3113 -- component_SELECTOR_NAME {| component_SELECTOR_NAME}
3116 -- The entries of a component choice list appear in the Choices list
3117 -- of the associated N_Component_Association, as either selector
3118 -- names, or as an N_Others_Choice node.
3120 --------------------------------
3121 -- 4.3.2 Extension Aggregate --
3122 --------------------------------
3124 -- EXTENSION_AGGREGATE ::=
3125 -- (ANCESTOR_PART with RECORD_COMPONENT_ASSOCIATION_LIST)
3127 -- Note: extension aggregates are not permitted in Ada 83 mode
3129 -- N_Extension_Aggregate
3130 -- Sloc points to left parenthesis
3131 -- Ancestor_Part (Node3)
3132 -- Associated_Node (Node4-Sem)
3133 -- Expressions (List1) (set to No_List if none or null record case)
3134 -- Component_Associations (List2) (set to No_List if none)
3135 -- Null_Record_Present (Flag17)
3136 -- Expansion_Delayed (Flag11-Sem)
3137 -- plus fields for expression
3139 --------------------------
3140 -- 4.3.2 Ancestor Part --
3141 --------------------------
3143 -- ANCESTOR_PART ::= EXPRESSION | SUBTYPE_MARK
3145 ----------------------------
3146 -- 4.3.3 Array Aggregate --
3147 ----------------------------
3149 -- ARRAY_AGGREGATE ::=
3150 -- POSITIONAL_ARRAY_AGGREGATE | NAMED_ARRAY_AGGREGATE
3152 ---------------------------------------
3153 -- 4.3.3 Positional Array Aggregate --
3154 ---------------------------------------
3156 -- POSITIONAL_ARRAY_AGGREGATE ::=
3157 -- (EXPRESSION, EXPRESSION {, EXPRESSION})
3158 -- | (EXPRESSION {, EXPRESSION}, others => EXPRESSION)
3160 -- See Record_Aggregate (4.3.1) for node structure
3162 ----------------------------------
3163 -- 4.3.3 Named Array Aggregate --
3164 ----------------------------------
3166 -- NAMED_ARRAY_AGGREGATE ::=
3167 -- | (ARRAY_COMPONENT_ASSOCIATION {, ARRAY_COMPONENT_ASSOCIATION})
3169 -- See Record_Aggregate (4.3.1) for node structure
3171 ----------------------------------------
3172 -- 4.3.3 Array Component Association --
3173 ----------------------------------------
3175 -- ARRAY_COMPONENT_ASSOCIATION ::=
3176 -- DISCRETE_CHOICE_LIST => EXPRESSION
3178 -- See Record_Component_Association (4.3.1) for node structure
3180 --------------------------------------------------
3181 -- 4.4 Expression/Relation/Term/Factor/Primary --
3182 --------------------------------------------------
3185 -- RELATION {and RELATION} | RELATION {and then RELATION}
3186 -- | RELATION {or RELATION} | RELATION {or else RELATION}
3187 -- | RELATION {xor RELATION}
3190 -- SIMPLE_EXPRESSION [RELATIONAL_OPERATOR SIMPLE_EXPRESSION]
3191 -- | SIMPLE_EXPRESSION [not] in RANGE
3192 -- | SIMPLE_EXPRESSION [not] in SUBTYPE_MARK
3194 -- SIMPLE_EXPRESSION ::=
3195 -- [UNARY_ADDING_OPERATOR] TERM {BINARY_ADDING_OPERATOR TERM}
3197 -- TERM ::= FACTOR {MULTIPLYING_OPERATOR FACTOR}
3199 -- FACTOR ::= PRIMARY [** PRIMARY] | abs PRIMARY | not PRIMARY
3201 -- No nodes are generated for any of these constructs. Instead, the
3202 -- node for the operator appears directly. When we refer to an
3203 -- expression in this description, we mean any of the possible
3204 -- consistuent components of an expression (e.g. identifier is
3205 -- an example of an expression).
3212 -- NUMERIC_LITERAL | null
3213 -- | STRING_LITERAL | AGGREGATE
3214 -- | NAME | QUALIFIED_EXPRESSION
3215 -- | ALLOCATOR | (EXPRESSION)
3217 -- Usually there is no explicit node in the tree for primary. Instead
3218 -- the constituent (e.g. AGGREGATE) appears directly. There are two
3219 -- exceptions. First, there is an explicit node for a null primary.
3222 -- Sloc points to NULL
3223 -- plus fields for expression
3225 -- Second, the case of (EXPRESSION) is handled specially. Ada requires
3226 -- that the parser keep track of which subexpressions are enclosed
3227 -- in parentheses, and how many levels of parentheses are used. This
3228 -- information is required for optimization purposes, and also for
3229 -- some semantic checks (e.g. (((1))) in a procedure spec does not
3230 -- conform with ((((1)))) in the body).
3232 -- The parentheses are recorded by keeping a Paren_Count field in every
3233 -- subexpression node (it is actually present in all nodes, but only
3234 -- used in subexpression nodes). This count records the number of
3235 -- levels of parentheses. If the number of levels in the source exceeds
3236 -- the maximum accomodated by this count, then the count is simply left
3237 -- at the maximum value. This means that there are some pathalogical
3238 -- cases of failure to detect conformance failures (e.g. an expression
3239 -- with 500 levels of parens will conform with one with 501 levels),
3240 -- but we do not need to lose sleep over this.
3242 -- Historical note: in versions of GNAT prior to 1.75, there was a node
3243 -- type N_Parenthesized_Expression used to accurately record unlimited
3244 -- numbers of levels of parentheses. However, it turned out to be a
3245 -- real nuisance to have to take into account the possible presence of
3246 -- this node during semantic analysis, since basically parentheses have
3247 -- zero relevance to semantic analysis.
3249 -- Note: the level of parentheses always present in things like
3250 -- aggregates does not count, only the parentheses in the primary
3251 -- (EXPRESSION) affect the setting of the Paren_Count field.
3253 -- 2nd Note: the contents of the Expression field must be ignored (i.e.
3254 -- treated as though it were Empty) if No_Initialization is set True.
3256 --------------------------------------
3257 -- 4.5 Short Circuit Control Forms --
3258 --------------------------------------
3261 -- RELATION {and then RELATION} | RELATION {or else RELATION}
3263 -- Gigi restriction: For both these control forms, the operand and
3264 -- result types are always Standard.Boolean. The expander inserts the
3265 -- required conversion operations where needed to ensure this is the
3269 -- Sloc points to AND of AND THEN
3270 -- Left_Opnd (Node2)
3271 -- Right_Opnd (Node3)
3272 -- Actions (List1-Sem)
3273 -- plus fields for expression
3276 -- Sloc points to OR of OR ELSE
3277 -- Left_Opnd (Node2)
3278 -- Right_Opnd (Node3)
3279 -- Actions (List1-Sem)
3280 -- plus fields for expression
3282 -- Note: The Actions field is used to hold actions associated with
3283 -- the right hand operand. These have to be treated specially since
3284 -- they are not unconditionally executed. See Insert_Actions for a
3285 -- more detailed description of how these actions are handled.
3287 ---------------------------
3288 -- 4.5 Membership Tests --
3289 ---------------------------
3292 -- SIMPLE_EXPRESSION [not] in RANGE
3293 -- | SIMPLE_EXPRESSION [not] in SUBTYPE_MARK
3295 -- Note: although the grammar above allows only a range or a
3296 -- subtype mark, the parser in fact will accept any simple
3297 -- expression in place of a subtype mark. This means that the
3298 -- semantic analyzer must be prepared to deal with, and diagnose
3299 -- a simple expression other than a name for the right operand.
3300 -- This simplifies error recovery in the parser.
3303 -- Sloc points to IN
3304 -- Left_Opnd (Node2)
3305 -- Right_Opnd (Node3)
3306 -- plus fields for expression
3309 -- Sloc points to NOT of NOT IN
3310 -- Left_Opnd (Node2)
3311 -- Right_Opnd (Node3)
3312 -- plus fields for expression
3314 --------------------
3316 --------------------
3318 -- LOGICAL_OPERATOR ::= and | or | xor
3320 -- RELATIONAL_OPERATOR ::= = | /= | < | <= | > | >=
3322 -- BINARY_ADDING_OPERATOR ::= + | - | &
3324 -- UNARY_ADDING_OPERATOR ::= + | -
3326 -- MULTIPLYING_OPERATOR ::= * | / | mod | rem
3328 -- HIGHEST_PRECEDENCE_OPERATOR ::= ** | abs | not
3330 -- Sprint syntax if Treat_Fixed_As_Integer is set:
3337 -- Gigi restriction: For * / mod rem with fixed-point operands, Gigi
3338 -- will only be given nodes with the Treat_Fixed_As_Integer flag set.
3339 -- All handling of smalls for multiplication and division is handled
3340 -- by the front end (mod and rem result only from expansion). Gigi
3341 -- thus never needs to worry about small values (for other operators
3342 -- operating on fixed-point, e.g. addition, the small value does not
3343 -- have any semantic effect anyway, these are always integer operations.
3345 -- Gigi restriction: For all operators taking Boolean operands, the
3346 -- type is always Standard.Boolean. The expander inserts the required
3347 -- conversion operations where needed to ensure this is the case.
3350 -- Sloc points to AND
3351 -- Do_Length_Check (Flag4-Sem)
3352 -- plus fields for binary operator
3353 -- plus fields for expression
3356 -- Sloc points to OR
3357 -- Do_Length_Check (Flag4-Sem)
3358 -- plus fields for binary operator
3359 -- plus fields for expression
3362 -- Sloc points to XOR
3363 -- Do_Length_Check (Flag4-Sem)
3364 -- plus fields for binary operator
3365 -- plus fields for expression
3369 -- plus fields for binary operator
3370 -- plus fields for expression
3373 -- Sloc points to /=
3374 -- plus fields for binary operator
3375 -- plus fields for expression
3379 -- plus fields for binary operator
3380 -- plus fields for expression
3383 -- Sloc points to <=
3384 -- plus fields for binary operator
3385 -- plus fields for expression
3389 -- plus fields for binary operator
3390 -- plus fields for expression
3393 -- Sloc points to >=
3394 -- plus fields for binary operator
3395 -- plus fields for expression
3398 -- Sloc points to + (binary)
3399 -- plus fields for binary operator
3400 -- plus fields for expression
3403 -- Sloc points to - (binary)
3404 -- plus fields for binary operator
3405 -- plus fields for expression
3409 -- Is_Component_Left_Opnd (Flag13-Sem)
3410 -- Is_Component_Right_Opnd (Flag14-Sem)
3411 -- plus fields for binary operator
3412 -- plus fields for expression
3416 -- Treat_Fixed_As_Integer (Flag14-Sem)
3417 -- Rounded_Result (Flag18-Sem)
3418 -- plus fields for binary operator
3419 -- plus fields for expression
3423 -- Treat_Fixed_As_Integer (Flag14-Sem)
3424 -- Do_Division_Check (Flag13-Sem)
3425 -- Rounded_Result (Flag18-Sem)
3426 -- plus fields for binary operator
3427 -- plus fields for expression
3430 -- Sloc points to MOD
3431 -- Treat_Fixed_As_Integer (Flag14-Sem)
3432 -- Do_Division_Check (Flag13-Sem)
3433 -- plus fields for binary operator
3434 -- plus fields for expression
3437 -- Sloc points to REM
3438 -- Treat_Fixed_As_Integer (Flag14-Sem)
3439 -- Do_Division_Check (Flag13-Sem)
3440 -- plus fields for binary operator
3441 -- plus fields for expression
3444 -- Is_Power_Of_2_For_Shift (Flag13-Sem)
3445 -- Sloc points to **
3446 -- plus fields for binary operator
3447 -- plus fields for expression
3450 -- Sloc points to + (unary)
3451 -- plus fields for unary operator
3452 -- plus fields for expression
3455 -- Sloc points to - (unary)
3456 -- plus fields for unary operator
3457 -- plus fields for expression
3460 -- Sloc points to ABS
3461 -- plus fields for unary operator
3462 -- plus fields for expression
3465 -- Sloc points to NOT
3466 -- plus fields for unary operator
3467 -- plus fields for expression
3469 -- See also shift operators in section B.2
3471 -- Note on fixed-point operations passed to Gigi: For adding operators,
3472 -- the semantics is to treat these simply as integer operations, with
3473 -- the small values being ignored (the bounds are already stored in
3474 -- units of small, so that constraint checking works as usual). For the
3475 -- case of multiply/divide/rem/mod operations, Gigi will only see fixed
3476 -- point operands if the Treat_Fixed_As_Integer flag is set and will
3477 -- thus treat these nodes in identical manner, ignoring small values.
3479 --------------------------
3480 -- 4.6 Type Conversion --
3481 --------------------------
3483 -- TYPE_CONVERSION ::=
3484 -- SUBTYPE_MARK (EXPRESSION) | SUBTYPE_MARK (NAME)
3486 -- In the (NAME) case, the name is stored as the expression
3488 -- Note: the parser never generates a type conversion node, since it
3489 -- looks like an indexed component which is generated by preference.
3490 -- The semantic pass must correct this misidentification.
3492 -- Gigi handles conversions that involve no change in the root type,
3493 -- and also all conversions from integer to floating-point types.
3494 -- Conversions from floating-point to integer are only handled in
3495 -- the case where Float_Truncate flag set. Other conversions from
3496 -- floating-point to integer (involving rounding) and all conversions
3497 -- involving fixed-point types are handled by the expander.
3499 -- Sprint syntax if Float_Truncate set: X^(Y)
3500 -- Sprint syntax if Conversion_OK set X?(Y)
3501 -- Sprint syntax if both flags set X?^(Y)
3503 -- Note: If either the operand or result type is fixed-point, Gigi will
3504 -- only see a type conversion node with Conversion_OK set. The front end
3505 -- takes care of all handling of small's for fixed-point conversions.
3507 -- N_Type_Conversion
3508 -- Sloc points to first token of subtype mark
3509 -- Subtype_Mark (Node4)
3510 -- Expression (Node3)
3511 -- Do_Tag_Check (Flag13-Sem)
3512 -- Do_Length_Check (Flag4-Sem)
3513 -- Do_Overflow_Check (Flag17-Sem)
3514 -- Float_Truncate (Flag11-Sem)
3515 -- Rounded_Result (Flag18-Sem)
3516 -- Conversion_OK (Flag14-Sem)
3517 -- plus fields for expression
3519 -- Note: if a range check is required, then the Do_Range_Check flag
3520 -- is set in the Expression with the check being done against the
3521 -- target type range (after the base type conversion, if any).
3523 -------------------------------
3524 -- 4.7 Qualified Expression --
3525 -------------------------------
3527 -- QUALIFIED_EXPRESSION ::=
3528 -- SUBTYPE_MARK ' (EXPRESSION) | SUBTYPE_MARK ' AGGREGATE
3530 -- Note: the parentheses in the (EXPRESSION) case are deemed to enclose
3531 -- the expression, so the Expression field of this node always points
3532 -- to a parenthesized expression in this case (i.e. Paren_Count will
3533 -- always be non-zero for the referenced expression if it is not an
3536 -- N_Qualified_Expression
3537 -- Sloc points to apostrophe
3538 -- Subtype_Mark (Node4)
3539 -- Expression (Node3) expression or aggregate
3540 -- plus fields for expression
3542 --------------------
3544 --------------------
3547 -- new [NULL_EXCLUSION] SUBTYPE_INDICATION | new QUALIFIED_EXPRESSION
3549 -- Sprint syntax (when storage pool present)
3550 -- new xxx (storage_pool = pool)
3553 -- Sloc points to NEW
3554 -- Expression (Node3) subtype indication or qualified expression
3555 -- Null_Exclusion_Present (Flag11)
3556 -- Storage_Pool (Node1-Sem)
3557 -- Procedure_To_Call (Node4-Sem)
3558 -- No_Initialization (Flag13-Sem)
3559 -- Do_Storage_Check (Flag17-Sem)
3560 -- plus fields for expression
3562 ---------------------------------
3563 -- 5.1 Sequence Of Statements --
3564 ---------------------------------
3566 -- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT}
3568 -- Note: Although the parser will not accept a declaration as a
3569 -- statement, the semantic analyzer may insert declarations (e.g.
3570 -- declarations of implicit types needed for execution of other
3571 -- statements) into a sequence of statements, so the code genmerator
3572 -- should be prepared to accept a declaration where a statement is
3573 -- expected. Note also that pragmas can appear as statements.
3575 --------------------
3577 --------------------
3580 -- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT
3582 -- There is no explicit node in the tree for a statement. Instead, the
3583 -- individual statement appears directly. Labels are treated as a
3584 -- kind of statement, i.e. they are linked into a statement list at
3585 -- the point they appear, so the labeled statement appears following
3586 -- the label or labels in the statement list.
3588 ---------------------------
3589 -- 5.1 Simple Statement --
3590 ---------------------------
3592 -- SIMPLE_STATEMENT ::= NULL_STATEMENT
3593 -- | ASSIGNMENT_STATEMENT | EXIT_STATEMENT
3594 -- | GOTO_STATEMENT | PROCEDURE_CALL_STATEMENT
3595 -- | RETURN_STATEMENT | ENTRY_CALL_STATEMENT
3596 -- | REQUEUE_STATEMENT | DELAY_STATEMENT
3597 -- | ABORT_STATEMENT | RAISE_STATEMENT
3600 -----------------------------
3601 -- 5.1 Compound Statement --
3602 -----------------------------
3604 -- COMPOUND_STATEMENT ::=
3605 -- IF_STATEMENT | CASE_STATEMENT
3606 -- | LOOP_STATEMENT | BLOCK_STATEMENT
3607 -- | ACCEPT_STATEMENT | SELECT_STATEMENT
3609 -------------------------
3610 -- 5.1 Null Statement --
3611 -------------------------
3613 -- NULL_STATEMENT ::= null;
3616 -- Sloc points to NULL
3622 -- LABEL ::= <<label_STATEMENT_IDENTIFIER>>
3624 -- Note that the occurrence of a label is not a defining identifier,
3625 -- but rather a referencing occurrence. The defining occurrence is
3626 -- in the implicit label declaration which occurs in the innermost
3630 -- Sloc points to <<
3631 -- Identifier (Node1) direct name of statement identifier
3632 -- Exception_Junk (Flag7-Sem)
3634 -------------------------------
3635 -- 5.1 Statement Identifier --
3636 -------------------------------
3638 -- STATEMENT_INDENTIFIER ::= DIRECT_NAME
3640 -- The IDENTIFIER of a STATEMENT_IDENTIFIER shall be an identifier
3641 -- (not an OPERATOR_SYMBOL)
3643 -------------------------------
3644 -- 5.2 Assignment Statement --
3645 -------------------------------
3647 -- ASSIGNMENT_STATEMENT ::=
3648 -- variable_NAME := EXPRESSION;
3650 -- N_Assignment_Statement
3651 -- Sloc points to :=
3653 -- Expression (Node3)
3654 -- Do_Tag_Check (Flag13-Sem)
3655 -- Do_Length_Check (Flag4-Sem)
3656 -- Forwards_OK (Flag5-Sem)
3657 -- Backwards_OK (Flag6-Sem)
3658 -- No_Ctrl_Actions (Flag7-Sem)
3660 -- Note: if a range check is required, then the Do_Range_Check flag
3661 -- is set in the Expression (right hand side), with the check being
3662 -- done against the type of the Name (left hand side).
3664 -- Note: the back end places some restrictions on the form of the
3665 -- Expression field. If the object being assigned to is Atomic, then
3666 -- the Expression may not have the form of an aggregate (since this
3667 -- might cause the back end to generate separate assignments). It
3668 -- also cannot be a reference to an object marked as a true constant
3669 -- (Is_True_Constant flag set), where the object is itself initalized
3670 -- with an aggregate. If necessary the front end must generate an
3671 -- extra temporary (with Is_True_Constant set False), and initialize
3672 -- this temporary as required (the temporary itself is not atomic).
3674 -----------------------
3675 -- 5.3 If Statement --
3676 -----------------------
3679 -- if CONDITION then
3680 -- SEQUENCE_OF_STATEMENTS
3681 -- {elsif CONDITION then
3682 -- SEQUENCE_OF_STATEMENTS}
3684 -- SEQUENCE_OF_STATEMENTS]
3687 -- Gigi restriction: This expander ensures that the type of the
3688 -- Condition fields is always Standard.Boolean, even if the type
3689 -- in the source is some non-standard boolean type.
3692 -- Sloc points to IF
3693 -- Condition (Node1)
3694 -- Then_Statements (List2)
3695 -- Elsif_Parts (List3) (set to No_List if none present)
3696 -- Else_Statements (List4) (set to No_List if no else part present)
3697 -- End_Span (Uint5) (set to No_Uint if expander generated)
3700 -- Sloc points to ELSIF
3701 -- Condition (Node1)
3702 -- Then_Statements (List2)
3703 -- Condition_Actions (List3-Sem)
3705 --------------------
3707 --------------------
3709 -- CONDITION ::= boolean_EXPRESSION
3711 -------------------------
3712 -- 5.4 Case Statement --
3713 -------------------------
3715 -- CASE_STATEMENT ::=
3716 -- case EXPRESSION is
3717 -- CASE_STATEMENT_ALTERNATIVE
3718 -- {CASE_STATEMENT_ALTERNATIVE}
3721 -- Note: the Alternatives can contain pragmas. These only occur at
3722 -- the start of the list, since any pragmas occurring after the first
3723 -- alternative are absorbed into the corresponding statement sequence.
3726 -- Sloc points to CASE
3727 -- Expression (Node3)
3728 -- Alternatives (List4)
3729 -- End_Span (Uint5) (set to No_Uint if expander generated)
3731 -------------------------------------
3732 -- 5.4 Case Statement Alternative --
3733 -------------------------------------
3735 -- CASE_STATEMENT_ALTERNATIVE ::=
3736 -- when DISCRETE_CHOICE_LIST =>
3737 -- SEQUENCE_OF_STATEMENTS
3739 -- N_Case_Statement_Alternative
3740 -- Sloc points to WHEN
3741 -- Discrete_Choices (List4)
3742 -- Statements (List3)
3744 -------------------------
3745 -- 5.5 Loop Statement --
3746 -------------------------
3748 -- LOOP_STATEMENT ::=
3749 -- [loop_STATEMENT_IDENTIFIER :]
3750 -- [ITERATION_SCHEME] loop
3751 -- SEQUENCE_OF_STATEMENTS
3752 -- end loop [loop_IDENTIFIER];
3754 -- Note: The occurrence of a loop label is not a defining identifier
3755 -- but rather a referencing occurrence. The defining occurrence is in
3756 -- the implicit label declaration which occurs in the innermost
3759 -- Note: there is always a loop statement identifier present in
3760 -- the tree, even if none was given in the source. In the case where
3761 -- no loop identifier is given in the source, the parser creates
3762 -- a name of the form _Loop_n, where n is a decimal integer (the
3763 -- two underlines ensure that the loop names created in this manner
3764 -- do not conflict with any user defined identifiers), and the flag
3765 -- Has_Created_Identifier is set to True. The only exception to the
3766 -- rule that all loop statement nodes have identifiers occurs for
3767 -- loops constructed by the expander, and the semantic analyzer will
3768 -- create and supply dummy loop identifiers in these cases.
3771 -- Sloc points to LOOP
3772 -- Identifier (Node1) loop identifier (set to Empty if no identifier)
3773 -- Iteration_Scheme (Node2) (set to Empty if no iteration scheme)
3774 -- Statements (List3)
3775 -- End_Label (Node4)
3776 -- Has_Created_Identifier (Flag15)
3777 -- Is_Null_Loop (Flag16)
3779 --------------------------
3780 -- 5.5 Iteration Scheme --
3781 --------------------------
3783 -- ITERATION_SCHEME ::=
3784 -- while CONDITION | for LOOP_PARAMETER_SPECIFICATION
3786 -- Gigi restriction: This expander ensures that the type of the
3787 -- Condition field is always Standard.Boolean, even if the type
3788 -- in the source is some non-standard boolean type.
3790 -- N_Iteration_Scheme
3791 -- Sloc points to WHILE or FOR
3792 -- Condition (Node1) (set to Empty if FOR case)
3793 -- Condition_Actions (List3-Sem)
3794 -- Loop_Parameter_Specification (Node4) (set to Empty if WHILE case)
3796 ---------------------------------------
3797 -- 5.5 Loop parameter specification --
3798 ---------------------------------------
3800 -- LOOP_PARAMETER_SPECIFICATION ::=
3801 -- DEFINING_IDENTIFIER in [reverse] DISCRETE_SUBTYPE_DEFINITION
3803 -- N_Loop_Parameter_Specification
3804 -- Sloc points to first identifier
3805 -- Defining_Identifier (Node1)
3806 -- Reverse_Present (Flag15)
3807 -- Discrete_Subtype_Definition (Node4)
3809 --------------------------
3810 -- 5.6 Block Statement --
3811 --------------------------
3813 -- BLOCK_STATEMENT ::=
3814 -- [block_STATEMENT_IDENTIFIER:]
3816 -- DECLARATIVE_PART]
3818 -- HANDLED_SEQUENCE_OF_STATEMENTS
3819 -- end [block_IDENTIFIER];
3821 -- Note that the occurrence of a block identifier is not a defining
3822 -- identifier, but rather a referencing occurrence. The defining
3823 -- occurrence is in the implicit label declaration which occurs in
3824 -- the innermost enclosing block.
3826 -- Note: there is always a block statement identifier present in
3827 -- the tree, even if none was given in the source. In the case where
3828 -- no block identifier is given in the source, the parser creates
3829 -- a name of the form _Block_n, where n is a decimal integer (the
3830 -- two underlines ensure that the block names created in this manner
3831 -- do not conflict with any user defined identifiers), and the flag
3832 -- Has_Created_Identifier is set to True. The only exception to the
3833 -- rule that all loop statement nodes have identifiers occurs for
3834 -- blocks constructed by the expander, and the semantic analyzer
3835 -- creates and supplies dummy names for the blocks).
3837 -- N_Block_Statement
3838 -- Sloc points to DECLARE or BEGIN
3839 -- Identifier (Node1) block direct name (set to Empty if not present)
3840 -- Declarations (List2) (set to No_List if no DECLARE part)
3841 -- Handled_Statement_Sequence (Node4)
3842 -- Is_Task_Master (Flag5-Sem)
3843 -- Activation_Chain_Entity (Node3-Sem)
3844 -- Has_Created_Identifier (Flag15)
3845 -- Is_Task_Allocation_Block (Flag6)
3846 -- Is_Asynchronous_Call_Block (Flag7)
3848 -------------------------
3849 -- 5.7 Exit Statement --
3850 -------------------------
3852 -- EXIT_STATEMENT ::= exit [loop_NAME] [when CONDITION];
3854 -- Gigi restriction: This expander ensures that the type of the
3855 -- Condition field is always Standard.Boolean, even if the type
3856 -- in the source is some non-standard boolean type.
3859 -- Sloc points to EXIT
3860 -- Name (Node2) (set to Empty if no loop name present)
3861 -- Condition (Node1) (set to Empty if no when part present)
3863 -------------------------
3864 -- 5.9 Goto Statement --
3865 -------------------------
3867 -- GOTO_STATEMENT ::= goto label_NAME;
3870 -- Sloc points to GOTO
3872 -- Exception_Junk (Flag7-Sem)
3874 ---------------------------------
3875 -- 6.1 Subprogram Declaration --
3876 ---------------------------------
3878 -- SUBPROGRAM_DECLARATION ::= SUBPROGRAM_SPECIFICATION;
3880 -- N_Subprogram_Declaration
3881 -- Sloc points to FUNCTION or PROCEDURE
3882 -- Specification (Node1)
3883 -- Body_To_Inline (Node3-Sem)
3884 -- Corresponding_Body (Node5-Sem)
3885 -- Parent_Spec (Node4-Sem)
3887 ------------------------------------------
3888 -- 6.1 Abstract Subprogram Declaration --
3889 ------------------------------------------
3891 -- ABSTRACT_SUBPROGRAM_DECLARATION ::=
3892 -- SUBPROGRAM_SPECIFICATION is abstract;
3894 -- N_Abstract_Subprogram_Declaration
3895 -- Sloc points to ABSTRACT
3896 -- Specification (Node1)
3898 -----------------------------------
3899 -- 6.1 Subprogram Specification --
3900 -----------------------------------
3902 -- SUBPROGRAM_SPECIFICATION ::=
3903 -- [[not] overriding]
3904 -- procedure DEFINING_PROGRAM_UNIT_NAME PARAMETER_PROFILE
3905 -- | [[not] overriding]
3906 -- function DEFINING_DESIGNATOR PARAMETER_AND_RESULT_PROFILE
3908 -- Note: there are no separate nodes for the profiles, instead the
3909 -- information appears directly in the following nodes.
3911 -- N_Function_Specification
3912 -- Sloc points to FUNCTION
3913 -- Defining_Unit_Name (Node1) (the designator)
3914 -- Elaboration_Boolean (Node2-Sem)
3915 -- Parameter_Specifications (List3) (set to No_List if no formal part)
3916 -- Subtype_Mark (Node4) for return type
3917 -- Generic_Parent (Node5-Sem)
3918 -- Must_Override (Flag14) set if overriding indicator present
3919 -- Must_Not_Override (Flag15) set if not_overriding indicator present
3921 -- N_Procedure_Specification
3922 -- Sloc points to PROCEDURE
3923 -- Defining_Unit_Name (Node1)
3924 -- Elaboration_Boolean (Node2-Sem)
3925 -- Parameter_Specifications (List3) (set to No_List if no formal part)
3926 -- Generic_Parent (Node5-Sem)
3927 -- Null_Present (Flag13) set for null procedure case (Ada 2005 feature)
3928 -- Must_Override (Flag14) set if overriding indicator present
3929 -- Must_Not_Override (Flag15) set if not_overriding indicator present
3931 -- Note: overriding indicator is an Ada 2005 feature
3933 ---------------------
3934 -- 6.1 Designator --
3935 ---------------------
3938 -- [PARENT_UNIT_NAME .] IDENTIFIER | OPERATOR_SYMBOL
3940 -- Designators that are simply identifiers or operator symbols appear
3941 -- directly in the tree in this form. The following node is used only
3942 -- in the case where the designator has a parent unit name component.
3945 -- Sloc points to period
3946 -- Name (Node2) holds the parent unit name. Note that this is always
3947 -- non-Empty, since this node is only used for the case where a
3948 -- parent library unit package name is present.
3949 -- Identifier (Node1)
3951 -- Note that the identifier can also be an operator symbol here
3953 ------------------------------
3954 -- 6.1 Defining Designator --
3955 ------------------------------
3957 -- DEFINING_DESIGNATOR ::=
3958 -- DEFINING_PROGRAM_UNIT_NAME | DEFINING_OPERATOR_SYMBOL
3960 -------------------------------------
3961 -- 6.1 Defining Program Unit Name --
3962 -------------------------------------
3964 -- DEFINING_PROGRAM_UNIT_NAME ::=
3965 -- [PARENT_UNIT_NAME .] DEFINING_IDENTIFIER
3967 -- The parent unit name is present only in the case of a child unit
3968 -- name (permissible only for Ada 95 for a library level unit, i.e.
3969 -- a unit at scope level one). If no such name is present, the defining
3970 -- program unit name is represented simply as the defining identifier.
3971 -- In the child unit case, the following node is used to represent the
3974 -- N_Defining_Program_Unit_Name
3975 -- Sloc points to period
3976 -- Name (Node2) holds the parent unit name. Note that this is always
3977 -- non-Empty, since this node is only used for the case where a
3978 -- parent unit name is present.
3979 -- Defining_Identifier (Node1)
3981 --------------------------
3982 -- 6.1 Operator Symbol --
3983 --------------------------
3985 -- OPERATOR_SYMBOL ::= STRING_LITERAL
3987 -- Note: the fields of the N_Operator_Symbol node are laid out to
3988 -- match the corresponding fields of an N_Character_Literal node. This
3989 -- allows easy conversion of the operator symbol node into a character
3990 -- literal node in the case where a string constant of the form of an
3991 -- operator symbol is scanned out as such, but turns out semantically
3992 -- to be a string literal that is not an operator. For details see
3993 -- Sinfo.CN.Change_Operator_Symbol_To_String_Literal.
3995 -- N_Operator_Symbol
3996 -- Sloc points to literal
3997 -- Chars (Name1) contains the Name_Id for the operator symbol
3998 -- Strval (Str3) Id of string value. This is used if the operator
3999 -- symbol turns out to be a normal string after all.
4000 -- Entity (Node4-Sem)
4001 -- Associated_Node (Node4-Sem)
4002 -- Has_Private_View (Flag11-Sem) set in generic units.
4003 -- Etype (Node5-Sem)
4005 -- Note: the Strval field may be set to No_String for generated
4006 -- operator symbols that are known not to be string literals
4009 -----------------------------------
4010 -- 6.1 Defining Operator Symbol --
4011 -----------------------------------
4013 -- DEFINING_OPERATOR_SYMBOL ::= OPERATOR_SYMBOL
4015 -- A defining operator symbol is an entity, which has additional
4016 -- fields depending on the setting of the Ekind field. These
4017 -- additional fields are defined (and access subprograms declared)
4018 -- in package Einfo.
4020 -- Note: N_Defining_Operator_Symbol is an extended node whose fields
4021 -- are deliberately layed out to match the layout of fields in an
4022 -- ordinary N_Operator_Symbol node allowing for easy alteration of
4023 -- an operator symbol node into a defining operator symbol node.
4024 -- See Sinfo.CN.Change_Operator_Symbol_To_Defining_Operator_Symbol
4025 -- for further details.
4027 -- N_Defining_Operator_Symbol
4028 -- Sloc points to literal
4029 -- Chars (Name1) contains the Name_Id for the operator symbol
4030 -- Next_Entity (Node2-Sem)
4031 -- Scope (Node3-Sem)
4032 -- Etype (Node5-Sem)
4034 ----------------------------
4035 -- 6.1 Parameter Profile --
4036 ----------------------------
4038 -- PARAMETER_PROFILE ::= [FORMAL_PART]
4040 ---------------------------------------
4041 -- 6.1 Parameter and Result Profile --
4042 ---------------------------------------
4044 -- PARAMETER_AND_RESULT_PROFILE ::= [FORMAL_PART] return SUBTYPE_MARK
4046 -- There is no explicit node in the tree for a parameter and result
4047 -- profile. Instead the information appears directly in the parent.
4049 ----------------------
4050 -- 6.1 Formal part --
4051 ----------------------
4054 -- (PARAMETER_SPECIFICATION {; PARAMETER_SPECIFICATION})
4056 ----------------------------------
4057 -- 6.1 Parameter specification --
4058 ----------------------------------
4060 -- PARAMETER_SPECIFICATION ::=
4061 -- DEFINING_IDENTIFIER_LIST : MODE [NULL_EXCLUSION] SUBTYPE_MARK
4062 -- [:= DEFAULT_EXPRESSION]
4063 -- | DEFINING_IDENTIFIER_LIST : ACCESS_DEFINITION
4064 -- [:= DEFAULT_EXPRESSION]
4066 -- Although the syntax allows multiple identifiers in the list, the
4067 -- semantics is as though successive specifications were given with
4068 -- identical type definition and expression components. To simplify
4069 -- semantic processing, the parser represents a multiple declaration
4070 -- case as a sequence of single Specifications, using the More_Ids and
4071 -- Prev_Ids flags to preserve the original source form as described
4072 -- in the section on "Handling of Defining Identifier Lists".
4074 -- N_Parameter_Specification
4075 -- Sloc points to first identifier
4076 -- Defining_Identifier (Node1)
4077 -- In_Present (Flag15)
4078 -- Out_Present (Flag17)
4079 -- Null_Exclusion_Present (Flag11)
4080 -- Parameter_Type (Node2) subtype mark or access definition
4081 -- Expression (Node3) (set to Empty if no default expression present)
4082 -- Do_Accessibility_Check (Flag13-Sem)
4083 -- More_Ids (Flag5) (set to False if no more identifiers in list)
4084 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
4085 -- Default_Expression (Node5-Sem)
4091 -- MODE ::= [in] | in out | out
4093 -- There is no explicit node in the tree for the Mode. Instead the
4094 -- In_Present and Out_Present flags are set in the parent node to
4095 -- record the presence of keywords specifying the mode.
4097 --------------------------
4098 -- 6.3 Subprogram Body --
4099 --------------------------
4101 -- SUBPROGRAM_BODY ::=
4102 -- SUBPROGRAM_SPECIFICATION is
4105 -- HANDLED_SEQUENCE_OF_STATEMENTS
4106 -- end [DESIGNATOR];
4108 -- N_Subprogram_Body
4109 -- Sloc points to FUNCTION or PROCEDURE
4110 -- Specification (Node1)
4111 -- Declarations (List2)
4112 -- Handled_Statement_Sequence (Node4)
4113 -- Activation_Chain_Entity (Node3-Sem)
4114 -- Corresponding_Spec (Node5-Sem)
4115 -- Acts_As_Spec (Flag4-Sem)
4116 -- Bad_Is_Detected (Flag15) used only by parser
4117 -- Do_Storage_Check (Flag17-Sem)
4118 -- Has_Priority_Pragma (Flag6-Sem)
4119 -- Is_Protected_Subprogram_Body (Flag7-Sem)
4120 -- Is_Task_Master (Flag5-Sem)
4121 -- Was_Originally_Stub (Flag13-Sem)
4123 -----------------------------------
4124 -- 6.4 Procedure Call Statement --
4125 -----------------------------------
4127 -- PROCEDURE_CALL_STATEMENT ::=
4128 -- procedure_NAME; | procedure_PREFIX ACTUAL_PARAMETER_PART;
4130 -- Note: the reason that a procedure call has expression fields is
4131 -- that it semantically resembles an expression, e.g. overloading is
4132 -- allowed and a type is concocted for semantic processing purposes.
4133 -- Certain of these fields, such as Parens are not relevant, but it
4134 -- is easier to just supply all of them together!
4136 -- N_Procedure_Call_Statement
4137 -- Sloc points to first token of name or prefix
4138 -- Name (Node2) stores name or prefix
4139 -- Parameter_Associations (List3) (set to No_List if no
4140 -- actual parameter part)
4141 -- First_Named_Actual (Node4-Sem)
4142 -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
4143 -- Do_Tag_Check (Flag13-Sem)
4144 -- No_Elaboration_Check (Flag14-Sem)
4145 -- Parameter_List_Truncated (Flag17-Sem)
4146 -- ABE_Is_Certain (Flag18-Sem)
4147 -- plus fields for expression
4149 -- If any IN parameter requires a range check, then the corresponding
4150 -- argument expression has the Do_Range_Check flag set, and the range
4151 -- check is done against the formal type. Note that this argument
4152 -- expression may appear directly in the Parameter_Associations list,
4153 -- or may be a descendent of an N_Parameter_Association node that
4154 -- appears in this list.
4156 ------------------------
4157 -- 6.4 Function Call --
4158 ------------------------
4160 -- FUNCTION_CALL ::=
4161 -- function_NAME | function_PREFIX ACTUAL_PARAMETER_PART
4163 -- Note: the parser may generate an indexed component node or simply
4164 -- a name node instead of a function call node. The semantic pass must
4165 -- correct this misidentification.
4168 -- Sloc points to first token of name or prefix
4169 -- Name (Node2) stores name or prefix
4170 -- Parameter_Associations (List3) (set to No_List if no
4171 -- actual parameter part)
4172 -- First_Named_Actual (Node4-Sem)
4173 -- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
4174 -- Do_Tag_Check (Flag13-Sem)
4175 -- No_Elaboration_Check (Flag14-Sem)
4176 -- Parameter_List_Truncated (Flag17-Sem)
4177 -- ABE_Is_Certain (Flag18-Sem)
4178 -- plus fields for expression
4180 --------------------------------
4181 -- 6.4 Actual Parameter Part --
4182 --------------------------------
4184 -- ACTUAL_PARAMETER_PART ::=
4185 -- (PARAMETER_ASSOCIATION {,PARAMETER_ASSOCIATION})
4187 --------------------------------
4188 -- 6.4 Parameter Association --
4189 --------------------------------
4191 -- PARAMETER_ASSOCIATION ::=
4192 -- [formal_parameter_SELECTOR_NAME =>] EXPLICIT_ACTUAL_PARAMETER
4194 -- Note: the N_Parameter_Association node is built only if a formal
4195 -- parameter selector name is present, otherwise the parameter
4196 -- association appears in the tree simply as the node for the
4197 -- explicit actual parameter.
4199 -- N_Parameter_Association
4200 -- Sloc points to formal parameter
4201 -- Selector_Name (Node2) (always non-Empty, since this node is
4202 -- only used if a formal parameter selector name is present)
4203 -- Explicit_Actual_Parameter (Node3)
4204 -- Next_Named_Actual (Node4-Sem)
4206 ---------------------------
4207 -- 6.4 Actual Parameter --
4208 ---------------------------
4210 -- EXPLICIT_ACTUAL_PARAMETER ::= EXPRESSION | variable_NAME
4212 ---------------------------
4213 -- 6.5 Return Statement --
4214 ---------------------------
4216 -- RETURN_STATEMENT ::= return [EXPRESSION];
4218 -- N_Return_Statement
4219 -- Sloc points to RETURN
4220 -- Expression (Node3) (set to Empty if no expression present)
4221 -- Storage_Pool (Node1-Sem)
4222 -- Procedure_To_Call (Node4-Sem)
4223 -- Do_Tag_Check (Flag13-Sem)
4224 -- Return_Type (Node2-Sem)
4225 -- By_Ref (Flag5-Sem)
4227 -- Note: if a range check is required, then Do_Range_Check is set
4228 -- on the Expression. The range check is against Return_Type.
4230 ------------------------------
4231 -- 7.1 Package Declaration --
4232 ------------------------------
4234 -- PACKAGE_DECLARATION ::= PACKAGE_SPECIFICATION;
4236 -- Note: the activation chain entity for a package spec is used for
4237 -- all tasks declared in the package spec, or in the package body.
4239 -- N_Package_Declaration
4240 -- Sloc points to PACKAGE
4241 -- Specification (Node1)
4242 -- Corresponding_Body (Node5-Sem)
4243 -- Parent_Spec (Node4-Sem)
4244 -- Activation_Chain_Entity (Node3-Sem)
4246 --------------------------------
4247 -- 7.1 Package Specification --
4248 --------------------------------
4250 -- PACKAGE_SPECIFICATION ::=
4251 -- package DEFINING_PROGRAM_UNIT_NAME is
4252 -- {BASIC_DECLARATIVE_ITEM}
4254 -- {BASIC_DECLARATIVE_ITEM}]
4255 -- end [[PARENT_UNIT_NAME .] IDENTIFIER]
4257 -- N_Package_Specification
4258 -- Sloc points to PACKAGE
4259 -- Defining_Unit_Name (Node1)
4260 -- Visible_Declarations (List2)
4261 -- Private_Declarations (List3) (set to No_List if no private
4263 -- End_Label (Node4)
4264 -- Generic_Parent (Node5-Sem)
4265 -- Limited_View_Installed (Flag18-Sem)
4267 -----------------------
4268 -- 7.1 Package Body --
4269 -----------------------
4272 -- package body DEFINING_PROGRAM_UNIT_NAME is
4275 -- HANDLED_SEQUENCE_OF_STATEMENTS]
4276 -- end [[PARENT_UNIT_NAME .] IDENTIFIER];
4279 -- Sloc points to PACKAGE
4280 -- Defining_Unit_Name (Node1)
4281 -- Declarations (List2)
4282 -- Handled_Statement_Sequence (Node4) (set to Empty if no HSS present)
4283 -- Corresponding_Spec (Node5-Sem)
4284 -- Was_Originally_Stub (Flag13-Sem)
4286 -- Note: if a source level package does not contain a handled sequence
4287 -- of statements, then the parser supplies a dummy one with a null
4288 -- sequence of statements. Comes_From_Source will be False in this
4289 -- constructed sequence. The reason we need this is for the End_Label
4290 -- field in the HSS.
4292 -----------------------------------
4293 -- 7.4 Private Type Declaration --
4294 -----------------------------------
4296 -- PRIVATE_TYPE_DECLARATION ::=
4297 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
4298 -- is [[abstract] tagged] [limited] private;
4300 -- Note: TAGGED is not permitted in Ada 83 mode
4302 -- N_Private_Type_Declaration
4303 -- Sloc points to TYPE
4304 -- Defining_Identifier (Node1)
4305 -- Discriminant_Specifications (List4) (set to No_List if no
4306 -- discriminant part)
4307 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
4308 -- Abstract_Present (Flag4)
4309 -- Tagged_Present (Flag15)
4310 -- Limited_Present (Flag17)
4312 ----------------------------------------
4313 -- 7.4 Private Extension Declaration --
4314 ----------------------------------------
4316 -- PRIVATE_EXTENSION_DECLARATION ::=
4317 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] is
4318 -- [abstract] new ancestor_SUBTYPE_INDICATION
4319 -- [and INTERFACE_LIST] with private;
4321 -- Note: private extension declarations are not allowed in Ada 83 mode
4323 -- N_Private_Extension_Declaration
4324 -- Sloc points to TYPE
4325 -- Defining_Identifier (Node1)
4326 -- Discriminant_Specifications (List4) (set to No_List if no
4327 -- discriminant part)
4328 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
4329 -- Abstract_Present (Flag4)
4330 -- Subtype_Indication (Node5)
4331 -- Interface_List (List2) (set to No_List if none)
4333 ---------------------
4334 -- 8.4 Use Clause --
4335 ---------------------
4337 -- USE_CLAUSE ::= USE_PACKAGE_CLAUSE | USE_TYPE_CLAUSE
4339 -----------------------------
4340 -- 8.4 Use Package Clause --
4341 -----------------------------
4343 -- USE_PACKAGE_CLAUSE ::= use package_NAME {, package_NAME};
4345 -- N_Use_Package_Clause
4346 -- Sloc points to USE
4348 -- Next_Use_Clause (Node3-Sem)
4349 -- Hidden_By_Use_Clause (Elist4-Sem)
4351 --------------------------
4352 -- 8.4 Use Type Clause --
4353 --------------------------
4355 -- USE_TYPE_CLAUSE ::= use type SUBTYPE_MARK {, SUBTYPE_MARK};
4357 -- Note: use type clause is not permitted in Ada 83 mode
4359 -- N_Use_Type_Clause
4360 -- Sloc points to USE
4361 -- Subtype_Marks (List2)
4362 -- Next_Use_Clause (Node3-Sem)
4363 -- Hidden_By_Use_Clause (Elist4-Sem)
4365 -------------------------------
4366 -- 8.5 Renaming Declaration --
4367 -------------------------------
4369 -- RENAMING_DECLARATION ::=
4370 -- OBJECT_RENAMING_DECLARATION
4371 -- | EXCEPTION_RENAMING_DECLARATION
4372 -- | PACKAGE_RENAMING_DECLARATION
4373 -- | SUBPROGRAM_RENAMING_DECLARATION
4374 -- | GENERIC_RENAMING_DECLARATION
4376 --------------------------------------
4377 -- 8.5 Object Renaming Declaration --
4378 --------------------------------------
4380 -- OBJECT_RENAMING_DECLARATION ::=
4381 -- DEFINING_IDENTIFIER : SUBTYPE_MARK renames object_NAME;
4382 -- | DEFINING_IDENTIFIER : ACCESS_DEFINITION renames object_NAME;
4384 -- Note: Access_Definition is an optional field that gives support to
4385 -- Ada 2005 (AI-230). The parser generates nodes that have either the
4386 -- Subtype_Indication field or else the Access_Definition field.
4388 -- N_Object_Renaming_Declaration
4389 -- Sloc points to first identifier
4390 -- Defining_Identifier (Node1)
4391 -- Subtype_Mark (Node4) (set to Empty if not present)
4392 -- Access_Definition (Node3) (set to Empty if not present)
4394 -- Corresponding_Generic_Association (Node5-Sem)
4396 -----------------------------------------
4397 -- 8.5 Exception Renaming Declaration --
4398 -----------------------------------------
4400 -- EXCEPTION_RENAMING_DECLARATION ::=
4401 -- DEFINING_IDENTIFIER : exception renames exception_NAME;
4403 -- N_Exception_Renaming_Declaration
4404 -- Sloc points to first identifier
4405 -- Defining_Identifier (Node1)
4408 ---------------------------------------
4409 -- 8.5 Package Renaming Declaration --
4410 ---------------------------------------
4412 -- PACKAGE_RENAMING_DECLARATION ::=
4413 -- package DEFINING_PROGRAM_UNIT_NAME renames package_NAME;
4415 -- N_Package_Renaming_Declaration
4416 -- Sloc points to PACKAGE
4417 -- Defining_Unit_Name (Node1)
4419 -- Parent_Spec (Node4-Sem)
4421 ------------------------------------------
4422 -- 8.5 Subprogram Renaming Declaration --
4423 ------------------------------------------
4425 -- SUBPROGRAM_RENAMING_DECLARATION ::=
4426 -- SUBPROGRAM_SPECIFICATION renames callable_entity_NAME;
4428 -- N_Subprogram_Renaming_Declaration
4429 -- Sloc points to RENAMES
4430 -- Specification (Node1)
4432 -- Parent_Spec (Node4-Sem)
4433 -- Corresponding_Spec (Node5-Sem)
4434 -- Corresponding_Formal_Spec (Node3-Sem)
4435 -- From_Default (Flag6-Sem)
4437 -----------------------------------------
4438 -- 8.5.5 Generic Renaming Declaration --
4439 -----------------------------------------
4441 -- GENERIC_RENAMING_DECLARATION ::=
4442 -- generic package DEFINING_PROGRAM_UNIT_NAME
4443 -- renames generic_package_NAME
4444 -- | generic procedure DEFINING_PROGRAM_UNIT_NAME
4445 -- renames generic_procedure_NAME
4446 -- | generic function DEFINING_PROGRAM_UNIT_NAME
4447 -- renames generic_function_NAME
4449 -- N_Generic_Package_Renaming_Declaration
4450 -- Sloc points to GENERIC
4451 -- Defining_Unit_Name (Node1)
4453 -- Parent_Spec (Node4-Sem)
4455 -- N_Generic_Procedure_Renaming_Declaration
4456 -- Sloc points to GENERIC
4457 -- Defining_Unit_Name (Node1)
4459 -- Parent_Spec (Node4-Sem)
4461 -- N_Generic_Function_Renaming_Declaration
4462 -- Sloc points to GENERIC
4463 -- Defining_Unit_Name (Node1)
4465 -- Parent_Spec (Node4-Sem)
4467 --------------------------------
4468 -- 9.1 Task Type Declaration --
4469 --------------------------------
4471 -- TASK_TYPE_DECLARATION ::=
4472 -- task type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
4473 -- [is [new INTERFACE_LIST with] TASK_DEFINITITION];
4475 -- N_Task_Type_Declaration
4476 -- Sloc points to TASK
4477 -- Defining_Identifier (Node1)
4478 -- Discriminant_Specifications (List4) (set to No_List if no
4479 -- discriminant part)
4480 -- Interface_List (List2) (set to No_List if none)
4481 -- Task_Definition (Node3) (set to Empty if not present)
4482 -- Corresponding_Body (Node5-Sem)
4484 ----------------------------------
4485 -- 9.1 Single Task Declaration --
4486 ----------------------------------
4488 -- SINGLE_TASK_DECLARATION ::=
4489 -- task DEFINING_IDENTIFIER
4490 -- [is [new INTERFACE_LIST with] TASK_DEFINITITION];
4492 -- N_Single_Task_Declaration
4493 -- Sloc points to TASK
4494 -- Defining_Identifier (Node1)
4495 -- Interface_List (List2) (set to No_List if none)
4496 -- Task_Definition (Node3) (set to Empty if not present)
4498 --------------------------
4499 -- 9.1 Task Definition --
4500 --------------------------
4502 -- TASK_DEFINITION ::=
4506 -- end [task_IDENTIFIER]
4508 -- Note: as a result of semantic analysis, the list of task items can
4509 -- include implicit type declarations resulting from entry families.
4511 -- N_Task_Definition
4512 -- Sloc points to first token of task definition
4513 -- Visible_Declarations (List2)
4514 -- Private_Declarations (List3) (set to No_List if no private part)
4515 -- End_Label (Node4)
4516 -- Has_Priority_Pragma (Flag6-Sem)
4517 -- Has_Storage_Size_Pragma (Flag5-Sem)
4518 -- Has_Task_Info_Pragma (Flag7-Sem)
4519 -- Has_Task_Name_Pragma (Flag8-Sem)
4521 --------------------
4523 --------------------
4525 -- TASK_ITEM ::= ENTRY_DECLARATION | REPRESENTATION_CLAUSE
4527 --------------------
4529 --------------------
4532 -- task body task_DEFINING_IDENTIFIER is
4535 -- HANDLED_SEQUENCE_OF_STATEMENTS
4536 -- end [task_IDENTIFIER];
4538 -- Gigi restriction: This node never appears
4541 -- Sloc points to TASK
4542 -- Defining_Identifier (Node1)
4543 -- Declarations (List2)
4544 -- Handled_Statement_Sequence (Node4)
4545 -- Is_Task_Master (Flag5-Sem)
4546 -- Activation_Chain_Entity (Node3-Sem)
4547 -- Corresponding_Spec (Node5-Sem)
4548 -- Was_Originally_Stub (Flag13-Sem)
4550 -------------------------------------
4551 -- 9.4 Protected Type Declaration --
4552 -------------------------------------
4554 -- PROTECTED_TYPE_DECLARATION ::=
4555 -- protected type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
4556 -- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
4558 -- Note: protected type declarations are not permitted in Ada 83 mode
4560 -- N_Protected_Type_Declaration
4561 -- Sloc points to PROTECTED
4562 -- Defining_Identifier (Node1)
4563 -- Discriminant_Specifications (List4) (set to No_List if no
4564 -- discriminant part)
4565 -- Interface_List (List2) (set to No_List if none)
4566 -- Protected_Definition (Node3)
4567 -- Corresponding_Body (Node5-Sem)
4569 ---------------------------------------
4570 -- 9.4 Single Protected Declaration --
4571 ---------------------------------------
4573 -- SINGLE_PROTECTED_DECLARATION ::=
4574 -- protected DEFINING_IDENTIFIER
4575 -- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
4577 -- Note: single protected declarations are not allowed in Ada 83 mode
4579 -- N_Single_Protected_Declaration
4580 -- Sloc points to PROTECTED
4581 -- Defining_Identifier (Node1)
4582 -- Interface_List (List2) (set to No_List if none)
4583 -- Protected_Definition (Node3)
4585 -------------------------------
4586 -- 9.4 Protected Definition --
4587 -------------------------------
4589 -- PROTECTED_DEFINITION ::=
4590 -- {PROTECTED_OPERATION_DECLARATION}
4592 -- {PROTECTED_ELEMENT_DECLARATION}]
4593 -- end [protected_IDENTIFIER]
4595 -- N_Protected_Definition
4596 -- Sloc points to first token of protected definition
4597 -- Visible_Declarations (List2)
4598 -- Private_Declarations (List3) (set to No_List if no private part)
4599 -- End_Label (Node4)
4600 -- Has_Priority_Pragma (Flag6-Sem)
4602 ------------------------------------------
4603 -- 9.4 Protected Operation Declaration --
4604 ------------------------------------------
4606 -- PROTECTED_OPERATION_DECLARATION ::=
4607 -- SUBPROGRAM_DECLARATION
4608 -- | ENTRY_DECLARATION
4609 -- | REPRESENTATION_CLAUSE
4611 ----------------------------------------
4612 -- 9.4 Protected Element Declaration --
4613 ----------------------------------------
4615 -- PROTECTED_ELEMENT_DECLARATION ::=
4616 -- PROTECTED_OPERATION_DECLARATION | COMPONENT_DECLARATION
4618 -------------------------
4619 -- 9.4 Protected Body --
4620 -------------------------
4622 -- PROTECTED_BODY ::=
4623 -- protected body DEFINING_IDENTIFIER is
4624 -- {PROTECTED_OPERATION_ITEM}
4625 -- end [protected_IDENTIFIER];
4627 -- Note: protected bodies are not allowed in Ada 83 mode
4629 -- Gigi restriction: This node never appears
4632 -- Sloc points to PROTECTED
4633 -- Defining_Identifier (Node1)
4634 -- Declarations (List2) protected operation items (and pragmas)
4635 -- End_Label (Node4)
4636 -- Corresponding_Spec (Node5-Sem)
4637 -- Was_Originally_Stub (Flag13-Sem)
4639 -----------------------------------
4640 -- 9.4 Protected Operation Item --
4641 -----------------------------------
4643 -- PROTECTED_OPERATION_ITEM ::=
4644 -- SUBPROGRAM_DECLARATION
4645 -- | SUBPROGRAM_BODY
4647 -- | REPRESENTATION_CLAUSE
4649 ------------------------------
4650 -- 9.5.2 Entry Declaration --
4651 ------------------------------
4653 -- ENTRY_DECLARATION ::=
4654 -- [[not] overriding]
4655 -- entry DEFINING_IDENTIFIER
4656 -- [(DISCRETE_SUBTYPE_DEFINITION)] PARAMETER_PROFILE;
4658 -- N_Entry_Declaration
4659 -- Sloc points to ENTRY
4660 -- Defining_Identifier (Node1)
4661 -- Discrete_Subtype_Definition (Node4) (set to Empty if not present)
4662 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4663 -- Corresponding_Body (Node5-Sem)
4664 -- Must_Override (Flag14) set if overriding indicator present
4665 -- Must_Not_Override (Flag15) set if not_overriding indicator present
4667 -- Note: overriding indicator is an Ada 2005 feature
4669 -----------------------------
4670 -- 9.5.2 Accept statement --
4671 -----------------------------
4673 -- ACCEPT_STATEMENT ::=
4674 -- accept entry_DIRECT_NAME
4675 -- [(ENTRY_INDEX)] PARAMETER_PROFILE [do
4676 -- HANDLED_SEQUENCE_OF_STATEMENTS
4677 -- end [entry_IDENTIFIER]];
4679 -- Gigi restriction: This node never appears
4681 -- Note: there are no explicit declarations allowed in an accept
4682 -- statement. However, the implicit declarations for any statement
4683 -- identifiers (labels and block/loop identifiers) are declarations
4684 -- that belong logically to the accept statement, and that is why
4685 -- there is a Declarations field in this node.
4687 -- N_Accept_Statement
4688 -- Sloc points to ACCEPT
4689 -- Entry_Direct_Name (Node1)
4690 -- Entry_Index (Node5) (set to Empty if not present)
4691 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4692 -- Handled_Statement_Sequence (Node4)
4693 -- Declarations (List2) (set to No_List if no declarations)
4695 ------------------------
4696 -- 9.5.2 Entry Index --
4697 ------------------------
4699 -- ENTRY_INDEX ::= EXPRESSION
4701 -----------------------
4702 -- 9.5.2 Entry Body --
4703 -----------------------
4706 -- entry DEFINING_IDENTIFIER ENTRY_BODY_FORMAL_PART ENTRY_BARRIER is
4709 -- HANDLED_SEQUENCE_OF_STATEMENTS
4710 -- end [entry_IDENTIFIER];
4712 -- ENTRY_BARRIER ::= when CONDITION
4714 -- Note: we store the CONDITION of the ENTRY_BARRIER in the node for
4715 -- the ENTRY_BODY_FORMAL_PART to avoid the N_Entry_Body node getting
4716 -- too full (it would otherwise have too many fields)
4718 -- Gigi restriction: This node never appears
4721 -- Sloc points to ENTRY
4722 -- Defining_Identifier (Node1)
4723 -- Entry_Body_Formal_Part (Node5)
4724 -- Declarations (List2)
4725 -- Handled_Statement_Sequence (Node4)
4726 -- Activation_Chain_Entity (Node3-Sem)
4728 -----------------------------------
4729 -- 9.5.2 Entry Body Formal Part --
4730 -----------------------------------
4732 -- ENTRY_BODY_FORMAL_PART ::=
4733 -- [(ENTRY_INDEX_SPECIFICATION)] PARAMETER_PROFILE
4735 -- Note that an entry body formal part node is present even if it is
4736 -- empty. This reflects the grammar, in which it is the components of
4737 -- the entry body formal part that are optional, not the entry body
4738 -- formal part itself. Also this means that the barrier condition
4739 -- always has somewhere to be stored.
4741 -- Gigi restriction: This node never appears
4743 -- N_Entry_Body_Formal_Part
4744 -- Sloc points to first token
4745 -- Entry_Index_Specification (Node4) (set to Empty if not present)
4746 -- Parameter_Specifications (List3) (set to No_List if no formal part)
4747 -- Condition (Node1) from entry barrier of entry body
4749 --------------------------
4750 -- 9.5.2 Entry Barrier --
4751 --------------------------
4753 -- ENTRY_BARRIER ::= when CONDITION
4755 --------------------------------------
4756 -- 9.5.2 Entry Index Specification --
4757 --------------------------------------
4759 -- ENTRY_INDEX_SPECIFICATION ::=
4760 -- for DEFINING_IDENTIFIER in DISCRETE_SUBTYPE_DEFINITION
4762 -- Gigi restriction: This node never appears
4764 -- N_Entry_Index_Specification
4765 -- Sloc points to FOR
4766 -- Defining_Identifier (Node1)
4767 -- Discrete_Subtype_Definition (Node4)
4769 ---------------------------------
4770 -- 9.5.3 Entry Call Statement --
4771 ---------------------------------
4773 -- ENTRY_CALL_STATEMENT ::= entry_NAME [ACTUAL_PARAMETER_PART];
4775 -- The parser may generate a procedure call for this construct. The
4776 -- semantic pass must correct this misidentification where needed.
4778 -- Gigi restriction: This node never appears
4780 -- N_Entry_Call_Statement
4781 -- Sloc points to first token of name
4783 -- Parameter_Associations (List3) (set to No_List if no
4784 -- actual parameter part)
4785 -- First_Named_Actual (Node4-Sem)
4787 ------------------------------
4788 -- 9.5.4 Requeue Statement --
4789 ------------------------------
4791 -- REQUEUE_STATEMENT ::= requeue entry_NAME [with abort];
4793 -- Note: requeue statements are not permitted in Ada 83 mode
4795 -- Gigi restriction: This node never appears
4797 -- N_Requeue_Statement
4798 -- Sloc points to REQUEUE
4800 -- Abort_Present (Flag15)
4802 --------------------------
4803 -- 9.6 Delay Statement --
4804 --------------------------
4806 -- DELAY_STATEMENT ::=
4807 -- DELAY_UNTIL_STATEMENT
4808 -- | DELAY_RELATIVE_STATEMENT
4810 --------------------------------
4811 -- 9.6 Delay Until Statement --
4812 --------------------------------
4814 -- DELAY_UNTIL_STATEMENT ::= delay until delay_EXPRESSION;
4816 -- Note: delay until statements are not permitted in Ada 83 mode
4818 -- Gigi restriction: This node never appears
4820 -- N_Delay_Until_Statement
4821 -- Sloc points to DELAY
4822 -- Expression (Node3)
4824 -----------------------------------
4825 -- 9.6 Delay Relative Statement --
4826 -----------------------------------
4828 -- DELAY_RELATIVE_STATEMENT ::= delay delay_EXPRESSION;
4830 -- Gigi restriction: This node never appears
4832 -- N_Delay_Relative_Statement
4833 -- Sloc points to DELAY
4834 -- Expression (Node3)
4836 ---------------------------
4837 -- 9.7 Select Statement --
4838 ---------------------------
4840 -- SELECT_STATEMENT ::=
4842 -- | TIMED_ENTRY_CALL
4843 -- | CONDITIONAL_ENTRY_CALL
4844 -- | ASYNCHRONOUS_SELECT
4846 -----------------------------
4847 -- 9.7.1 Selective Accept --
4848 -----------------------------
4850 -- SELECTIVE_ACCEPT ::=
4853 -- SELECT_ALTERNATIVE
4856 -- SELECT_ALTERNATIVE}
4858 -- SEQUENCE_OF_STATEMENTS]
4861 -- Gigi restriction: This node never appears
4863 -- Note: the guard expression, if present, appears in the node for
4864 -- the select alternative.
4866 -- N_Selective_Accept
4867 -- Sloc points to SELECT
4868 -- Select_Alternatives (List1)
4869 -- Else_Statements (List4) (set to No_List if no else part)
4875 -- GUARD ::= when CONDITION =>
4877 -- As noted above, the CONDITION that is part of a GUARD is included
4878 -- in the node for the select alernative for convenience.
4880 -------------------------------
4881 -- 9.7.1 Select Alternative --
4882 -------------------------------
4884 -- SELECT_ALTERNATIVE ::=
4885 -- ACCEPT_ALTERNATIVE
4886 -- | DELAY_ALTERNATIVE
4887 -- | TERMINATE_ALTERNATIVE
4889 -------------------------------
4890 -- 9.7.1 Accept Alternative --
4891 -------------------------------
4893 -- ACCEPT_ALTERNATIVE ::=
4894 -- ACCEPT_STATEMENT [SEQUENCE_OF_STATEMENTS]
4896 -- Gigi restriction: This node never appears
4898 -- N_Accept_Alternative
4899 -- Sloc points to ACCEPT
4900 -- Accept_Statement (Node2)
4901 -- Condition (Node1) from the guard (set to Empty if no guard present)
4902 -- Statements (List3) (set to Empty_List if no statements)
4903 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4904 -- Accept_Handler_Records (List5-Sem)
4906 ------------------------------
4907 -- 9.7.1 Delay Alternative --
4908 ------------------------------
4910 -- DELAY_ALTERNATIVE ::=
4911 -- DELAY_STATEMENT [SEQUENCE_OF_STATEMENTS]
4913 -- Gigi restriction: This node never appears
4915 -- N_Delay_Alternative
4916 -- Sloc points to DELAY
4917 -- Delay_Statement (Node2)
4918 -- Condition (Node1) from the guard (set to Empty if no guard present)
4919 -- Statements (List3) (set to Empty_List if no statements)
4920 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4922 ----------------------------------
4923 -- 9.7.1 Terminate Alternative --
4924 ----------------------------------
4926 -- TERMINATE_ALTERNATIVE ::= terminate;
4928 -- Gigi restriction: This node never appears
4930 -- N_Terminate_Alternative
4931 -- Sloc points to TERMINATE
4932 -- Condition (Node1) from the guard (set to Empty if no guard present)
4933 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4934 -- Pragmas_After (List5) pragmas after alt (set to No_List if none)
4936 -----------------------------
4937 -- 9.7.2 Timed Entry Call --
4938 -----------------------------
4940 -- TIMED_ENTRY_CALL ::=
4942 -- ENTRY_CALL_ALTERNATIVE
4944 -- DELAY_ALTERNATIVE
4947 -- Gigi restriction: This node never appears
4949 -- N_Timed_Entry_Call
4950 -- Sloc points to SELECT
4951 -- Entry_Call_Alternative (Node1)
4952 -- Delay_Alternative (Node4)
4954 -----------------------------------
4955 -- 9.7.2 Entry Call Alternative --
4956 -----------------------------------
4958 -- ENTRY_CALL_ALTERNATIVE ::=
4959 -- ENTRY_CALL_STATEMENT [SEQUENCE_OF_STATEMENTS]
4961 -- Gigi restriction: This node never appears
4963 -- N_Entry_Call_Alternative
4964 -- Sloc points to first token of entry call statement
4965 -- Entry_Call_Statement (Node1)
4966 -- Statements (List3) (set to Empty_List if no statements)
4967 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
4969 -----------------------------------
4970 -- 9.7.3 Conditional Entry Call --
4971 -----------------------------------
4973 -- CONDITIONAL_ENTRY_CALL ::=
4975 -- ENTRY_CALL_ALTERNATIVE
4977 -- SEQUENCE_OF_STATEMENTS
4980 -- Gigi restriction: This node never appears
4982 -- N_Conditional_Entry_Call
4983 -- Sloc points to SELECT
4984 -- Entry_Call_Alternative (Node1)
4985 -- Else_Statements (List4)
4987 --------------------------------
4988 -- 9.7.4 Asynchronous Select --
4989 --------------------------------
4991 -- ASYNCHRONOUS_SELECT ::=
4993 -- TRIGGERING_ALTERNATIVE
4998 -- Note: asynchronous select is not permitted in Ada 83 mode
5000 -- Gigi restriction: This node never appears
5002 -- N_Asynchronous_Select
5003 -- Sloc points to SELECT
5004 -- Triggering_Alternative (Node1)
5005 -- Abortable_Part (Node2)
5007 -----------------------------------
5008 -- 9.7.4 Triggering Alternative --
5009 -----------------------------------
5011 -- TRIGGERING_ALTERNATIVE ::=
5012 -- TRIGGERING_STATEMENT [SEQUENCE_OF_STATEMENTS]
5014 -- Gigi restriction: This node never appears
5016 -- N_Triggering_Alternative
5017 -- Sloc points to first token of triggering statement
5018 -- Triggering_Statement (Node1)
5019 -- Statements (List3) (set to Empty_List if no statements)
5020 -- Pragmas_Before (List4) pragmas before alt (set to No_List if none)
5022 ---------------------------------
5023 -- 9.7.4 Triggering Statement --
5024 ---------------------------------
5026 -- TRIGGERING_STATEMENT ::= ENTRY_CALL_STATEMENT | DELAY_STATEMENT
5028 ---------------------------
5029 -- 9.7.4 Abortable Part --
5030 ---------------------------
5032 -- ABORTABLE_PART ::= SEQUENCE_OF_STATEMENTS
5034 -- Gigi restriction: This node never appears
5037 -- Sloc points to ABORT
5038 -- Statements (List3)
5040 --------------------------
5041 -- 9.8 Abort Statement --
5042 --------------------------
5044 -- ABORT_STATEMENT ::= abort task_NAME {, task_NAME};
5046 -- Gigi restriction: This node never appears
5048 -- N_Abort_Statement
5049 -- Sloc points to ABORT
5052 -------------------------
5053 -- 10.1.1 Compilation --
5054 -------------------------
5056 -- COMPILATION ::= {COMPILATION_UNIT}
5058 -- There is no explicit node in the tree for a compilation, since in
5059 -- general the compiler is processing only a single compilation unit
5060 -- at a time. It is possible to parse multiple units in syntax check
5061 -- only mode, but they the trees are discarded in any case.
5063 ------------------------------
5064 -- 10.1.1 Compilation Unit --
5065 ------------------------------
5067 -- COMPILATION_UNIT ::=
5068 -- CONTEXT_CLAUSE LIBRARY_ITEM
5069 -- | CONTEXT_CLAUSE SUBUNIT
5071 -- The N_Compilation_Unit node itself respresents the above syntax.
5072 -- However, there are two additional items not reflected in the above
5073 -- syntax. First we have the global declarations that are added by the
5074 -- code generator. These are outer level declarations (so they cannot
5075 -- be represented as being inside the units). An example is the wrapper
5076 -- subprograms that are created to do ABE checking. As always a list of
5077 -- declarations can contain actions as well (i.e. statements), and such
5078 -- statements are executed as part of the elaboration of the unit. Note
5079 -- that all such declarations are elaborated before the library unit.
5081 -- Similarly, certain actions need to be elaborated at the completion
5082 -- of elaboration of the library unit (notably the statement that sets
5083 -- the Boolean flag indicating that elaboration is complete).
5085 -- The third item not reflected in the syntax is pragmas that appear
5086 -- after the compilation unit. As always pragmas are a problem since
5087 -- they are not part of the formal syntax, but can be stuck into the
5088 -- source following a set of ad hoc rules, and we have to find an ad
5089 -- hoc way of sticking them into the tree. For pragmas that appear
5090 -- before the library unit, we just consider them to be part of the
5091 -- context clause, and pragmas can appear in the Context_Items list
5092 -- of the compilation unit. However, pragmas can also appear after
5093 -- the library item.
5095 -- To deal with all these problems, we create an auxiliary node for
5096 -- a compilation unit, referenced from the N_Compilation_Unit node
5097 -- that contains these three items.
5099 -- N_Compilation_Unit
5100 -- Sloc points to first token of defining unit name
5101 -- Library_Unit (Node4-Sem) corresponding/parent spec/body
5102 -- Context_Items (List1) context items and pragmas preceding unit
5103 -- Private_Present (Flag15) set if library unit has private keyword
5104 -- Unit (Node2) library item or subunit
5105 -- Aux_Decls_Node (Node5) points to the N_Compilation_Unit_Aux node
5106 -- Has_No_Elaboration_Code (Flag17-Sem)
5107 -- Body_Required (Flag13-Sem) set for spec if body is required
5108 -- Acts_As_Spec (Flag4-Sem) flag for subprogram body with no spec
5109 -- First_Inlined_Subprogram (Node3-Sem)
5111 -- N_Compilation_Unit_Aux
5112 -- Sloc is a copy of the Sloc from the N_Compilation_Unit node
5113 -- Declarations (List2) (set to No_List if no global declarations)
5114 -- Actions (List1) (set to No_List if no actions)
5115 -- Pragmas_After (List5) pragmas after unit (set to No_List if none)
5116 -- Config_Pragmas (List4) config pragmas (set to Empty_List if none)
5118 --------------------------
5119 -- 10.1.1 Library Item --
5120 --------------------------
5123 -- [private] LIBRARY_UNIT_DECLARATION
5124 -- | LIBRARY_UNIT_BODY
5125 -- | [private] LIBRARY_UNIT_RENAMING_DECLARATION
5127 -- Note: PRIVATE is not allowed in Ada 83 mode
5129 -- There is no explicit node in the tree for library item, instead
5130 -- the declaration or body, and the flag for private if present,
5131 -- appear in the N_Compilation_Unit clause.
5133 ----------------------------------------
5134 -- 10.1.1 Library Unit Declararation --
5135 ----------------------------------------
5137 -- LIBRARY_UNIT_DECLARATION ::=
5138 -- SUBPROGRAM_DECLARATION | PACKAGE_DECLARATION
5139 -- | GENERIC_DECLARATION | GENERIC_INSTANTIATION
5141 -------------------------------------------------
5142 -- 10.1.1 Library Unit Renaming Declararation --
5143 -------------------------------------------------
5145 -- LIBRARY_UNIT_RENAMING_DECLARATION ::=
5146 -- PACKAGE_RENAMING_DECLARATION
5147 -- | GENERIC_RENAMING_DECLARATION
5148 -- | SUBPROGRAM_RENAMING_DECLARATION
5150 -------------------------------
5151 -- 10.1.1 Library unit body --
5152 -------------------------------
5154 -- LIBRARY_UNIT_BODY ::= SUBPROGRAM_BODY | PACKAGE_BODY
5156 ------------------------------
5157 -- 10.1.1 Parent Unit Name --
5158 ------------------------------
5160 -- PARENT_UNIT_NAME ::= NAME
5162 ----------------------------
5163 -- 10.1.2 Context clause --
5164 ----------------------------
5166 -- CONTEXT_CLAUSE ::= {CONTEXT_ITEM}
5168 -- The context clause can include pragmas, and any pragmas that appear
5169 -- before the context clause proper (i.e. all configuration pragmas,
5170 -- also appear at the front of this list).
5172 --------------------------
5173 -- 10.1.2 Context_Item --
5174 --------------------------
5176 -- CONTEXT_ITEM ::= WITH_CLAUSE | USE_CLAUSE | WITH_TYPE_CLAUSE
5178 -------------------------
5179 -- 10.1.2 With clause --
5180 -------------------------
5183 -- with library_unit_NAME {,library_unit_NAME};
5185 -- A separate With clause is built for each name, so that we have
5186 -- a Corresponding_Spec field for each with'ed spec. The flags
5187 -- First_Name and Last_Name are used to reconstruct the exact
5188 -- source form. When a list of names appears in one with clause,
5189 -- the first name in the list has First_Name set, and the last
5190 -- has Last_Name set. If the with clause has only one name, then
5191 -- both of the flags First_Name and Last_Name are set in this name.
5193 -- Note: in the case of implicit with's that are installed by the
5194 -- Rtsfind routine, Implicit_With is set, and the Sloc is typically
5195 -- set to Standard_Location, but it is incorrect to test the Sloc
5196 -- to find out if a with clause is implicit, test the flag instead.
5199 -- Sloc points to first token of library unit name
5201 -- Library_Unit (Node4-Sem)
5202 -- Corresponding_Spec (Node5-Sem)
5203 -- First_Name (Flag5) (set to True if first name or only one name)
5204 -- Last_Name (Flag6) (set to True if last name or only one name)
5205 -- Context_Installed (Flag13-Sem)
5206 -- Elaborate_Present (Flag4-Sem)
5207 -- Elaborate_All_Present (Flag14-Sem)
5208 -- Private_Present (Flag15) set if with_clause has private keyword
5209 -- Implicit_With (Flag16-Sem)
5210 -- Limited_Present (Flag17) set if LIMITED is present
5211 -- Limited_View_Installed (Flag18-Sem)
5212 -- Unreferenced_In_Spec (Flag7-Sem)
5213 -- No_Entities_Ref_In_Spec (Flag8-Sem)
5215 -- Note: Limited_Present and Limited_View_Installed give support to
5216 -- Ada 2005 (AI-50217).
5217 -- Similarly, Private_Present gives support to AI-50262.
5219 ----------------------
5220 -- With_Type clause --
5221 ----------------------
5223 -- This is a GNAT extension, used to implement mutually recursive
5224 -- types declared in different packages.
5226 -- WITH_TYPE_CLAUSE ::=
5227 -- with type type_NAME is access | with type type_NAME is tagged
5229 -- N_With_Type_Clause
5230 -- Sloc points to first token of type name
5232 -- Tagged_Present (Flag15)
5234 ---------------------
5235 -- 10.2 Body stub --
5236 ---------------------
5239 -- SUBPROGRAM_BODY_STUB
5240 -- | PACKAGE_BODY_STUB
5242 -- | PROTECTED_BODY_STUB
5244 ----------------------------------
5245 -- 10.1.3 Subprogram Body Stub --
5246 ----------------------------------
5248 -- SUBPROGRAM_BODY_STUB ::=
5249 -- SUBPROGRAM_SPECIFICATION is separate;
5251 -- N_Subprogram_Body_Stub
5252 -- Sloc points to FUNCTION or PROCEDURE
5253 -- Specification (Node1)
5254 -- Library_Unit (Node4-Sem) points to the subunit
5255 -- Corresponding_Body (Node5-Sem)
5257 -------------------------------
5258 -- 10.1.3 Package Body Stub --
5259 -------------------------------
5261 -- PACKAGE_BODY_STUB ::=
5262 -- package body DEFINING_IDENTIFIER is separate;
5264 -- N_Package_Body_Stub
5265 -- Sloc points to PACKAGE
5266 -- Defining_Identifier (Node1)
5267 -- Library_Unit (Node4-Sem) points to the subunit
5268 -- Corresponding_Body (Node5-Sem)
5270 ----------------------------
5271 -- 10.1.3 Task Body Stub --
5272 ----------------------------
5274 -- TASK_BODY_STUB ::=
5275 -- task body DEFINING_IDENTIFIER is separate;
5278 -- Sloc points to TASK
5279 -- Defining_Identifier (Node1)
5280 -- Library_Unit (Node4-Sem) points to the subunit
5281 -- Corresponding_Body (Node5-Sem)
5283 ---------------------------------
5284 -- 10.1.3 Protected Body Stub --
5285 ---------------------------------
5287 -- PROTECTED_BODY_STUB ::=
5288 -- protected body DEFINING_IDENTIFIER is separate;
5290 -- Note: protected body stubs are not allowed in Ada 83 mode
5292 -- N_Protected_Body_Stub
5293 -- Sloc points to PROTECTED
5294 -- Defining_Identifier (Node1)
5295 -- Library_Unit (Node4-Sem) points to the subunit
5296 -- Corresponding_Body (Node5-Sem)
5298 ---------------------
5299 -- 10.1.3 Subunit --
5300 ---------------------
5302 -- SUBUNIT ::= separate (PARENT_UNIT_NAME) PROPER_BODY
5305 -- Sloc points to SEPARATE
5306 -- Name (Node2) is the name of the parent unit
5307 -- Proper_Body (Node1) is the subunit body
5308 -- Corresponding_Stub (Node3-Sem) is the stub declaration for the unit.
5310 ---------------------------------
5311 -- 11.1 Exception Declaration --
5312 ---------------------------------
5314 -- EXCEPTION_DECLARATION ::= DEFINING_IDENTIFIER_LIST : exception;
5316 -- For consistency with object declarations etc, the parser converts
5317 -- the case of multiple identifiers being declared to a series of
5318 -- declarations in which the expression is copied, using the More_Ids
5319 -- and Prev_Ids flags to remember the souce form as described in the
5320 -- section on "Handling of Defining Identifier Lists".
5322 -- N_Exception_Declaration
5323 -- Sloc points to EXCEPTION
5324 -- Defining_Identifier (Node1)
5325 -- Expression (Node3-Sem)
5326 -- More_Ids (Flag5) (set to False if no more identifiers in list)
5327 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
5329 ------------------------------------------
5330 -- 11.2 Handled Sequence Of Statements --
5331 ------------------------------------------
5333 -- HANDLED_SEQUENCE_OF_STATEMENTS ::=
5334 -- SEQUENCE_OF_STATEMENTS
5336 -- EXCEPTION_HANDLER
5337 -- {EXCEPTION_HANDLER}]
5339 -- cleanup_procedure_call (param, param, param, ...);]
5341 -- The AT END phrase is a GNAT extension to provide for cleanups. It is
5342 -- used only internally currently, but is considered to be syntactic.
5343 -- At the moment, the only cleanup action allowed is a single call to
5344 -- a parameterless procedure, and the Identifier field of the node is
5345 -- the procedure to be called. Also there is a current restriction
5346 -- that exception handles and a cleanup cannot be present in the same
5347 -- frame, so at least one of Exception_Handlers or the Identifier must
5350 -- Actually, more accurately, this restriction applies to the original
5351 -- source program. In the expanded tree, if the At_End_Proc field is
5352 -- present, then there will also be an exception handler of the form:
5354 -- when all others =>
5358 -- where cleanup is the procedure to be generated. The reason we do
5359 -- this is so that the front end can handle the necessary entries in
5360 -- the exception tables, and other exception handler actions required
5361 -- as part of the normal handling for exception handlers.
5363 -- The AT END cleanup handler protects only the sequence of statements
5364 -- (not the associated declarations of the parent), just like exception
5365 -- handlers. The big difference is that the cleanup procedure is called
5366 -- on either a normal or an abnormal exit from the statement sequence.
5368 -- Note: the list of Exception_Handlers can contain pragmas as well
5369 -- as actual handlers. In practice these pragmas can only occur at
5370 -- the start of the list, since any pragmas occurring later on will
5371 -- be included in the statement list of the corresponding handler.
5373 -- Note: although in the Ada syntax, the sequence of statements in
5374 -- a handled sequence of statements can only contain statements, we
5375 -- allow free mixing of declarations and statements in the resulting
5376 -- expanded tree. This is for example used to deal with the case of
5377 -- a cleanup procedure that must handle declarations as well as the
5378 -- statements of a block.
5380 -- N_Handled_Sequence_Of_Statements
5381 -- Sloc points to first token of first statement
5382 -- Statements (List3)
5383 -- End_Label (Node4) (set to Empty if expander generated)
5384 -- Exception_Handlers (List5) (set to No_List if none present)
5385 -- At_End_Proc (Node1) (set to Empty if no clean up procedure)
5386 -- First_Real_Statement (Node2-Sem)
5387 -- Zero_Cost_Handling (Flag5-Sem)
5389 -- Note: the parent always contains a Declarations field which contains
5390 -- declarations associated with the handled sequence of statements. This
5391 -- is true even in the case of an accept statement (see description of
5392 -- the N_Accept_Statement node).
5394 -- End_Label refers to the containing construct
5396 -----------------------------
5397 -- 11.2 Exception Handler --
5398 -----------------------------
5400 -- EXCEPTION_HANDLER ::=
5401 -- when [CHOICE_PARAMETER_SPECIFICATION :]
5402 -- EXCEPTION_CHOICE {| EXCEPTION_CHOICE} =>
5403 -- SEQUENCE_OF_STATEMENTS
5405 -- Note: choice parameter specification is not allowed in Ada 83 mode
5407 -- N_Exception_Handler
5408 -- Sloc points to WHEN
5409 -- Choice_Parameter (Node2) (set to Empty if not present)
5410 -- Exception_Choices (List4)
5411 -- Statements (List3)
5412 -- Zero_Cost_Handling (Flag5-Sem)
5414 ------------------------------------------
5415 -- 11.2 Choice parameter specification --
5416 ------------------------------------------
5418 -- CHOICE_PARAMETER_SPECIFICATION ::= DEFINING_IDENTIFIER
5420 ----------------------------
5421 -- 11.2 Exception Choice --
5422 ----------------------------
5424 -- EXCEPTION_CHOICE ::= exception_NAME | others
5426 -- Except in the case of OTHERS, no explicit node appears in the tree
5427 -- for exception choice. Instead the exception name appears directly.
5428 -- An OTHERS choice is represented by a N_Others_Choice node (see
5431 -- Note: for the exception choice created for an at end handler, the
5432 -- exception choice is an N_Others_Choice node with All_Others set.
5434 ---------------------------
5435 -- 11.3 Raise Statement --
5436 ---------------------------
5438 -- RAISE_STATEMENT ::= raise [exception_NAME];
5440 -- In Ada 2005, we have
5442 -- RAISE_STATEMENT ::= raise; | raise exception_NAME [with EXPRESSION];
5444 -- N_Raise_Statement
5445 -- Sloc points to RAISE
5446 -- Name (Node2) (set to Empty if no exception name present)
5447 -- Expression (Node3) (set to Empty if no expression present)
5449 -------------------------------
5450 -- 12.1 Generic Declaration --
5451 -------------------------------
5453 -- GENERIC_DECLARATION ::=
5454 -- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
5456 ------------------------------------------
5457 -- 12.1 Generic Subprogram Declaration --
5458 ------------------------------------------
5460 -- GENERIC_SUBPROGRAM_DECLARATION ::=
5461 -- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION;
5463 -- Note: Generic_Formal_Declarations can include pragmas
5465 -- N_Generic_Subprogram_Declaration
5466 -- Sloc points to GENERIC
5467 -- Specification (Node1) subprogram specification
5468 -- Corresponding_Body (Node5-Sem)
5469 -- Generic_Formal_Declarations (List2) from generic formal part
5470 -- Parent_Spec (Node4-Sem)
5472 ---------------------------------------
5473 -- 12.1 Generic Package Declaration --
5474 ---------------------------------------
5476 -- GENERIC_PACKAGE_DECLARATION ::=
5477 -- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION;
5479 -- Note: when we do generics right, the Activation_Chain_Entity entry
5480 -- for this node can be removed (since the expander won't see generic
5481 -- units any more)???.
5483 -- Note: Generic_Formal_Declarations can include pragmas
5485 -- N_Generic_Package_Declaration
5486 -- Sloc points to GENERIC
5487 -- Specification (Node1) package specification
5488 -- Corresponding_Body (Node5-Sem)
5489 -- Generic_Formal_Declarations (List2) from generic formal part
5490 -- Parent_Spec (Node4-Sem)
5491 -- Activation_Chain_Entity (Node3-Sem)
5493 -------------------------------
5494 -- 12.1 Generic Formal Part --
5495 -------------------------------
5497 -- GENERIC_FORMAL_PART ::=
5498 -- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
5500 ------------------------------------------------
5501 -- 12.1 Generic Formal Parameter Declaration --
5502 ------------------------------------------------
5504 -- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
5505 -- FORMAL_OBJECT_DECLARATION
5506 -- | FORMAL_TYPE_DECLARATION
5507 -- | FORMAL_SUBPROGRAM_DECLARATION
5508 -- | FORMAL_PACKAGE_DECLARATION
5510 ---------------------------------
5511 -- 12.3 Generic Instantiation --
5512 ---------------------------------
5514 -- GENERIC_INSTANTIATION ::=
5515 -- package DEFINING_PROGRAM_UNIT_NAME is
5516 -- new generic_package_NAME [GENERIC_ACTUAL_PART];
5517 -- | [[not] overriding]
5518 -- procedure DEFINING_PROGRAM_UNIT_NAME is
5519 -- new generic_procedure_NAME [GENERIC_ACTUAL_PART];
5520 -- | [[not] overriding]
5521 -- function DEFINING_DESIGNATOR is
5522 -- new generic_function_NAME [GENERIC_ACTUAL_PART];
5524 -- N_Package_Instantiation
5525 -- Sloc points to PACKAGE
5526 -- Defining_Unit_Name (Node1)
5528 -- Generic_Associations (List3) (set to No_List if no
5529 -- generic actual part)
5530 -- Parent_Spec (Node4-Sem)
5531 -- Instance_Spec (Node5-Sem)
5532 -- ABE_Is_Certain (Flag18-Sem)
5534 -- N_Procedure_Instantiation
5535 -- Sloc points to PROCEDURE
5536 -- Defining_Unit_Name (Node1)
5538 -- Parent_Spec (Node4-Sem)
5539 -- Generic_Associations (List3) (set to No_List if no
5540 -- generic actual part)
5541 -- Instance_Spec (Node5-Sem)
5542 -- Must_Override (Flag14) set if overriding indicator present
5543 -- Must_Not_Override (Flag15) set if not_overriding indicator present
5544 -- ABE_Is_Certain (Flag18-Sem)
5546 -- N_Function_Instantiation
5547 -- Sloc points to FUNCTION
5548 -- Defining_Unit_Name (Node1)
5550 -- Generic_Associations (List3) (set to No_List if no
5551 -- generic actual part)
5552 -- Parent_Spec (Node4-Sem)
5553 -- Instance_Spec (Node5-Sem)
5554 -- Must_Override (Flag14) set if overriding indicator present
5555 -- Must_Not_Override (Flag15) set if not_overriding indicator present
5556 -- ABE_Is_Certain (Flag18-Sem)
5558 -- Note: overriding indicator is an Ada 2005 feature
5560 ------------------------------
5561 -- 12.3 Generic Actual Part --
5562 ------------------------------
5564 -- GENERIC_ACTUAL_PART ::=
5565 -- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
5567 -------------------------------
5568 -- 12.3 Generic Association --
5569 -------------------------------
5571 -- GENERIC_ASSOCIATION ::=
5572 -- [generic_formal_parameter_SELECTOR_NAME =>]
5573 -- EXPLICIT_GENERIC_ACTUAL_PARAMETER
5575 -- Note: unlike the procedure call case, a generic association node
5576 -- is generated for every association, even if no formal is present.
5577 -- In this case the parser will leave the Selector_Name field set
5578 -- to Empty, to be filled in later by the semantic pass.
5580 -- N_Generic_Association
5581 -- Sloc points to first token of generic association
5582 -- Selector_Name (Node2) (set to Empty if no formal
5583 -- parameter selector name)
5584 -- Explicit_Generic_Actual_Parameter (Node1)
5586 ---------------------------------------------
5587 -- 12.3 Explicit Generic Actual Parameter --
5588 ---------------------------------------------
5590 -- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
5591 -- EXPRESSION | variable_NAME | subprogram_NAME
5592 -- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
5594 -------------------------------------
5595 -- 12.4 Formal Object Declaration --
5596 -------------------------------------
5598 -- FORMAL_OBJECT_DECLARATION ::=
5599 -- DEFINING_IDENTIFIER_LIST :
5600 -- MODE SUBTYPE_MARK [:= DEFAULT_EXPRESSION];
5602 -- Although the syntax allows multiple identifiers in the list, the
5603 -- semantics is as though successive declarations were given with
5604 -- identical type definition and expression components. To simplify
5605 -- semantic processing, the parser represents a multiple declaration
5606 -- case as a sequence of single declarations, using the More_Ids and
5607 -- Prev_Ids flags to preserve the original source form as described
5608 -- in the section on "Handling of Defining Identifier Lists".
5610 -- N_Formal_Object_Declaration
5611 -- Sloc points to first identifier
5612 -- Defining_Identifier (Node1)
5613 -- In_Present (Flag15)
5614 -- Out_Present (Flag17)
5615 -- Subtype_Mark (Node4)
5616 -- Expression (Node3) (set to Empty if no default expression)
5617 -- More_Ids (Flag5) (set to False if no more identifiers in list)
5618 -- Prev_Ids (Flag6) (set to False if no previous identifiers in list)
5620 -----------------------------------
5621 -- 12.5 Formal Type Declaration --
5622 -----------------------------------
5624 -- FORMAL_TYPE_DECLARATION ::=
5625 -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
5626 -- is FORMAL_TYPE_DEFINITION;
5628 -- N_Formal_Type_Declaration
5629 -- Sloc points to TYPE
5630 -- Defining_Identifier (Node1)
5631 -- Formal_Type_Definition (Node3)
5632 -- Discriminant_Specifications (List4) (set to No_List if no
5633 -- discriminant part)
5634 -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant
5636 ----------------------------------
5637 -- 12.5 Formal type definition --
5638 ----------------------------------
5640 -- FORMAL_TYPE_DEFINITION ::=
5641 -- FORMAL_PRIVATE_TYPE_DEFINITION
5642 -- | FORMAL_DERIVED_TYPE_DEFINITION
5643 -- | FORMAL_DISCRETE_TYPE_DEFINITION
5644 -- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
5645 -- | FORMAL_MODULAR_TYPE_DEFINITION
5646 -- | FORMAL_FLOATING_POINT_DEFINITION
5647 -- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
5648 -- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
5649 -- | FORMAL_ARRAY_TYPE_DEFINITION
5650 -- | FORMAL_ACCESS_TYPE_DEFINITION
5651 -- | FORMAL_INTERFACE_TYPE_DEFINITION
5653 ---------------------------------------------
5654 -- 12.5.1 Formal Private Type Definition --
5655 ---------------------------------------------
5657 -- FORMAL_PRIVATE_TYPE_DEFINITION ::=
5658 -- [[abstract] tagged] [limited] private
5660 -- Note: TAGGED is not allowed in Ada 83 mode
5662 -- N_Formal_Private_Type_Definition
5663 -- Sloc points to PRIVATE
5664 -- Abstract_Present (Flag4)
5665 -- Tagged_Present (Flag15)
5666 -- Limited_Present (Flag17)
5668 --------------------------------------------
5669 -- 12.5.1 Formal Derived Type Definition --
5670 --------------------------------------------
5672 -- FORMAL_DERIVED_TYPE_DEFINITION ::=
5673 -- [abstract] new SUBTYPE_MARK [[and INTERFACE_LIST] with private]
5674 -- Note: this construct is not allowed in Ada 83 mode
5676 -- N_Formal_Derived_Type_Definition
5677 -- Sloc points to NEW
5678 -- Subtype_Mark (Node4)
5679 -- Private_Present (Flag15)
5680 -- Abstract_Present (Flag4)
5681 -- Interface_List (List2) (set to No_List if none)
5683 ---------------------------------------------
5684 -- 12.5.2 Formal Discrete Type Definition --
5685 ---------------------------------------------
5687 -- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
5689 -- N_Formal_Discrete_Type_Definition
5692 ---------------------------------------------------
5693 -- 12.5.2 Formal Signed Integer Type Definition --
5694 ---------------------------------------------------
5696 -- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
5698 -- N_Formal_Signed_Integer_Type_Definition
5699 -- Sloc points to RANGE
5701 --------------------------------------------
5702 -- 12.5.2 Formal Modular Type Definition --
5703 --------------------------------------------
5705 -- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
5707 -- N_Formal_Modular_Type_Definition
5708 -- Sloc points to MOD
5710 ----------------------------------------------
5711 -- 12.5.2 Formal Floating Point Definition --
5712 ----------------------------------------------
5714 -- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
5716 -- N_Formal_Floating_Point_Definition
5717 -- Sloc points to DIGITS
5719 ----------------------------------------------------
5720 -- 12.5.2 Formal Ordinary Fixed Point Definition --
5721 ----------------------------------------------------
5723 -- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
5725 -- N_Formal_Ordinary_Fixed_Point_Definition
5726 -- Sloc points to DELTA
5728 ---------------------------------------------------
5729 -- 12.5.2 Formal Decimal Fixed Point Definition --
5730 ---------------------------------------------------
5732 -- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
5734 -- Note: formal decimal fixed point definition not allowed in Ada 83
5736 -- N_Formal_Decimal_Fixed_Point_Definition
5737 -- Sloc points to DELTA
5739 ------------------------------------------
5740 -- 12.5.3 Formal Array Type Definition --
5741 ------------------------------------------
5743 -- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
5745 -------------------------------------------
5746 -- 12.5.4 Formal Access Type Definition --
5747 -------------------------------------------
5749 -- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
5751 ----------------------------------------------
5752 -- 12.5.5 Formal Interface Type Definition --
5753 ----------------------------------------------
5755 -- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
5757 -----------------------------------------
5758 -- 12.6 Formal Subprogram Declaration --
5759 -----------------------------------------
5761 -- FORMAL_SUBPROGRAM_DECLARATION ::=
5762 -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
5763 -- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
5765 --------------------------------------------------
5766 -- 12.6 Formal Concrete Subprogram Declaration --
5767 --------------------------------------------------
5769 -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
5770 -- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
5772 -- N_Formal_Concrete_Subprogram_Declaration
5773 -- Sloc points to WITH
5774 -- Specification (Node1)
5775 -- Default_Name (Node2) (set to Empty if no subprogram default)
5776 -- Box_Present (Flag15)
5778 -- Note: if no subprogram default is present, then Name is set
5779 -- to Empty, and Box_Present is False.
5781 --------------------------------------------------
5782 -- 12.6 Formal Abstract Subprogram Declaration --
5783 --------------------------------------------------
5785 -- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
5786 -- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT];
5788 -- N_Formal_Abstract_Subprogram_Declaration
5789 -- Sloc points to WITH
5790 -- Specification (Node1)
5791 -- Default_Name (Node2) (set to Empty if no subprogram default)
5792 -- Box_Present (Flag15)
5794 -- Note: if no subprogram default is present, then Name is set
5795 -- to Empty, and Box_Present is False.
5797 ------------------------------
5798 -- 12.6 Subprogram Default --
5799 ------------------------------
5801 -- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
5803 -- There is no separate node in the tree for a subprogram default.
5804 -- Instead the parent (N_Formal_Concrete_Subprogram_Declaration
5805 -- or N_Formal_Abstract_Subprogram_Declaration) node contains the
5806 -- default name or box indication, as needed.
5808 ------------------------
5809 -- 12.6 Default Name --
5810 ------------------------
5812 -- DEFAULT_NAME ::= NAME
5814 --------------------------------------
5815 -- 12.7 Formal Package Declaration --
5816 --------------------------------------
5818 -- FORMAL_PACKAGE_DECLARATION ::=
5819 -- with package DEFINING_IDENTIFIER
5820 -- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART;
5822 -- Note: formal package declarations not allowed in Ada 83 mode
5824 -- N_Formal_Package_Declaration
5825 -- Sloc points to WITH
5826 -- Defining_Identifier (Node1)
5828 -- Generic_Associations (List3) (set to No_List if (<>) case or
5829 -- empty generic actual part)
5830 -- Box_Present (Flag15)
5831 -- Instance_Spec (Node5-Sem)
5832 -- ABE_Is_Certain (Flag18-Sem)
5834 --------------------------------------
5835 -- 12.7 Formal Package Actual Part --
5836 --------------------------------------
5838 -- FORMAL_PACKAGE_ACTUAL_PART ::=
5839 -- (<>) | [GENERIC_ACTUAL_PART]
5841 -- There is no explicit node in the tree for a formal package
5842 -- actual part. Instead the information appears in the parent node
5843 -- (i.e. the formal package declaration node itself).
5845 ---------------------------------
5846 -- 13.1 Representation clause --
5847 ---------------------------------
5849 -- REPRESENTATION_CLAUSE ::=
5850 -- ATTRIBUTE_DEFINITION_CLAUSE
5851 -- | ENUMERATION_REPRESENTATION_CLAUSE
5852 -- | RECORD_REPRESENTATION_CLAUSE
5855 ----------------------
5856 -- 13.1 Local Name --
5857 ----------------------
5861 -- | DIRECT_NAME'ATTRIBUTE_DESIGNATOR
5862 -- | library_unit_NAME
5864 -- The construct DIRECT_NAME'ATTRIBUTE_DESIGNATOR appears in the tree
5865 -- as an attribute reference, which has essentially the same form.
5867 ---------------------------------------
5868 -- 13.3 Attribute definition clause --
5869 ---------------------------------------
5871 -- ATTRIBUTE_DEFINITION_CLAUSE ::=
5872 -- for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use EXPRESSION;
5873 -- | for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use NAME;
5875 -- In Ada 83, the expression must be a simple expression and the
5876 -- local name must be a direct name.
5878 -- Note: the only attribute definition clause that is processed by
5879 -- gigi is an address clause. For all other cases, the information
5880 -- is extracted by the front end and either results in setting entity
5881 -- information, e.g. Esize for the Size clause, or in appropriate
5882 -- expansion actions (e.g. in the case of Storage_Size).
5884 -- For an address clause, Gigi constructs the appropriate addressing
5885 -- code. It also ensures that no aliasing optimizations are made
5886 -- for the object for which the address clause appears.
5888 -- Note: for an address clause used to achieve an overlay:
5892 -- for B'Address use A'Address;
5894 -- the above rule means that Gigi will ensure that no optimizations
5895 -- will be made for B that would violate the implementation advice
5896 -- of RM 13.3(19). However, this advice applies only to B and not
5897 -- to A, which seems unfortunate. The GNAT front end will mark the
5898 -- object A as volatile to also prevent unwanted optimization
5899 -- assumptions based on no aliasing being made for B.
5901 -- N_Attribute_Definition_Clause
5902 -- Sloc points to FOR
5903 -- Name (Node2) the local name
5904 -- Chars (Name1) the identifier name from the attribute designator
5905 -- Expression (Node3) the expression or name
5906 -- Next_Rep_Item (Node4-Sem)
5907 -- From_At_Mod (Flag4-Sem)
5908 -- Check_Address_Alignment (Flag11-Sem)
5910 ---------------------------------------------
5911 -- 13.4 Enumeration representation clause --
5912 ---------------------------------------------
5914 -- ENUMERATION_REPRESENTATION_CLAUSE ::=
5915 -- for first_subtype_LOCAL_NAME use ENUMERATION_AGGREGATE;
5917 -- In Ada 83, the name must be a direct name
5919 -- N_Enumeration_Representation_Clause
5920 -- Sloc points to FOR
5921 -- Identifier (Node1) direct name
5922 -- Array_Aggregate (Node3)
5923 -- Next_Rep_Item (Node4-Sem)
5925 ---------------------------------
5926 -- 13.4 Enumeration aggregate --
5927 ---------------------------------
5929 -- ENUMERATION_AGGREGATE ::= ARRAY_AGGREGATE
5931 ------------------------------------------
5932 -- 13.5.1 Record representation clause --
5933 ------------------------------------------
5935 -- RECORD_REPRESENTATION_CLAUSE ::=
5936 -- for first_subtype_LOCAL_NAME use
5937 -- record [MOD_CLAUSE]
5938 -- {COMPONENT_CLAUSE}
5941 -- Gigi restriction: Mod_Clause is always Empty (if present it is
5942 -- replaced by a corresponding Alignment attribute definition clause).
5944 -- Note: Component_Clauses can include pragmas
5946 -- N_Record_Representation_Clause
5947 -- Sloc points to FOR
5948 -- Identifier (Node1) direct name
5949 -- Mod_Clause (Node2) (set to Empty if no mod clause present)
5950 -- Component_Clauses (List3)
5951 -- Next_Rep_Item (Node4-Sem)
5953 ------------------------------
5954 -- 13.5.1 Component clause --
5955 ------------------------------
5957 -- COMPONENT_CLAUSE ::=
5958 -- component_LOCAL_NAME at POSITION
5959 -- range FIRST_BIT .. LAST_BIT;
5961 -- N_Component_Clause
5962 -- Sloc points to AT
5963 -- Component_Name (Node1) points to Name or Attribute_Reference
5965 -- First_Bit (Node3)
5968 ----------------------
5969 -- 13.5.1 Position --
5970 ----------------------
5972 -- POSITION ::= static_EXPRESSION
5974 -----------------------
5975 -- 13.5.1 First_Bit --
5976 -----------------------
5978 -- FIRST_BIT ::= static_SIMPLE_EXPRESSION
5980 ----------------------
5981 -- 13.5.1 Last_Bit --
5982 ----------------------
5984 -- LAST_BIT ::= static_SIMPLE_EXPRESSION
5986 --------------------------
5987 -- 13.8 Code statement --
5988 --------------------------
5990 -- CODE_STATEMENT ::= QUALIFIED_EXPRESSION;
5992 -- Note: in GNAT, the qualified expression has the form
5994 -- Asm_Insn'(Asm (...));
5998 -- Asm_Insn'(Asm_Volatile (...))
6000 -- See package System.Machine_Code in file s-maccod.ads for details
6001 -- on the allowed parameters to Asm[_Volatile]. There are two ways
6002 -- this node can arise, as a code statement, in which case the
6003 -- expression is the qualified expression, or as a result of the
6004 -- expansion of an intrinsic call to the Asm or Asm_Input procedure.
6007 -- Sloc points to first token of the expression
6008 -- Expression (Node3)
6010 -- Note: package Exp_Code contains an abstract functional interface
6011 -- for use by Gigi in accessing the data from N_Code_Statement nodes.
6013 ------------------------
6014 -- 13.12 Restriction --
6015 ------------------------
6018 -- restriction_IDENTIFIER
6019 -- | restriction_parameter_IDENTIFIER => EXPRESSION
6021 -- There is no explicit node for restrictions. Instead the restriction
6022 -- appears in normal pragma syntax as a pragma argument association,
6023 -- which has the same syntactic form.
6025 --------------------------
6026 -- B.2 Shift Operators --
6027 --------------------------
6029 -- Calls to the intrinsic shift functions are converted to one of
6030 -- the following shift nodes, which have the form of normal binary
6031 -- operator names. Note that for a given shift operation, one node
6032 -- covers all possible types, as for normal operators.
6034 -- Note: it is perfectly permissible for the expander to generate
6035 -- shift operation nodes directly, in which case they will be analyzed
6036 -- and parsed in the usual manner.
6038 -- Sprint syntax: shift-function-name!(expr, count)
6040 -- Note: the Left_Opnd field holds the first argument (the value to
6041 -- be shifted). The Right_Opnd field holds the second argument (the
6042 -- shift count). The Chars field is the name of the intrinsic function.
6045 -- Sloc points to the function name
6046 -- plus fields for binary operator
6047 -- plus fields for expression
6048 -- Shift_Count_OK (Flag4-Sem)
6050 -- N_Op_Rotate_Right
6051 -- Sloc points to the function name
6052 -- plus fields for binary operator
6053 -- plus fields for expression
6054 -- Shift_Count_OK (Flag4-Sem)
6057 -- Sloc points to the function name
6058 -- plus fields for binary operator
6059 -- plus fields for expression
6060 -- Shift_Count_OK (Flag4-Sem)
6062 -- N_Op_Shift_Right_Arithmetic
6063 -- Sloc points to the function name
6064 -- plus fields for binary operator
6065 -- plus fields for expression
6066 -- Shift_Count_OK (Flag4-Sem)
6069 -- Sloc points to the function name
6070 -- plus fields for binary operator
6071 -- plus fields for expression
6072 -- Shift_Count_OK (Flag4-Sem)
6074 --------------------------
6075 -- Obsolescent Features --
6076 --------------------------
6078 -- The syntax descriptions and tree nodes for obsolescent features are
6079 -- grouped together, corresponding to their location in appendix I in
6080 -- the RM. However, parsing and semantic analysis for these constructs
6081 -- is located in an appropriate chapter (see individual notes).
6083 ---------------------------
6084 -- J.3 Delta Constraint --
6085 ---------------------------
6087 -- Note: the parse routine for this construct is located in section
6088 -- 3.5.9 of Par-Ch3, and semantic analysis is in Sem_Ch3, which is
6089 -- where delta constraint logically belongs.
6091 -- DELTA_CONSTRAINT ::= DELTA static_EXPRESSION [RANGE_CONSTRAINT]
6093 -- N_Delta_Constraint
6094 -- Sloc points to DELTA
6095 -- Delta_Expression (Node3)
6096 -- Range_Constraint (Node4) (set to Empty if not present)
6098 --------------------
6100 --------------------
6102 -- AT_CLAUSE ::= for DIRECT_NAME use at EXPRESSION;
6104 -- Note: the parse routine for this construct is located in Par-Ch13,
6105 -- and the semantic analysis is in Sem_Ch13, where at clause logically
6106 -- belongs if it were not obsolescent.
6108 -- Note: in Ada 83 the expression must be a simple expression
6110 -- Gigi restriction: This node never appears, it is rewritten as an
6111 -- address attribute definition clause.
6114 -- Sloc points to FOR
6115 -- Identifier (Node1)
6116 -- Expression (Node3)
6118 ---------------------
6119 -- J.8 Mod clause --
6120 ---------------------
6122 -- MOD_CLAUSE ::= at mod static_EXPRESSION;
6124 -- Note: the parse routine for this construct is located in Par-Ch13,
6125 -- and the semantic analysis is in Sem_Ch13, where mod clause logically
6126 -- belongs if it were not obsolescent.
6128 -- Note: in Ada 83, the expression must be a simple expression
6130 -- Gigi restriction: this node never appears. It is replaced
6131 -- by a corresponding Alignment attribute definition clause.
6133 -- Note: pragmas can appear before and after the MOD_CLAUSE since
6134 -- its name has "clause" in it. This is rather strange, but is quite
6135 -- definitely specified. The pragmas before are collected in the
6136 -- Pragmas_Before field of the mod clause node itself, and pragmas
6137 -- after are simply swallowed up in the list of component clauses.
6140 -- Sloc points to AT
6141 -- Expression (Node3)
6142 -- Pragmas_Before (List4) Pragmas before mod clause (No_List if none)
6144 --------------------
6145 -- Semantic Nodes --
6146 --------------------
6148 -- These semantic nodes are used to hold additional semantic information.
6149 -- They are inserted into the tree as a result of semantic processing.
6150 -- Although there are no legitimate source syntax constructions that
6151 -- correspond directly to these nodes, we need a source syntax for the
6152 -- reconstructed tree printed by Sprint, and the node descriptions here
6153 -- show this syntax.
6155 ----------------------------
6156 -- Conditional Expression --
6157 ----------------------------
6159 -- This node is used to represent an expression corresponding to the
6160 -- C construct (condition ? then-expression : else_expression), where
6161 -- Expressions is a three element list, whose first expression is the
6162 -- condition, and whose second and third expressions are the then and
6163 -- else expressions respectively.
6165 -- Note: the Then_Actions and Else_Actions fields are always set to
6166 -- No_List in the tree passed to Gigi. These fields are used only
6167 -- for temporary processing purposes in the expander.
6169 -- Sprint syntax: (if expr then expr else expr)
6171 -- N_Conditional_Expression
6172 -- Sloc points to related node
6173 -- Expressions (List1)
6174 -- Then_Actions (List2-Sem)
6175 -- Else_Actions (List3-Sem)
6176 -- plus fields for expression
6178 -- Note: in the case where a debug source file is generated, the Sloc
6179 -- for this node points to the IF keyword in the Sprint file output.
6185 -- The N_Expanded_Name node is used to represent a selected component
6186 -- name that has been resolved to an expanded name. The semantic phase
6187 -- replaces N_Selected_Component nodes that represent names by the use
6188 -- of this node, leaving the N_Selected_Component node used only when
6189 -- the prefix is a record or protected type.
6191 -- The fields of the N_Expanded_Name node are layed out identically
6192 -- to those of the N_Selected_Component node, allowing conversion of
6193 -- an expanded name node to a selected component node to be done
6194 -- easily, see Sinfo.CN.Change_Selected_Component_To_Expanded_Name.
6196 -- There is no special sprint syntax for an expanded name
6199 -- Sloc points to the period
6200 -- Chars (Name1) copy of Chars field of selector name
6202 -- Selector_Name (Node2)
6203 -- Entity (Node4-Sem)
6204 -- Associated_Node (Node4-Sem)
6205 -- Redundant_Use (Flag13-Sem)
6206 -- Has_Private_View (Flag11-Sem) set in generic units.
6207 -- plus fields for expression
6209 --------------------
6210 -- Free Statement --
6211 --------------------
6213 -- The N_Free_Statement node is generated as a result of a call to an
6214 -- instantiation of Unchecked_Deallocation. The instantiation of this
6215 -- generic is handled specially and generates this node directly.
6217 -- Sprint syntax: free expression
6220 -- Sloc is copied from the unchecked deallocation call
6221 -- Expression (Node3) argument to unchecked deallocation call
6222 -- Storage_Pool (Node1-Sem)
6223 -- Procedure_To_Call (Node4-Sem)
6225 -- Note: in the case where a debug source file is generated, the Sloc
6226 -- for this node points to the FREE keyword in the Sprint file output.
6232 -- This node marks the point in a declarative part at which an entity
6233 -- declared therein becomes frozen. The expander places initialization
6234 -- procedures for types at those points. Gigi uses the freezing point
6235 -- to elaborate entities that may depend on previous private types.
6237 -- See the section in Einfo "Delayed Freezing and Elaboration" for
6238 -- a full description of the use of this node.
6240 -- The Entity field points back to the entity for the type (whose
6241 -- Freeze_Node field points back to this freeze node).
6243 -- The Actions field contains a list of declarations and statements
6244 -- generated by the expander which are associated with the freeze
6245 -- node, and are elaborated as though the freeze node were replaced
6246 -- by this sequence of actions.
6248 -- Note: the Sloc field in the freeze node references a construct
6249 -- associated with the freezing point. This is used for posting
6250 -- messages in some error/warning situations, e.g. the case where
6251 -- a primitive operation of a tagged type is declared too late.
6253 -- Sprint syntax: freeze entity-name [
6258 -- Sloc points near freeze point (see above special note)
6259 -- Entity (Node4-Sem)
6260 -- Access_Types_To_Process (Elist2-Sem) (set to No_Elist if none)
6261 -- TSS_Elist (Elist3-Sem) (set to No_Elist if no associated TSS's)
6262 -- Actions (List1) (set to No_List if no freeze actions)
6263 -- First_Subtype_Link (Node5-Sem) (set to Empty if no link)
6265 -- The Actions field holds actions associated with the freeze. These
6266 -- actions are elaborated at the point where the type is frozen.
6268 -- Note: in the case where a debug source file is generated, the Sloc
6269 -- for this node points to the FREEZE keyword in the Sprint file output.
6271 --------------------------------
6272 -- Implicit Label Declaration --
6273 --------------------------------
6275 -- An implicit label declaration is created for every occurrence of a
6276 -- label on a statement or a label on a block or loop. It is chained
6277 -- in the declarations of the innermost enclosing block as specified
6278 -- in RM section 5.1 (3).
6280 -- The Defining_Identifier is the actual identifier for the
6281 -- statement identifier. Note that the occurrence of the label
6282 -- is a reference, NOT the defining occurrence. The defining
6283 -- occurrence occurs at the head of the innermost enclosing
6284 -- block, and is represented by this node.
6286 -- Note: from the grammar, this might better be called an implicit
6287 -- statement identifier declaration, but the term we choose seems
6288 -- friendlier, since at least informally statement identifiers are
6289 -- called labels in both cases (i.e. when used in labels, and when
6290 -- used as the identifiers of blocks and loops).
6292 -- Note: although this is logically a semantic node, since it does
6293 -- not correspond directly to a source syntax construction, these
6294 -- nodes are actually created by the parser in a post pass done just
6295 -- after parsing is complete, before semantic analysis is started (see
6296 -- the Par.Labl subunit in file par-labl.adb).
6298 -- Sprint syntax: labelname : label;
6300 -- N_Implicit_Label_Declaration
6301 -- Sloc points to the << of the label
6302 -- Defining_Identifier (Node1)
6303 -- Label_Construct (Node2-Sem)
6305 -- Note: in the case where a debug source file is generated, the Sloc
6306 -- for this node points to the label name in the generated declaration.
6308 ---------------------
6309 -- Itype_Reference --
6310 ---------------------
6312 -- This node is used to create a reference to an Itype. The only
6313 -- purpose is to make sure that the Itype is defined if this is the
6316 -- A typical use of this node is when an Itype is to be referenced in
6317 -- two branches of an if statement. In this case it is important that
6318 -- the first use of the Itype not be inside the conditional, since
6319 -- then it might not be defined if the wrong branch of the if is
6320 -- taken in the case where the definition generates elaboration code.
6322 -- The Itype field points to the referenced Itype
6324 -- sprint syntax: reference itype-name
6326 -- N_Itype_Reference
6327 -- Sloc points to the node generating the reference
6328 -- Itype (Node1-Sem)
6330 -- Note: in the case where a debug source file is generated, the Sloc
6331 -- for this node points to the REFERENCE keyword in the file output.
6333 ---------------------
6334 -- Raise_xxx_Error --
6335 ---------------------
6337 -- One of these nodes is created during semantic analysis to replace
6338 -- a node for an expression that is determined to definitely raise
6339 -- the corresponding exception.
6341 -- The N_Raise_xxx_Error node may also stand alone in place
6342 -- of a declaration or statement, in which case it simply causes
6343 -- the exception to be raised (i.e. it is equivalent to a raise
6344 -- statement that raises the corresponding exception). This use
6345 -- is distinguished by the fact that the Etype in this case is
6346 -- Standard_Void_Type, In the subexprssion case, the Etype is the
6347 -- same as the type of the subexpression which it replaces.
6349 -- If Condition is empty, then the raise is unconditional. If the
6350 -- Condition field is non-empty, it is a boolean expression which
6351 -- is first evaluated, and the exception is raised only if the
6352 -- value of the expression is True. In the unconditional case, the
6353 -- creation of this node is usually accompanied by a warning message
6354 -- error. The creation of this node will usually be accompanied by a
6355 -- message (unless it appears within the right operand of a short
6356 -- circuit form whose left argument is static and decisively
6357 -- eliminates elaboration of the raise operation.
6359 -- The exception is generated with a message that contains the
6360 -- file name and line number, and then appended text. The Reason
6361 -- code shows the text to be added. The Reason code is an element
6362 -- of the type Types.RT_Exception_Code, and indicates both the
6363 -- message to be added, and the exception to be raised (which must
6364 -- match the node type). The value is stored by storing a Uint which
6365 -- is the Pos value of the enumeration element in this type.
6367 -- Gigi restriction: This expander ensures that the type of the
6368 -- Condition field is always Standard.Boolean, even if the type
6369 -- in the source is some non-standard boolean type.
6371 -- Sprint syntax: [xxx_error "msg"]
6372 -- or: [xxx_error when condition "msg"]
6374 -- N_Raise_Constraint_Error
6375 -- Sloc references related construct
6376 -- Condition (Node1) (set to Empty if no condition)
6378 -- plus fields for expression
6380 -- N_Raise_Program_Error
6381 -- Sloc references related construct
6382 -- Condition (Node1) (set to Empty if no condition)
6384 -- plus fields for expression
6386 -- N_Raise_Storage_Error
6387 -- Sloc references related construct
6388 -- Condition (Node1) (set to Empty if no condition)
6390 -- plus fields for expression
6392 -- Note: Sloc is copied from the expression generating the exception.
6393 -- In the case where a debug source file is generated, the Sloc for
6394 -- this node points to the left bracket in the Sprint file output.
6400 -- For a number of purposes, we need to construct references to objects.
6401 -- These references are subsequently treated as normal access values.
6402 -- An example is the construction of the parameter block passed to a
6403 -- task entry. The N_Reference node is provided for this purpose. It is
6404 -- similar in effect to the use of the Unrestricted_Access attribute,
6405 -- and like Unrestricted_Access can be applied to objects which would
6406 -- not be valid prefixes for the Unchecked_Access attribute (e.g.
6407 -- objects which are not aliased, and slices). In addition it can be
6408 -- applied to composite type values as well as objects, including string
6409 -- values and aggregates.
6411 -- Note: we use the Prefix field for this expression so that the
6412 -- resulting node can be treated using common code with the attribute
6413 -- nodes for the 'Access and related attributes. Logically it would make
6414 -- more sense to call it an Expression field, but then we would have to
6415 -- special case the treatment of the N_Reference node.
6417 -- Sprint syntax: prefix'reference
6420 -- Sloc is copied from the expression
6422 -- plus fields for expression
6424 -- Note: in the case where a debug source file is generated, the Sloc
6425 -- for this node points to the quote in the Sprint file output.
6427 ---------------------
6428 -- Subprogram_Info --
6429 ---------------------
6431 -- This node generates the appropriate Subprogram_Info value for a
6432 -- given procedure. See Ada.Exceptions for further details
6434 -- Sprint syntax: subprog'subprogram_info
6436 -- N_Subprogram_Info
6437 -- Sloc points to the entity for the procedure
6438 -- Identifier (Node1) identifier referencing the procedure
6439 -- Etype (Node5-Sem) type (always set to Ada.Exceptions.Code_Loc
6441 -- Note: in the case where a debug source file is generated, the Sloc
6442 -- for this node points to the quote in the Sprint file output.
6444 --------------------------
6445 -- Unchecked Expression --
6446 --------------------------
6448 -- An unchecked expression is one that must be analyzed and resolved
6449 -- with all checks off, regardless of the current setting of scope
6452 -- Sprint syntax: `(expression)
6454 -- Note: this node is always removed from the tree (and replaced by
6455 -- its constituent expression) on completion of analysis, so it only
6456 -- appears in intermediate trees, and will never be seen by Gigi.
6458 -- N_Unchecked_Expression
6459 -- Sloc is a copy of the Sloc of the expression
6460 -- Expression (Node3)
6461 -- plus fields for expression
6463 -- Note: in the case where a debug source file is generated, the Sloc
6464 -- for this node points to the back quote in the Sprint file output.
6466 -------------------------------
6467 -- Unchecked Type Conversion --
6468 -------------------------------
6470 -- An unchecked type conversion node represents the semantic action
6471 -- corresponding to a call to an instantiation of Unchecked_Conversion.
6472 -- It is generated as a result of actual use of Unchecked_Conversion
6473 -- and also the expander generates unchecked type conversion nodes
6474 -- directly for expansion of complex semantic actions.
6476 -- Note: an unchecked type conversion is a variable as far as the
6477 -- semantics are concerned, which is convenient for the expander.
6478 -- This does not change what Ada source programs are legal, since
6479 -- clearly a function call to an instantiation of Unchecked_Conversion
6480 -- is not a variable in any case.
6482 -- Sprint syntax: subtype-mark!(expression)
6484 -- N_Unchecked_Type_Conversion
6485 -- Sloc points to related node in source
6486 -- Subtype_Mark (Node4)
6487 -- Expression (Node3)
6488 -- Kill_Range_Check (Flag11-Sem)
6489 -- No_Truncation (Flag17-Sem)
6490 -- plus fields for expression
6492 -- Note: in the case where a debug source file is generated, the Sloc
6493 -- for this node points to the exclamation in the Sprint file output.
6495 -----------------------------------
6496 -- Validate_Unchecked_Conversion --
6497 -----------------------------------
6499 -- The front end does most of the validation of unchecked conversion,
6500 -- including checking sizes (this is done after the back end is called
6501 -- to take advantage of back-annotation of calculated sizes).
6503 -- The front end also deals with specific cases that are not allowed
6504 -- e.g. involving unconstrained array types.
6506 -- For the case of the standard gigi backend, this means that all
6507 -- checks are done in the front-end.
6509 -- However, in the case of specialized back-ends, notably the JVM
6510 -- backend for JGNAT, additional requirements and restrictions apply
6511 -- to unchecked conversion, and these are most conveniently performed
6512 -- in the specialized back-end.
6514 -- To accommodate this requirement, for such back ends, the following
6515 -- special node is generated recording an unchecked conversion that
6516 -- needs to be validated. The back end should post an appropriate
6517 -- error message if the unchecked conversion is invalid or warrants
6518 -- a special warning message.
6520 -- Source_Type and Target_Type point to the entities for the two
6521 -- types involved in the unchecked conversion instantiation that
6522 -- is to be validated.
6524 -- Sprint syntax: validate Unchecked_Conversion (source, target);
6526 -- N_Validate_Unchecked_Conversion
6527 -- Sloc points to instantiation (location for warning message)
6528 -- Source_Type (Node1-Sem)
6529 -- Target_Type (Node2-Sem)
6531 -- Note: in the case where a debug source file is generated, the Sloc
6532 -- for this node points to the VALIDATE keyword in the file output.
6538 -- Used as the contents of the Nkind field of the dummy Empty node
6539 -- and in some other situations to indicate an uninitialized value.
6542 -- Chars (Name1) is set to No_Name
6548 -- Used as the contents of the Nkind field of the dummy Error node.
6549 -- Has an Etype field, which gets set to Any_Type later on, to help
6550 -- error recovery (Error_Posted is also set in the Error node).
6553 -- Chars (Name1) is set to Error_Name
6554 -- Etype (Node5-Sem)
6556 --------------------------
6557 -- Node Type Definition --
6558 --------------------------
6560 -- The following is the definition of the Node_Kind type. As previously
6561 -- discussed, this is separated off to allow rearrangement of the order
6562 -- to facilitiate definition of subtype ranges. The comments show the
6563 -- subtype classes which apply to each set of node kinds. The first
6564 -- entry in the comment characterizes the following list of nodes.
6569 -- N_Representation_Clause
6573 N_Enumeration_Representation_Clause,
6575 N_Record_Representation_Clause,
6577 -- N_Representation_Clause, N_Has_Chars
6579 N_Attribute_Definition_Clause,
6585 N_Pragma_Argument_Association,
6591 -- N_Entity, N_Has_Etype, N_Has_Chars
6593 N_Defining_Character_Literal,
6594 N_Defining_Identifier,
6595 N_Defining_Operator_Symbol,
6597 -- N_Subexpr, N_Has_Etype, N_Has_Chars, N_Has_Entity
6601 -- N_Direct_Name, N_Subexpr, N_Has_Etype,
6602 -- N_Has_Chars, N_Has_Entity
6607 -- N_Direct_Name, N_Subexpr, N_Has_Etype,
6608 -- N_Has_Chars, N_Has_Entity
6610 N_Character_Literal,
6612 -- N_Binary_Op, N_Op, N_Subexpr,
6613 -- N_Has_Etype, N_Has_Chars, N_Has_Entity
6620 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Treat_Fixed_As_Integer
6621 -- N_Has_Etype, N_Has_Chars, N_Has_Entity
6628 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6629 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean
6633 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6634 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean, N_Op_Compare
6643 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype
6644 -- N_Has_Entity, N_Has_Chars, N_Op_Boolean
6649 -- N_Binary_Op, N_Op, N_Subexpr, N_Has_Etype,
6650 -- N_Op_Shift, N_Has_Chars, N_Has_Entity
6656 N_Op_Shift_Right_Arithmetic,
6658 -- N_Unary_Op, N_Op, N_Subexpr, N_Has_Etype,
6659 -- N_Has_Chars, N_Has_Entity
6666 -- N_Subexpr, N_Has_Etype, N_Has_Entity
6668 N_Attribute_Reference,
6670 -- N_Subexpr, N_Has_Etype
6673 N_Conditional_Expression,
6674 N_Explicit_Dereference,
6677 N_Indexed_Component,
6682 N_Procedure_Call_Statement,
6683 N_Qualified_Expression,
6685 -- N_Raise_xxx_Error, N_Subexpr, N_Has_Etype
6687 N_Raise_Constraint_Error,
6688 N_Raise_Program_Error,
6689 N_Raise_Storage_Error,
6691 -- N_Subexpr, N_Has_Etype
6695 N_Extension_Aggregate,
6699 N_Selected_Component,
6704 N_Unchecked_Expression,
6705 N_Unchecked_Type_Conversion,
6709 N_Subtype_Indication,
6713 N_Component_Declaration,
6714 N_Entry_Declaration,
6715 N_Formal_Object_Declaration,
6716 N_Formal_Type_Declaration,
6717 N_Full_Type_Declaration,
6718 N_Incomplete_Type_Declaration,
6719 N_Loop_Parameter_Specification,
6720 N_Object_Declaration,
6721 N_Protected_Type_Declaration,
6722 N_Private_Extension_Declaration,
6723 N_Private_Type_Declaration,
6724 N_Subtype_Declaration,
6726 -- N_Subprogram_Specification, N_Declaration
6728 N_Function_Specification,
6729 N_Procedure_Specification,
6731 -- N_Access_To_Subprogram_Definition
6733 N_Access_Function_Definition,
6734 N_Access_Procedure_Definition,
6736 -- N_Later_Decl_Item
6738 N_Task_Type_Declaration,
6740 -- N_Body_Stub, N_Later_Decl_Item
6742 N_Package_Body_Stub,
6743 N_Protected_Body_Stub,
6744 N_Subprogram_Body_Stub,
6747 -- N_Generic_Instantiation, N_Later_Decl_Item
6749 N_Function_Instantiation,
6750 N_Package_Instantiation,
6751 N_Procedure_Instantiation,
6753 -- N_Unit_Body, N_Later_Decl_Item, N_Proper_Body
6758 -- N_Later_Decl_Item, N_Proper_Body
6763 -- N_Later_Decl_Item
6765 N_Implicit_Label_Declaration,
6766 N_Package_Declaration,
6767 N_Single_Task_Declaration,
6768 N_Subprogram_Declaration,
6769 N_Use_Package_Clause,
6771 -- N_Generic_Declaration, N_Later_Decl_Item
6773 N_Generic_Package_Declaration,
6774 N_Generic_Subprogram_Declaration,
6776 -- N_Array_Type_Definition
6778 N_Constrained_Array_Definition,
6779 N_Unconstrained_Array_Definition,
6781 -- N_Renaming_Declaration
6783 N_Exception_Renaming_Declaration,
6784 N_Object_Renaming_Declaration,
6785 N_Package_Renaming_Declaration,
6786 N_Subprogram_Renaming_Declaration,
6788 -- N_Generic_Renaming_Declarations, N_Renaming_Declaration
6790 N_Generic_Function_Renaming_Declaration,
6791 N_Generic_Package_Renaming_Declaration,
6792 N_Generic_Procedure_Renaming_Declaration,
6794 -- N_Statement_Other_Than_Procedure_Call
6798 N_Assignment_Statement,
6799 N_Asynchronous_Select,
6803 N_Conditional_Entry_Call,
6804 N_Delay_Relative_Statement,
6805 N_Delay_Until_Statement,
6806 N_Entry_Call_Statement,
6812 N_Requeue_Statement,
6817 -- N_Statement_Other_Than_Procedure_Call, N_Has_Condition
6824 N_Accept_Alternative,
6825 N_Delay_Alternative,
6827 N_Entry_Body_Formal_Part,
6829 N_Terminate_Alternative,
6831 -- N_Formal_Subprogram_Declaration
6833 N_Formal_Abstract_Subprogram_Declaration,
6834 N_Formal_Concrete_Subprogram_Declaration,
6836 -- Other nodes (not part of any subtype class)
6839 N_Abstract_Subprogram_Declaration,
6840 N_Access_Definition,
6841 N_Access_To_Object_Definition,
6842 N_Case_Statement_Alternative,
6844 N_Compilation_Unit_Aux,
6845 N_Component_Association,
6846 N_Component_Definition,
6848 N_Derived_Type_Definition,
6849 N_Decimal_Fixed_Point_Definition,
6850 N_Defining_Program_Unit_Name,
6853 N_Digits_Constraint,
6854 N_Discriminant_Association,
6855 N_Discriminant_Specification,
6856 N_Enumeration_Type_Definition,
6858 N_Entry_Call_Alternative,
6859 N_Entry_Index_Specification,
6860 N_Exception_Declaration,
6861 N_Exception_Handler,
6862 N_Floating_Point_Definition,
6863 N_Formal_Decimal_Fixed_Point_Definition,
6864 N_Formal_Derived_Type_Definition,
6865 N_Formal_Discrete_Type_Definition,
6866 N_Formal_Floating_Point_Definition,
6867 N_Formal_Modular_Type_Definition,
6868 N_Formal_Ordinary_Fixed_Point_Definition,
6869 N_Formal_Package_Declaration,
6870 N_Formal_Private_Type_Definition,
6871 N_Formal_Signed_Integer_Type_Definition,
6873 N_Generic_Association,
6874 N_Handled_Sequence_Of_Statements,
6875 N_Index_Or_Discriminant_Constraint,
6878 N_Modular_Type_Definition,
6879 N_Number_Declaration,
6880 N_Ordinary_Fixed_Point_Definition,
6882 N_Package_Specification,
6883 N_Parameter_Association,
6884 N_Parameter_Specification,
6885 N_Protected_Definition,
6887 N_Real_Range_Specification,
6888 N_Record_Definition,
6889 N_Signed_Integer_Type_Definition,
6890 N_Single_Protected_Declaration,
6893 N_Triggering_Alternative,
6895 N_Validate_Unchecked_Conversion,
6902 for Node_Kind'Size use 8;
6903 -- The data structures in Atree assume this!
6905 ----------------------------
6906 -- Node Class Definitions --
6907 ----------------------------
6909 subtype N_Access_To_Subprogram_Definition is Node_Kind range
6910 N_Access_Function_Definition ..
6911 N_Access_Procedure_Definition;
6913 subtype N_Array_Type_Definition is Node_Kind range
6914 N_Constrained_Array_Definition ..
6915 N_Unconstrained_Array_Definition;
6917 subtype N_Binary_Op is Node_Kind range
6919 N_Op_Shift_Right_Arithmetic;
6921 subtype N_Body_Stub is Node_Kind range
6922 N_Package_Body_Stub ..
6925 subtype N_Declaration is Node_Kind range
6926 N_Component_Declaration ..
6927 N_Procedure_Specification;
6928 -- Note: this includes all constructs normally thought of as declarations
6929 -- except those which are separately grouped as later declarations.
6931 subtype N_Direct_Name is Node_Kind range
6933 N_Character_Literal;
6935 subtype N_Entity is Node_Kind range
6936 N_Defining_Character_Literal ..
6937 N_Defining_Operator_Symbol;
6939 subtype N_Formal_Subprogram_Declaration is Node_Kind range
6940 N_Formal_Abstract_Subprogram_Declaration ..
6941 N_Formal_Concrete_Subprogram_Declaration;
6943 subtype N_Generic_Declaration is Node_Kind range
6944 N_Generic_Package_Declaration ..
6945 N_Generic_Subprogram_Declaration;
6947 subtype N_Generic_Instantiation is Node_Kind range
6948 N_Function_Instantiation ..
6949 N_Procedure_Instantiation;
6951 subtype N_Generic_Renaming_Declaration is Node_Kind range
6952 N_Generic_Function_Renaming_Declaration ..
6953 N_Generic_Procedure_Renaming_Declaration;
6955 subtype N_Has_Chars is Node_Kind range
6956 N_Attribute_Definition_Clause ..
6959 subtype N_Has_Entity is Node_Kind range
6961 N_Attribute_Reference;
6962 -- Nodes that have Entity fields
6963 -- Warning: DOES NOT INCLUDE N_Freeze_Entity!
6965 subtype N_Has_Etype is Node_Kind range
6967 N_Subtype_Indication;
6969 subtype N_Has_Treat_Fixed_As_Integer is Node_Kind range
6973 subtype N_Later_Decl_Item is Node_Kind range
6974 N_Task_Type_Declaration ..
6975 N_Generic_Subprogram_Declaration;
6976 -- Note: this is Ada 83 relevant only (see Ada 83 RM 3.9 (2)) and
6977 -- includes only those items which can appear as later declarative
6978 -- items. This also includes N_Implicit_Label_Declaration which is
6979 -- not specifically in the grammar but may appear as a valid later
6980 -- declarative items. It does NOT include N_Pragma which can also
6981 -- appear among later declarative items. It does however include
6982 -- N_Protected_Body, which is a bit peculiar, but harmless since
6983 -- this cannot appear in Ada 83 mode anyway.
6985 subtype N_Op is Node_Kind range
6989 subtype N_Op_Boolean is Node_Kind range
6992 -- Binary operators which take operands of a boolean type, and yield
6993 -- a result of a boolean type.
6995 subtype N_Op_Compare is Node_Kind range
6999 subtype N_Op_Shift is Node_Kind range
7001 N_Op_Shift_Right_Arithmetic;
7003 subtype N_Proper_Body is Node_Kind range
7007 subtype N_Raise_xxx_Error is Node_Kind range
7008 N_Raise_Constraint_Error ..
7009 N_Raise_Storage_Error;
7011 subtype N_Renaming_Declaration is Node_Kind range
7012 N_Exception_Renaming_Declaration ..
7013 N_Generic_Procedure_Renaming_Declaration;
7015 subtype N_Representation_Clause is Node_Kind range
7017 N_Attribute_Definition_Clause;
7019 subtype N_Statement_Other_Than_Procedure_Call is Node_Kind range
7020 N_Abort_Statement ..
7022 -- Note that this includes all statement types except for the cases of the
7023 -- N_Procedure_Call_Statement which is considered to be a subexpression
7024 -- (since overloading is possible, so it needs to go through the normal
7025 -- overloading resolution for expressions).
7027 subtype N_Has_Condition is Node_Kind range
7029 N_Terminate_Alternative;
7030 -- Nodes with condition fields (does not include N_Raise_xxx_Error)
7032 subtype N_Subexpr is Node_Kind range
7034 N_Unchecked_Type_Conversion;
7035 -- Nodes with expression fields
7037 subtype N_Subprogram_Specification is Node_Kind range
7038 N_Function_Specification ..
7039 N_Procedure_Specification;
7041 subtype N_Unary_Op is Node_Kind range
7045 subtype N_Unit_Body is Node_Kind range
7049 ---------------------------
7050 -- Node Access Functions --
7051 ---------------------------
7053 -- The following functions return the contents of the indicated field of
7054 -- the node referenced by the argument, which is a Node_Id. They provide
7055 -- logical access to fields in the node which could be accessed using the
7056 -- Atree.Unchecked_Access package, but the idea is always to use these
7057 -- higher level routines which preserve strong typing. In debug mode,
7058 -- these routines check that they are being applied to an appropriate
7059 -- node, as well as checking that the node is in range.
7061 function ABE_Is_Certain
7062 (N : Node_Id) return Boolean; -- Flag18
7064 function Abort_Present
7065 (N : Node_Id) return Boolean; -- Flag15
7067 function Abortable_Part
7068 (N : Node_Id) return Node_Id; -- Node2
7070 function Abstract_Present
7071 (N : Node_Id) return Boolean; -- Flag4
7073 function Accept_Handler_Records
7074 (N : Node_Id) return List_Id; -- List5
7076 function Accept_Statement
7077 (N : Node_Id) return Node_Id; -- Node2
7079 function Access_Definition
7080 (N : Node_Id) return Node_Id; -- Node3
7082 function Access_To_Subprogram_Definition
7083 (N : Node_Id) return Node_Id; -- Node3
7085 function Access_Types_To_Process
7086 (N : Node_Id) return Elist_Id; -- Elist2
7089 (N : Node_Id) return List_Id; -- List1
7091 function Activation_Chain_Entity
7092 (N : Node_Id) return Node_Id; -- Node3
7094 function Acts_As_Spec
7095 (N : Node_Id) return Boolean; -- Flag4
7097 function Aggregate_Bounds
7098 (N : Node_Id) return Node_Id; -- Node3
7100 function Aliased_Present
7101 (N : Node_Id) return Boolean; -- Flag4
7104 (N : Node_Id) return Boolean; -- Flag11
7106 function All_Present
7107 (N : Node_Id) return Boolean; -- Flag15
7109 function Alternatives
7110 (N : Node_Id) return List_Id; -- List4
7112 function Ancestor_Part
7113 (N : Node_Id) return Node_Id; -- Node3
7115 function Array_Aggregate
7116 (N : Node_Id) return Node_Id; -- Node3
7118 function Assignment_OK
7119 (N : Node_Id) return Boolean; -- Flag15
7121 function Associated_Node
7122 (N : Node_Id) return Node_Id; -- Node4
7124 function At_End_Proc
7125 (N : Node_Id) return Node_Id; -- Node1
7127 function Attribute_Name
7128 (N : Node_Id) return Name_Id; -- Name2
7130 function Aux_Decls_Node
7131 (N : Node_Id) return Node_Id; -- Node5
7133 function Backwards_OK
7134 (N : Node_Id) return Boolean; -- Flag6
7136 function Bad_Is_Detected
7137 (N : Node_Id) return Boolean; -- Flag15
7140 (N : Node_Id) return Boolean; -- Flag5
7142 function Body_Required
7143 (N : Node_Id) return Boolean; -- Flag13
7145 function Body_To_Inline
7146 (N : Node_Id) return Node_Id; -- Node3
7148 function Box_Present
7149 (N : Node_Id) return Boolean; -- Flag15
7151 function Char_Literal_Value
7152 (N : Node_Id) return Uint; -- Uint2
7155 (N : Node_Id) return Name_Id; -- Name1
7157 function Check_Address_Alignment
7158 (N : Node_Id) return Boolean; -- Flag11
7160 function Choice_Parameter
7161 (N : Node_Id) return Node_Id; -- Node2
7164 (N : Node_Id) return List_Id; -- List1
7166 function Compile_Time_Known_Aggregate
7167 (N : Node_Id) return Boolean; -- Flag18
7169 function Component_Associations
7170 (N : Node_Id) return List_Id; -- List2
7172 function Component_Clauses
7173 (N : Node_Id) return List_Id; -- List3
7175 function Component_Definition
7176 (N : Node_Id) return Node_Id; -- Node4
7178 function Component_Items
7179 (N : Node_Id) return List_Id; -- List3
7181 function Component_List
7182 (N : Node_Id) return Node_Id; -- Node1
7184 function Component_Name
7185 (N : Node_Id) return Node_Id; -- Node1
7188 (N : Node_Id) return Node_Id; -- Node1
7190 function Condition_Actions
7191 (N : Node_Id) return List_Id; -- List3
7193 function Config_Pragmas
7194 (N : Node_Id) return List_Id; -- List4
7196 function Constant_Present
7197 (N : Node_Id) return Boolean; -- Flag17
7200 (N : Node_Id) return Node_Id; -- Node3
7202 function Constraints
7203 (N : Node_Id) return List_Id; -- List1
7205 function Context_Installed
7206 (N : Node_Id) return Boolean; -- Flag13
7208 function Context_Items
7209 (N : Node_Id) return List_Id; -- List1
7211 function Controlling_Argument
7212 (N : Node_Id) return Node_Id; -- Node1
7214 function Conversion_OK
7215 (N : Node_Id) return Boolean; -- Flag14
7217 function Corresponding_Body
7218 (N : Node_Id) return Node_Id; -- Node5
7220 function Corresponding_Formal_Spec
7221 (N : Node_Id) return Node_Id; -- Node3
7223 function Corresponding_Generic_Association
7224 (N : Node_Id) return Node_Id; -- Node5
7226 function Corresponding_Integer_Value
7227 (N : Node_Id) return Uint; -- Uint4
7229 function Corresponding_Spec
7230 (N : Node_Id) return Node_Id; -- Node5
7232 function Corresponding_Stub
7233 (N : Node_Id) return Node_Id; -- Node3
7235 function Dcheck_Function
7236 (N : Node_Id) return Entity_Id; -- Node5
7238 function Debug_Statement
7239 (N : Node_Id) return Node_Id; -- Node3
7241 function Declarations
7242 (N : Node_Id) return List_Id; -- List2
7244 function Default_Expression
7245 (N : Node_Id) return Node_Id; -- Node5
7247 function Default_Name
7248 (N : Node_Id) return Node_Id; -- Node2
7250 function Defining_Identifier
7251 (N : Node_Id) return Entity_Id; -- Node1
7253 function Defining_Unit_Name
7254 (N : Node_Id) return Node_Id; -- Node1
7256 function Delay_Alternative
7257 (N : Node_Id) return Node_Id; -- Node4
7259 function Delay_Finalize_Attach
7260 (N : Node_Id) return Boolean; -- Flag14
7262 function Delay_Statement
7263 (N : Node_Id) return Node_Id; -- Node2
7265 function Delta_Expression
7266 (N : Node_Id) return Node_Id; -- Node3
7268 function Digits_Expression
7269 (N : Node_Id) return Node_Id; -- Node2
7271 function Discr_Check_Funcs_Built
7272 (N : Node_Id) return Boolean; -- Flag11
7274 function Discrete_Choices
7275 (N : Node_Id) return List_Id; -- List4
7277 function Discrete_Range
7278 (N : Node_Id) return Node_Id; -- Node4
7280 function Discrete_Subtype_Definition
7281 (N : Node_Id) return Node_Id; -- Node4
7283 function Discrete_Subtype_Definitions
7284 (N : Node_Id) return List_Id; -- List2
7286 function Discriminant_Specifications
7287 (N : Node_Id) return List_Id; -- List4
7289 function Discriminant_Type
7290 (N : Node_Id) return Node_Id; -- Node5
7292 function Do_Accessibility_Check
7293 (N : Node_Id) return Boolean; -- Flag13
7295 function Do_Discriminant_Check
7296 (N : Node_Id) return Boolean; -- Flag13
7298 function Do_Division_Check
7299 (N : Node_Id) return Boolean; -- Flag13
7301 function Do_Length_Check
7302 (N : Node_Id) return Boolean; -- Flag4
7304 function Do_Overflow_Check
7305 (N : Node_Id) return Boolean; -- Flag17
7307 function Do_Range_Check
7308 (N : Node_Id) return Boolean; -- Flag9
7310 function Do_Storage_Check
7311 (N : Node_Id) return Boolean; -- Flag17
7313 function Do_Tag_Check
7314 (N : Node_Id) return Boolean; -- Flag13
7316 function Elaborate_All_Present
7317 (N : Node_Id) return Boolean; -- Flag14
7319 function Elaborate_Present
7320 (N : Node_Id) return Boolean; -- Flag4
7322 function Elaboration_Boolean
7323 (N : Node_Id) return Node_Id; -- Node2
7325 function Else_Actions
7326 (N : Node_Id) return List_Id; -- List3
7328 function Else_Statements
7329 (N : Node_Id) return List_Id; -- List4
7331 function Elsif_Parts
7332 (N : Node_Id) return List_Id; -- List3
7334 function Enclosing_Variant
7335 (N : Node_Id) return Node_Id; -- Node2
7338 (N : Node_Id) return Node_Id; -- Node4
7341 (N : Node_Id) return Uint; -- Uint5
7344 (N : Node_Id) return Node_Id; -- Node4
7346 function Entity_Or_Associated_Node
7347 (N : Node_Id) return Node_Id; -- Node4
7349 function Entry_Body_Formal_Part
7350 (N : Node_Id) return Node_Id; -- Node5
7352 function Entry_Call_Alternative
7353 (N : Node_Id) return Node_Id; -- Node1
7355 function Entry_Call_Statement
7356 (N : Node_Id) return Node_Id; -- Node1
7358 function Entry_Direct_Name
7359 (N : Node_Id) return Node_Id; -- Node1
7361 function Entry_Index
7362 (N : Node_Id) return Node_Id; -- Node5
7364 function Entry_Index_Specification
7365 (N : Node_Id) return Node_Id; -- Node4
7368 (N : Node_Id) return Node_Id; -- Node5
7370 function Exception_Choices
7371 (N : Node_Id) return List_Id; -- List4
7373 function Exception_Handlers
7374 (N : Node_Id) return List_Id; -- List5
7376 function Exception_Junk
7377 (N : Node_Id) return Boolean; -- Flag7
7379 function Explicit_Actual_Parameter
7380 (N : Node_Id) return Node_Id; -- Node3
7382 function Expansion_Delayed
7383 (N : Node_Id) return Boolean; -- Flag11
7385 function Explicit_Generic_Actual_Parameter
7386 (N : Node_Id) return Node_Id; -- Node1
7389 (N : Node_Id) return Node_Id; -- Node3
7391 function Expressions
7392 (N : Node_Id) return List_Id; -- List1
7395 (N : Node_Id) return Node_Id; -- Node3
7397 function First_Inlined_Subprogram
7398 (N : Node_Id) return Entity_Id; -- Node3
7401 (N : Node_Id) return Boolean; -- Flag5
7403 function First_Named_Actual
7404 (N : Node_Id) return Node_Id; -- Node4
7406 function First_Real_Statement
7407 (N : Node_Id) return Node_Id; -- Node2
7409 function First_Subtype_Link
7410 (N : Node_Id) return Entity_Id; -- Node5
7412 function Float_Truncate
7413 (N : Node_Id) return Boolean; -- Flag11
7415 function Formal_Type_Definition
7416 (N : Node_Id) return Node_Id; -- Node3
7418 function Forwards_OK
7419 (N : Node_Id) return Boolean; -- Flag5
7421 function From_At_Mod
7422 (N : Node_Id) return Boolean; -- Flag4
7424 function From_Default
7425 (N : Node_Id) return Boolean; -- Flag6
7427 function Generic_Associations
7428 (N : Node_Id) return List_Id; -- List3
7430 function Generic_Formal_Declarations
7431 (N : Node_Id) return List_Id; -- List2
7433 function Generic_Parent
7434 (N : Node_Id) return Node_Id; -- Node5
7436 function Generic_Parent_Type
7437 (N : Node_Id) return Node_Id; -- Node4
7439 function Handled_Statement_Sequence
7440 (N : Node_Id) return Node_Id; -- Node4
7442 function Handler_List_Entry
7443 (N : Node_Id) return Node_Id; -- Node2
7445 function Has_Created_Identifier
7446 (N : Node_Id) return Boolean; -- Flag15
7448 function Has_Dynamic_Length_Check
7449 (N : Node_Id) return Boolean; -- Flag10
7451 function Has_Dynamic_Range_Check
7452 (N : Node_Id) return Boolean; -- Flag12
7454 function Has_No_Elaboration_Code
7455 (N : Node_Id) return Boolean; -- Flag17
7457 function Has_Priority_Pragma
7458 (N : Node_Id) return Boolean; -- Flag6
7460 function Has_Private_View
7461 (N : Node_Id) return Boolean; -- Flag11
7463 function Has_Storage_Size_Pragma
7464 (N : Node_Id) return Boolean; -- Flag5
7466 function Has_Task_Info_Pragma
7467 (N : Node_Id) return Boolean; -- Flag7
7469 function Has_Task_Name_Pragma
7470 (N : Node_Id) return Boolean; -- Flag8
7472 function Has_Wide_Character
7473 (N : Node_Id) return Boolean; -- Flag11
7475 function Hidden_By_Use_Clause
7476 (N : Node_Id) return Elist_Id; -- Elist4
7479 (N : Node_Id) return Node_Id; -- Node2
7482 (N : Node_Id) return Node_Id; -- Node1
7484 function Interface_List
7485 (N : Node_Id) return List_Id; -- List2
7487 function Interface_Present
7488 (N : Node_Id) return Boolean; -- Flag16
7490 function Implicit_With
7491 (N : Node_Id) return Boolean; -- Flag16
7494 (N : Node_Id) return Boolean; -- Flag15
7496 function Includes_Infinities
7497 (N : Node_Id) return Boolean; -- Flag11
7499 function Instance_Spec
7500 (N : Node_Id) return Node_Id; -- Node5
7503 (N : Node_Id) return Uint; -- Uint3
7505 function Is_Asynchronous_Call_Block
7506 (N : Node_Id) return Boolean; -- Flag7
7508 function Is_Component_Left_Opnd
7509 (N : Node_Id) return Boolean; -- Flag13
7511 function Is_Component_Right_Opnd
7512 (N : Node_Id) return Boolean; -- Flag14
7514 function Is_Controlling_Actual
7515 (N : Node_Id) return Boolean; -- Flag16
7517 function Is_In_Discriminant_Check
7518 (N : Node_Id) return Boolean; -- Flag11
7520 function Is_Machine_Number
7521 (N : Node_Id) return Boolean; -- Flag11
7523 function Is_Null_Loop
7524 (N : Node_Id) return Boolean; -- Flag16
7526 function Is_Overloaded
7527 (N : Node_Id) return Boolean; -- Flag5
7529 function Is_Power_Of_2_For_Shift
7530 (N : Node_Id) return Boolean; -- Flag13
7532 function Is_Protected_Subprogram_Body
7533 (N : Node_Id) return Boolean; -- Flag7
7535 function Is_Static_Expression
7536 (N : Node_Id) return Boolean; -- Flag6
7538 function Is_Subprogram_Descriptor
7539 (N : Node_Id) return Boolean; -- Flag16
7541 function Is_Task_Allocation_Block
7542 (N : Node_Id) return Boolean; -- Flag6
7544 function Is_Task_Master
7545 (N : Node_Id) return Boolean; -- Flag5
7547 function Iteration_Scheme
7548 (N : Node_Id) return Node_Id; -- Node2
7551 (N : Node_Id) return Entity_Id; -- Node1
7553 function Kill_Range_Check
7554 (N : Node_Id) return Boolean; -- Flag11
7556 function Label_Construct
7557 (N : Node_Id) return Node_Id; -- Node2
7560 (N : Node_Id) return Node_Id; -- Node2
7563 (N : Node_Id) return Node_Id; -- Node4
7566 (N : Node_Id) return Boolean; -- Flag6
7568 function Library_Unit
7569 (N : Node_Id) return Node_Id; -- Node4
7571 function Limited_View_Installed
7572 (N : Node_Id) return Boolean; -- Flag18
7574 function Limited_Present
7575 (N : Node_Id) return Boolean; -- Flag17
7578 (N : Node_Id) return List_Id; -- List1
7580 function Loop_Actions
7581 (N : Node_Id) return List_Id; -- List2
7583 function Loop_Parameter_Specification
7584 (N : Node_Id) return Node_Id; -- Node4
7587 (N : Node_Id) return Node_Id; -- Node1
7590 (N : Node_Id) return Node_Id; -- Node2
7593 (N : Node_Id) return Boolean; -- Flag5
7595 function Must_Be_Byte_Aligned
7596 (N : Node_Id) return Boolean; -- Flag14
7598 function Must_Not_Freeze
7599 (N : Node_Id) return Boolean; -- Flag8
7601 function Must_Not_Override
7602 (N : Node_Id) return Boolean; -- Flag15
7604 function Must_Override
7605 (N : Node_Id) return Boolean; -- Flag14
7608 (N : Node_Id) return Node_Id; -- Node2
7611 (N : Node_Id) return List_Id; -- List2
7613 function Next_Entity
7614 (N : Node_Id) return Node_Id; -- Node2
7616 function Next_Named_Actual
7617 (N : Node_Id) return Node_Id; -- Node4
7619 function Next_Rep_Item
7620 (N : Node_Id) return Node_Id; -- Node4
7622 function Next_Use_Clause
7623 (N : Node_Id) return Node_Id; -- Node3
7625 function No_Ctrl_Actions
7626 (N : Node_Id) return Boolean; -- Flag7
7628 function No_Elaboration_Check
7629 (N : Node_Id) return Boolean; -- Flag14
7631 function No_Entities_Ref_In_Spec
7632 (N : Node_Id) return Boolean; -- Flag8
7634 function No_Initialization
7635 (N : Node_Id) return Boolean; -- Flag13
7637 function No_Truncation
7638 (N : Node_Id) return Boolean; -- Flag17
7640 function Null_Present
7641 (N : Node_Id) return Boolean; -- Flag13
7643 function Null_Exclusion_Present
7644 (N : Node_Id) return Boolean; -- Flag11
7646 function Null_Record_Present
7647 (N : Node_Id) return Boolean; -- Flag17
7649 function Object_Definition
7650 (N : Node_Id) return Node_Id; -- Node4
7652 function Original_Discriminant
7653 (N : Node_Id) return Node_Id; -- Node2
7655 function Original_Entity
7656 (N : Node_Id) return Entity_Id; -- Node2
7658 function Others_Discrete_Choices
7659 (N : Node_Id) return List_Id; -- List1
7661 function Out_Present
7662 (N : Node_Id) return Boolean; -- Flag17
7664 function Parameter_Associations
7665 (N : Node_Id) return List_Id; -- List3
7667 function Parameter_List_Truncated
7668 (N : Node_Id) return Boolean; -- Flag17
7670 function Parameter_Specifications
7671 (N : Node_Id) return List_Id; -- List3
7673 function Parameter_Type
7674 (N : Node_Id) return Node_Id; -- Node2
7676 function Parent_Spec
7677 (N : Node_Id) return Node_Id; -- Node4
7680 (N : Node_Id) return Node_Id; -- Node2
7682 function Pragma_Argument_Associations
7683 (N : Node_Id) return List_Id; -- List2
7685 function Pragmas_After
7686 (N : Node_Id) return List_Id; -- List5
7688 function Pragmas_Before
7689 (N : Node_Id) return List_Id; -- List4
7692 (N : Node_Id) return Node_Id; -- Node3
7694 function Present_Expr
7695 (N : Node_Id) return Uint; -- Uint3
7698 (N : Node_Id) return Boolean; -- Flag6
7700 function Print_In_Hex
7701 (N : Node_Id) return Boolean; -- Flag13
7703 function Private_Declarations
7704 (N : Node_Id) return List_Id; -- List3
7706 function Private_Present
7707 (N : Node_Id) return Boolean; -- Flag15
7709 function Procedure_To_Call
7710 (N : Node_Id) return Node_Id; -- Node4
7712 function Proper_Body
7713 (N : Node_Id) return Node_Id; -- Node1
7715 function Protected_Definition
7716 (N : Node_Id) return Node_Id; -- Node3
7718 function Protected_Present
7719 (N : Node_Id) return Boolean; -- Flag6
7721 function Raises_Constraint_Error
7722 (N : Node_Id) return Boolean; -- Flag7
7724 function Range_Constraint
7725 (N : Node_Id) return Node_Id; -- Node4
7727 function Range_Expression
7728 (N : Node_Id) return Node_Id; -- Node4
7730 function Real_Range_Specification
7731 (N : Node_Id) return Node_Id; -- Node4
7734 (N : Node_Id) return Ureal; -- Ureal3
7737 (N : Node_Id) return Uint; -- Uint3
7739 function Record_Extension_Part
7740 (N : Node_Id) return Node_Id; -- Node3
7742 function Redundant_Use
7743 (N : Node_Id) return Boolean; -- Flag13
7745 function Return_Type
7746 (N : Node_Id) return Node_Id; -- Node2
7748 function Reverse_Present
7749 (N : Node_Id) return Boolean; -- Flag15
7752 (N : Node_Id) return Node_Id; -- Node3
7754 function Rounded_Result
7755 (N : Node_Id) return Boolean; -- Flag18
7758 (N : Node_Id) return Node_Id; -- Node3
7760 function Select_Alternatives
7761 (N : Node_Id) return List_Id; -- List1
7763 function Selector_Name
7764 (N : Node_Id) return Node_Id; -- Node2
7766 function Selector_Names
7767 (N : Node_Id) return List_Id; -- List1
7769 function Shift_Count_OK
7770 (N : Node_Id) return Boolean; -- Flag4
7772 function Source_Type
7773 (N : Node_Id) return Entity_Id; -- Node1
7775 function Specification
7776 (N : Node_Id) return Node_Id; -- Node1
7779 (N : Node_Id) return List_Id; -- List3
7781 function Static_Processing_OK
7782 (N : Node_Id) return Boolean; -- Flag4
7784 function Storage_Pool
7785 (N : Node_Id) return Node_Id; -- Node1
7788 (N : Node_Id) return String_Id; -- Str3
7790 function Subtype_Indication
7791 (N : Node_Id) return Node_Id; -- Node5
7793 function Subtype_Mark
7794 (N : Node_Id) return Node_Id; -- Node4
7796 function Subtype_Marks
7797 (N : Node_Id) return List_Id; -- List2
7799 function Synchronized_Present
7800 (N : Node_Id) return Boolean; -- Flag7
7802 function Tagged_Present
7803 (N : Node_Id) return Boolean; -- Flag15
7805 function Target_Type
7806 (N : Node_Id) return Entity_Id; -- Node2
7808 function Task_Definition
7809 (N : Node_Id) return Node_Id; -- Node3
7811 function Task_Present
7812 (N : Node_Id) return Boolean; -- Flag5
7814 function Then_Actions
7815 (N : Node_Id) return List_Id; -- List2
7817 function Then_Statements
7818 (N : Node_Id) return List_Id; -- List2
7820 function Treat_Fixed_As_Integer
7821 (N : Node_Id) return Boolean; -- Flag14
7823 function Triggering_Alternative
7824 (N : Node_Id) return Node_Id; -- Node1
7826 function Triggering_Statement
7827 (N : Node_Id) return Node_Id; -- Node1
7830 (N : Node_Id) return Elist_Id; -- Elist3
7832 function Type_Definition
7833 (N : Node_Id) return Node_Id; -- Node3
7836 (N : Node_Id) return Node_Id; -- Node2
7838 function Unknown_Discriminants_Present
7839 (N : Node_Id) return Boolean; -- Flag13
7841 function Unreferenced_In_Spec
7842 (N : Node_Id) return Boolean; -- Flag7
7844 function Variant_Part
7845 (N : Node_Id) return Node_Id; -- Node4
7848 (N : Node_Id) return List_Id; -- List1
7850 function Visible_Declarations
7851 (N : Node_Id) return List_Id; -- List2
7853 function Was_Originally_Stub
7854 (N : Node_Id) return Boolean; -- Flag13
7856 function Zero_Cost_Handling
7857 (N : Node_Id) return Boolean; -- Flag5
7859 -- End functions (note used by xsinfo utility program to end processing)
7861 ----------------------------
7862 -- Node Update Procedures --
7863 ----------------------------
7865 -- These are the corresponding node update routines, which again provide
7866 -- a high level logical access with type checking. In addition to setting
7867 -- the indicated field of the node N to the given Val, in the case of
7868 -- tree pointers (List1-4), the parent pointer of the Val node is set to
7869 -- point back to node N. This automates the setting of the parent pointer.
7871 procedure Set_ABE_Is_Certain
7872 (N : Node_Id; Val : Boolean := True); -- Flag18
7874 procedure Set_Abort_Present
7875 (N : Node_Id; Val : Boolean := True); -- Flag15
7877 procedure Set_Abortable_Part
7878 (N : Node_Id; Val : Node_Id); -- Node2
7880 procedure Set_Abstract_Present
7881 (N : Node_Id; Val : Boolean := True); -- Flag4
7883 procedure Set_Accept_Handler_Records
7884 (N : Node_Id; Val : List_Id); -- List5
7886 procedure Set_Accept_Statement
7887 (N : Node_Id; Val : Node_Id); -- Node2
7889 procedure Set_Access_Definition
7890 (N : Node_Id; Val : Node_Id); -- Node3
7892 procedure Set_Access_To_Subprogram_Definition
7893 (N : Node_Id; Val : Node_Id); -- Node3
7895 procedure Set_Access_Types_To_Process
7896 (N : Node_Id; Val : Elist_Id); -- Elist2
7898 procedure Set_Actions
7899 (N : Node_Id; Val : List_Id); -- List1
7901 procedure Set_Activation_Chain_Entity
7902 (N : Node_Id; Val : Node_Id); -- Node3
7904 procedure Set_Acts_As_Spec
7905 (N : Node_Id; Val : Boolean := True); -- Flag4
7907 procedure Set_Aggregate_Bounds
7908 (N : Node_Id; Val : Node_Id); -- Node3
7910 procedure Set_Aliased_Present
7911 (N : Node_Id; Val : Boolean := True); -- Flag4
7913 procedure Set_All_Others
7914 (N : Node_Id; Val : Boolean := True); -- Flag11
7916 procedure Set_All_Present
7917 (N : Node_Id; Val : Boolean := True); -- Flag15
7919 procedure Set_Alternatives
7920 (N : Node_Id; Val : List_Id); -- List4
7922 procedure Set_Ancestor_Part
7923 (N : Node_Id; Val : Node_Id); -- Node3
7925 procedure Set_Array_Aggregate
7926 (N : Node_Id; Val : Node_Id); -- Node3
7928 procedure Set_Assignment_OK
7929 (N : Node_Id; Val : Boolean := True); -- Flag15
7931 procedure Set_Associated_Node
7932 (N : Node_Id; Val : Node_Id); -- Node4
7934 procedure Set_Attribute_Name
7935 (N : Node_Id; Val : Name_Id); -- Name2
7937 procedure Set_At_End_Proc
7938 (N : Node_Id; Val : Node_Id); -- Node1
7940 procedure Set_Aux_Decls_Node
7941 (N : Node_Id; Val : Node_Id); -- Node5
7943 procedure Set_Backwards_OK
7944 (N : Node_Id; Val : Boolean := True); -- Flag6
7946 procedure Set_Bad_Is_Detected
7947 (N : Node_Id; Val : Boolean := True); -- Flag15
7949 procedure Set_Body_Required
7950 (N : Node_Id; Val : Boolean := True); -- Flag13
7952 procedure Set_Body_To_Inline
7953 (N : Node_Id; Val : Node_Id); -- Node3
7955 procedure Set_Box_Present
7956 (N : Node_Id; Val : Boolean := True); -- Flag15
7958 procedure Set_By_Ref
7959 (N : Node_Id; Val : Boolean := True); -- Flag5
7961 procedure Set_Char_Literal_Value
7962 (N : Node_Id; Val : Uint); -- Uint2
7965 (N : Node_Id; Val : Name_Id); -- Name1
7967 procedure Set_Check_Address_Alignment
7968 (N : Node_Id; Val : Boolean := True); -- Flag11
7970 procedure Set_Choice_Parameter
7971 (N : Node_Id; Val : Node_Id); -- Node2
7973 procedure Set_Choices
7974 (N : Node_Id; Val : List_Id); -- List1
7976 procedure Set_Compile_Time_Known_Aggregate
7977 (N : Node_Id; Val : Boolean := True); -- Flag18
7979 procedure Set_Component_Associations
7980 (N : Node_Id; Val : List_Id); -- List2
7982 procedure Set_Component_Clauses
7983 (N : Node_Id; Val : List_Id); -- List3
7985 procedure Set_Component_Definition
7986 (N : Node_Id; Val : Node_Id); -- Node4
7988 procedure Set_Component_Items
7989 (N : Node_Id; Val : List_Id); -- List3
7991 procedure Set_Component_List
7992 (N : Node_Id; Val : Node_Id); -- Node1
7994 procedure Set_Component_Name
7995 (N : Node_Id; Val : Node_Id); -- Node1
7997 procedure Set_Condition
7998 (N : Node_Id; Val : Node_Id); -- Node1
8000 procedure Set_Condition_Actions
8001 (N : Node_Id; Val : List_Id); -- List3
8003 procedure Set_Config_Pragmas
8004 (N : Node_Id; Val : List_Id); -- List4
8006 procedure Set_Constant_Present
8007 (N : Node_Id; Val : Boolean := True); -- Flag17
8009 procedure Set_Constraint
8010 (N : Node_Id; Val : Node_Id); -- Node3
8012 procedure Set_Constraints
8013 (N : Node_Id; Val : List_Id); -- List1
8015 procedure Set_Context_Installed
8016 (N : Node_Id; Val : Boolean := True); -- Flag13
8018 procedure Set_Context_Items
8019 (N : Node_Id; Val : List_Id); -- List1
8021 procedure Set_Controlling_Argument
8022 (N : Node_Id; Val : Node_Id); -- Node1
8024 procedure Set_Conversion_OK
8025 (N : Node_Id; Val : Boolean := True); -- Flag14
8027 procedure Set_Corresponding_Body
8028 (N : Node_Id; Val : Node_Id); -- Node5
8030 procedure Set_Corresponding_Formal_Spec
8031 (N : Node_Id; Val : Node_Id); -- Node3
8033 procedure Set_Corresponding_Generic_Association
8034 (N : Node_Id; Val : Node_Id); -- Node5
8036 procedure Set_Corresponding_Integer_Value
8037 (N : Node_Id; Val : Uint); -- Uint4
8039 procedure Set_Corresponding_Spec
8040 (N : Node_Id; Val : Node_Id); -- Node5
8042 procedure Set_Corresponding_Stub
8043 (N : Node_Id; Val : Node_Id); -- Node3
8045 procedure Set_Dcheck_Function
8046 (N : Node_Id; Val : Entity_Id); -- Node5
8048 procedure Set_Debug_Statement
8049 (N : Node_Id; Val : Node_Id); -- Node3
8051 procedure Set_Declarations
8052 (N : Node_Id; Val : List_Id); -- List2
8054 procedure Set_Default_Expression
8055 (N : Node_Id; Val : Node_Id); -- Node5
8057 procedure Set_Default_Name
8058 (N : Node_Id; Val : Node_Id); -- Node2
8060 procedure Set_Defining_Identifier
8061 (N : Node_Id; Val : Entity_Id); -- Node1
8063 procedure Set_Defining_Unit_Name
8064 (N : Node_Id; Val : Node_Id); -- Node1
8066 procedure Set_Delay_Alternative
8067 (N : Node_Id; Val : Node_Id); -- Node4
8069 procedure Set_Delay_Finalize_Attach
8070 (N : Node_Id; Val : Boolean := True); -- Flag14
8072 procedure Set_Delay_Statement
8073 (N : Node_Id; Val : Node_Id); -- Node2
8075 procedure Set_Delta_Expression
8076 (N : Node_Id; Val : Node_Id); -- Node3
8078 procedure Set_Digits_Expression
8079 (N : Node_Id; Val : Node_Id); -- Node2
8081 procedure Set_Discr_Check_Funcs_Built
8082 (N : Node_Id; Val : Boolean := True); -- Flag11
8084 procedure Set_Discrete_Choices
8085 (N : Node_Id; Val : List_Id); -- List4
8087 procedure Set_Discrete_Range
8088 (N : Node_Id; Val : Node_Id); -- Node4
8090 procedure Set_Discrete_Subtype_Definition
8091 (N : Node_Id; Val : Node_Id); -- Node4
8093 procedure Set_Discrete_Subtype_Definitions
8094 (N : Node_Id; Val : List_Id); -- List2
8096 procedure Set_Discriminant_Specifications
8097 (N : Node_Id; Val : List_Id); -- List4
8099 procedure Set_Discriminant_Type
8100 (N : Node_Id; Val : Node_Id); -- Node5
8102 procedure Set_Do_Accessibility_Check
8103 (N : Node_Id; Val : Boolean := True); -- Flag13
8105 procedure Set_Do_Discriminant_Check
8106 (N : Node_Id; Val : Boolean := True); -- Flag13
8108 procedure Set_Do_Division_Check
8109 (N : Node_Id; Val : Boolean := True); -- Flag13
8111 procedure Set_Do_Length_Check
8112 (N : Node_Id; Val : Boolean := True); -- Flag4
8114 procedure Set_Do_Overflow_Check
8115 (N : Node_Id; Val : Boolean := True); -- Flag17
8117 procedure Set_Do_Range_Check
8118 (N : Node_Id; Val : Boolean := True); -- Flag9
8120 procedure Set_Do_Storage_Check
8121 (N : Node_Id; Val : Boolean := True); -- Flag17
8123 procedure Set_Do_Tag_Check
8124 (N : Node_Id; Val : Boolean := True); -- Flag13
8126 procedure Set_Elaborate_All_Present
8127 (N : Node_Id; Val : Boolean := True); -- Flag14
8129 procedure Set_Elaborate_Present
8130 (N : Node_Id; Val : Boolean := True); -- Flag4
8132 procedure Set_Elaboration_Boolean
8133 (N : Node_Id; Val : Node_Id); -- Node2
8135 procedure Set_Else_Actions
8136 (N : Node_Id; Val : List_Id); -- List3
8138 procedure Set_Else_Statements
8139 (N : Node_Id; Val : List_Id); -- List4
8141 procedure Set_Elsif_Parts
8142 (N : Node_Id; Val : List_Id); -- List3
8144 procedure Set_Enclosing_Variant
8145 (N : Node_Id; Val : Node_Id); -- Node2
8147 procedure Set_End_Label
8148 (N : Node_Id; Val : Node_Id); -- Node4
8150 procedure Set_End_Span
8151 (N : Node_Id; Val : Uint); -- Uint5
8153 procedure Set_Entity
8154 (N : Node_Id; Val : Node_Id); -- Node4
8156 procedure Set_Entry_Body_Formal_Part
8157 (N : Node_Id; Val : Node_Id); -- Node5
8159 procedure Set_Entry_Call_Alternative
8160 (N : Node_Id; Val : Node_Id); -- Node1
8162 procedure Set_Entry_Call_Statement
8163 (N : Node_Id; Val : Node_Id); -- Node1
8165 procedure Set_Entry_Direct_Name
8166 (N : Node_Id; Val : Node_Id); -- Node1
8168 procedure Set_Entry_Index
8169 (N : Node_Id; Val : Node_Id); -- Node5
8171 procedure Set_Entry_Index_Specification
8172 (N : Node_Id; Val : Node_Id); -- Node4
8175 (N : Node_Id; Val : Node_Id); -- Node5
8177 procedure Set_Exception_Choices
8178 (N : Node_Id; Val : List_Id); -- List4
8180 procedure Set_Exception_Handlers
8181 (N : Node_Id; Val : List_Id); -- List5
8183 procedure Set_Exception_Junk
8184 (N : Node_Id; Val : Boolean := True); -- Flag7
8186 procedure Set_Expansion_Delayed
8187 (N : Node_Id; Val : Boolean := True); -- Flag11
8189 procedure Set_Explicit_Actual_Parameter
8190 (N : Node_Id; Val : Node_Id); -- Node3
8192 procedure Set_Explicit_Generic_Actual_Parameter
8193 (N : Node_Id; Val : Node_Id); -- Node1
8195 procedure Set_Expression
8196 (N : Node_Id; Val : Node_Id); -- Node3
8198 procedure Set_Expressions
8199 (N : Node_Id; Val : List_Id); -- List1
8201 procedure Set_First_Bit
8202 (N : Node_Id; Val : Node_Id); -- Node3
8204 procedure Set_First_Inlined_Subprogram
8205 (N : Node_Id; Val : Entity_Id); -- Node3
8207 procedure Set_First_Name
8208 (N : Node_Id; Val : Boolean := True); -- Flag5
8210 procedure Set_First_Named_Actual
8211 (N : Node_Id; Val : Node_Id); -- Node4
8213 procedure Set_First_Real_Statement
8214 (N : Node_Id; Val : Node_Id); -- Node2
8216 procedure Set_First_Subtype_Link
8217 (N : Node_Id; Val : Entity_Id); -- Node5
8219 procedure Set_Float_Truncate
8220 (N : Node_Id; Val : Boolean := True); -- Flag11
8222 procedure Set_Formal_Type_Definition
8223 (N : Node_Id; Val : Node_Id); -- Node3
8225 procedure Set_Forwards_OK
8226 (N : Node_Id; Val : Boolean := True); -- Flag5
8228 procedure Set_From_At_Mod
8229 (N : Node_Id; Val : Boolean := True); -- Flag4
8231 procedure Set_From_Default
8232 (N : Node_Id; Val : Boolean := True); -- Flag6
8234 procedure Set_Generic_Associations
8235 (N : Node_Id; Val : List_Id); -- List3
8237 procedure Set_Generic_Formal_Declarations
8238 (N : Node_Id; Val : List_Id); -- List2
8240 procedure Set_Generic_Parent
8241 (N : Node_Id; Val : Node_Id); -- Node5
8243 procedure Set_Generic_Parent_Type
8244 (N : Node_Id; Val : Node_Id); -- Node4
8246 procedure Set_Handled_Statement_Sequence
8247 (N : Node_Id; Val : Node_Id); -- Node4
8249 procedure Set_Handler_List_Entry
8250 (N : Node_Id; Val : Node_Id); -- Node2
8252 procedure Set_Has_Created_Identifier
8253 (N : Node_Id; Val : Boolean := True); -- Flag15
8255 procedure Set_Has_Dynamic_Length_Check
8256 (N : Node_Id; Val : Boolean := True); -- Flag10
8258 procedure Set_Has_Dynamic_Range_Check
8259 (N : Node_Id; Val : Boolean := True); -- Flag12
8261 procedure Set_Has_No_Elaboration_Code
8262 (N : Node_Id; Val : Boolean := True); -- Flag17
8264 procedure Set_Has_Priority_Pragma
8265 (N : Node_Id; Val : Boolean := True); -- Flag6
8267 procedure Set_Has_Private_View
8268 (N : Node_Id; Val : Boolean := True); -- Flag11
8270 procedure Set_Has_Storage_Size_Pragma
8271 (N : Node_Id; Val : Boolean := True); -- Flag5
8273 procedure Set_Has_Task_Info_Pragma
8274 (N : Node_Id; Val : Boolean := True); -- Flag7
8276 procedure Set_Has_Task_Name_Pragma
8277 (N : Node_Id; Val : Boolean := True); -- Flag8
8279 procedure Set_Has_Wide_Character
8280 (N : Node_Id; Val : Boolean := True); -- Flag11
8282 procedure Set_Hidden_By_Use_Clause
8283 (N : Node_Id; Val : Elist_Id); -- Elist4
8285 procedure Set_High_Bound
8286 (N : Node_Id; Val : Node_Id); -- Node2
8288 procedure Set_Identifier
8289 (N : Node_Id; Val : Node_Id); -- Node1
8291 procedure Set_Interface_List
8292 (N : Node_Id; Val : List_Id); -- List2
8294 procedure Set_Interface_Present
8295 (N : Node_Id; Val : Boolean := True); -- Flag16
8297 procedure Set_Implicit_With
8298 (N : Node_Id; Val : Boolean := True); -- Flag16
8300 procedure Set_In_Present
8301 (N : Node_Id; Val : Boolean := True); -- Flag15
8303 procedure Set_Includes_Infinities
8304 (N : Node_Id; Val : Boolean := True); -- Flag11
8306 procedure Set_Instance_Spec
8307 (N : Node_Id; Val : Node_Id); -- Node5
8309 procedure Set_Intval
8310 (N : Node_Id; Val : Uint); -- Uint3
8312 procedure Set_Is_Asynchronous_Call_Block
8313 (N : Node_Id; Val : Boolean := True); -- Flag7
8315 procedure Set_Is_Component_Left_Opnd
8316 (N : Node_Id; Val : Boolean := True); -- Flag13
8318 procedure Set_Is_Component_Right_Opnd
8319 (N : Node_Id; Val : Boolean := True); -- Flag14
8321 procedure Set_Is_Controlling_Actual
8322 (N : Node_Id; Val : Boolean := True); -- Flag16
8324 procedure Set_Is_In_Discriminant_Check
8325 (N : Node_Id; Val : Boolean := True); -- Flag11
8327 procedure Set_Is_Machine_Number
8328 (N : Node_Id; Val : Boolean := True); -- Flag11
8330 procedure Set_Is_Null_Loop
8331 (N : Node_Id; Val : Boolean := True); -- Flag16
8333 procedure Set_Is_Overloaded
8334 (N : Node_Id; Val : Boolean := True); -- Flag5
8336 procedure Set_Is_Power_Of_2_For_Shift
8337 (N : Node_Id; Val : Boolean := True); -- Flag13
8339 procedure Set_Is_Protected_Subprogram_Body
8340 (N : Node_Id; Val : Boolean := True); -- Flag7
8342 procedure Set_Is_Static_Expression
8343 (N : Node_Id; Val : Boolean := True); -- Flag6
8345 procedure Set_Is_Subprogram_Descriptor
8346 (N : Node_Id; Val : Boolean := True); -- Flag16
8348 procedure Set_Is_Task_Allocation_Block
8349 (N : Node_Id; Val : Boolean := True); -- Flag6
8351 procedure Set_Is_Task_Master
8352 (N : Node_Id; Val : Boolean := True); -- Flag5
8354 procedure Set_Iteration_Scheme
8355 (N : Node_Id; Val : Node_Id); -- Node2
8358 (N : Node_Id; Val : Entity_Id); -- Node1
8360 procedure Set_Kill_Range_Check
8361 (N : Node_Id; Val : Boolean := True); -- Flag11
8363 procedure Set_Last_Bit
8364 (N : Node_Id; Val : Node_Id); -- Node4
8366 procedure Set_Last_Name
8367 (N : Node_Id; Val : Boolean := True); -- Flag6
8369 procedure Set_Library_Unit
8370 (N : Node_Id; Val : Node_Id); -- Node4
8372 procedure Set_Label_Construct
8373 (N : Node_Id; Val : Node_Id); -- Node2
8375 procedure Set_Left_Opnd
8376 (N : Node_Id; Val : Node_Id); -- Node2
8378 procedure Set_Limited_View_Installed
8379 (N : Node_Id; Val : Boolean := True); -- Flag18
8381 procedure Set_Limited_Present
8382 (N : Node_Id; Val : Boolean := True); -- Flag17
8384 procedure Set_Literals
8385 (N : Node_Id; Val : List_Id); -- List1
8387 procedure Set_Loop_Actions
8388 (N : Node_Id; Val : List_Id); -- List2
8390 procedure Set_Loop_Parameter_Specification
8391 (N : Node_Id; Val : Node_Id); -- Node4
8393 procedure Set_Low_Bound
8394 (N : Node_Id; Val : Node_Id); -- Node1
8396 procedure Set_Mod_Clause
8397 (N : Node_Id; Val : Node_Id); -- Node2
8399 procedure Set_More_Ids
8400 (N : Node_Id; Val : Boolean := True); -- Flag5
8402 procedure Set_Must_Be_Byte_Aligned
8403 (N : Node_Id; Val : Boolean := True); -- Flag14
8405 procedure Set_Must_Not_Freeze
8406 (N : Node_Id; Val : Boolean := True); -- Flag8
8408 procedure Set_Must_Not_Override
8409 (N : Node_Id; Val : Boolean := True); -- Flag15
8411 procedure Set_Must_Override
8412 (N : Node_Id; Val : Boolean := True); -- Flag14
8415 (N : Node_Id; Val : Node_Id); -- Node2
8418 (N : Node_Id; Val : List_Id); -- List2
8420 procedure Set_Next_Entity
8421 (N : Node_Id; Val : Node_Id); -- Node2
8423 procedure Set_Next_Named_Actual
8424 (N : Node_Id; Val : Node_Id); -- Node4
8426 procedure Set_Next_Rep_Item
8427 (N : Node_Id; Val : Node_Id); -- Node4
8429 procedure Set_Next_Use_Clause
8430 (N : Node_Id; Val : Node_Id); -- Node3
8432 procedure Set_No_Ctrl_Actions
8433 (N : Node_Id; Val : Boolean := True); -- Flag7
8435 procedure Set_No_Elaboration_Check
8436 (N : Node_Id; Val : Boolean := True); -- Flag14
8438 procedure Set_No_Entities_Ref_In_Spec
8439 (N : Node_Id; Val : Boolean := True); -- Flag8
8441 procedure Set_No_Initialization
8442 (N : Node_Id; Val : Boolean := True); -- Flag13
8444 procedure Set_No_Truncation
8445 (N : Node_Id; Val : Boolean := True); -- Flag17
8447 procedure Set_Null_Present
8448 (N : Node_Id; Val : Boolean := True); -- Flag13
8450 procedure Set_Null_Exclusion_Present
8451 (N : Node_Id; Val : Boolean := True); -- Flag11
8453 procedure Set_Null_Record_Present
8454 (N : Node_Id; Val : Boolean := True); -- Flag17
8456 procedure Set_Object_Definition
8457 (N : Node_Id; Val : Node_Id); -- Node4
8459 procedure Set_Original_Discriminant
8460 (N : Node_Id; Val : Node_Id); -- Node2
8462 procedure Set_Original_Entity
8463 (N : Node_Id; Val : Entity_Id); -- Node2
8465 procedure Set_Others_Discrete_Choices
8466 (N : Node_Id; Val : List_Id); -- List1
8468 procedure Set_Out_Present
8469 (N : Node_Id; Val : Boolean := True); -- Flag17
8471 procedure Set_Parameter_Associations
8472 (N : Node_Id; Val : List_Id); -- List3
8474 procedure Set_Parameter_List_Truncated
8475 (N : Node_Id; Val : Boolean := True); -- Flag17
8477 procedure Set_Parameter_Specifications
8478 (N : Node_Id; Val : List_Id); -- List3
8480 procedure Set_Parameter_Type
8481 (N : Node_Id; Val : Node_Id); -- Node2
8483 procedure Set_Parent_Spec
8484 (N : Node_Id; Val : Node_Id); -- Node4
8486 procedure Set_Position
8487 (N : Node_Id; Val : Node_Id); -- Node2
8489 procedure Set_Pragma_Argument_Associations
8490 (N : Node_Id; Val : List_Id); -- List2
8492 procedure Set_Pragmas_After
8493 (N : Node_Id; Val : List_Id); -- List5
8495 procedure Set_Pragmas_Before
8496 (N : Node_Id; Val : List_Id); -- List4
8498 procedure Set_Prefix
8499 (N : Node_Id; Val : Node_Id); -- Node3
8501 procedure Set_Present_Expr
8502 (N : Node_Id; Val : Uint); -- Uint3
8504 procedure Set_Prev_Ids
8505 (N : Node_Id; Val : Boolean := True); -- Flag6
8507 procedure Set_Print_In_Hex
8508 (N : Node_Id; Val : Boolean := True); -- Flag13
8510 procedure Set_Private_Declarations
8511 (N : Node_Id; Val : List_Id); -- List3
8513 procedure Set_Private_Present
8514 (N : Node_Id; Val : Boolean := True); -- Flag15
8516 procedure Set_Procedure_To_Call
8517 (N : Node_Id; Val : Node_Id); -- Node4
8519 procedure Set_Proper_Body
8520 (N : Node_Id; Val : Node_Id); -- Node1
8522 procedure Set_Protected_Definition
8523 (N : Node_Id; Val : Node_Id); -- Node3
8525 procedure Set_Protected_Present
8526 (N : Node_Id; Val : Boolean := True); -- Flag6
8528 procedure Set_Raises_Constraint_Error
8529 (N : Node_Id; Val : Boolean := True); -- Flag7
8531 procedure Set_Range_Constraint
8532 (N : Node_Id; Val : Node_Id); -- Node4
8534 procedure Set_Range_Expression
8535 (N : Node_Id; Val : Node_Id); -- Node4
8537 procedure Set_Real_Range_Specification
8538 (N : Node_Id; Val : Node_Id); -- Node4
8540 procedure Set_Realval
8541 (N : Node_Id; Val : Ureal); -- Ureal3
8543 procedure Set_Reason
8544 (N : Node_Id; Val : Uint); -- Uint3
8546 procedure Set_Record_Extension_Part
8547 (N : Node_Id; Val : Node_Id); -- Node3
8549 procedure Set_Redundant_Use
8550 (N : Node_Id; Val : Boolean := True); -- Flag13
8552 procedure Set_Return_Type
8553 (N : Node_Id; Val : Node_Id); -- Node2
8555 procedure Set_Reverse_Present
8556 (N : Node_Id; Val : Boolean := True); -- Flag15
8558 procedure Set_Right_Opnd
8559 (N : Node_Id; Val : Node_Id); -- Node3
8561 procedure Set_Rounded_Result
8562 (N : Node_Id; Val : Boolean := True); -- Flag18
8565 (N : Node_Id; Val : Node_Id); -- Node3
8567 procedure Set_Select_Alternatives
8568 (N : Node_Id; Val : List_Id); -- List1
8570 procedure Set_Selector_Name
8571 (N : Node_Id; Val : Node_Id); -- Node2
8573 procedure Set_Selector_Names
8574 (N : Node_Id; Val : List_Id); -- List1
8576 procedure Set_Shift_Count_OK
8577 (N : Node_Id; Val : Boolean := True); -- Flag4
8579 procedure Set_Source_Type
8580 (N : Node_Id; Val : Entity_Id); -- Node1
8582 procedure Set_Specification
8583 (N : Node_Id; Val : Node_Id); -- Node1
8585 procedure Set_Statements
8586 (N : Node_Id; Val : List_Id); -- List3
8588 procedure Set_Static_Processing_OK
8589 (N : Node_Id; Val : Boolean); -- Flag4
8591 procedure Set_Storage_Pool
8592 (N : Node_Id; Val : Node_Id); -- Node1
8594 procedure Set_Strval
8595 (N : Node_Id; Val : String_Id); -- Str3
8597 procedure Set_Subtype_Indication
8598 (N : Node_Id; Val : Node_Id); -- Node5
8600 procedure Set_Subtype_Mark
8601 (N : Node_Id; Val : Node_Id); -- Node4
8603 procedure Set_Subtype_Marks
8604 (N : Node_Id; Val : List_Id); -- List2
8606 procedure Set_Synchronized_Present
8607 (N : Node_Id; Val : Boolean := True); -- Flag7
8609 procedure Set_Tagged_Present
8610 (N : Node_Id; Val : Boolean := True); -- Flag15
8612 procedure Set_Target_Type
8613 (N : Node_Id; Val : Entity_Id); -- Node2
8615 procedure Set_Task_Definition
8616 (N : Node_Id; Val : Node_Id); -- Node3
8618 procedure Set_Task_Present
8619 (N : Node_Id; Val : Boolean := True); -- Flag5
8621 procedure Set_Then_Actions
8622 (N : Node_Id; Val : List_Id); -- List2
8624 procedure Set_Then_Statements
8625 (N : Node_Id; Val : List_Id); -- List2
8627 procedure Set_Treat_Fixed_As_Integer
8628 (N : Node_Id; Val : Boolean := True); -- Flag14
8630 procedure Set_Triggering_Alternative
8631 (N : Node_Id; Val : Node_Id); -- Node1
8633 procedure Set_Triggering_Statement
8634 (N : Node_Id; Val : Node_Id); -- Node1
8636 procedure Set_TSS_Elist
8637 (N : Node_Id; Val : Elist_Id); -- Elist3
8639 procedure Set_Type_Definition
8640 (N : Node_Id; Val : Node_Id); -- Node3
8643 (N : Node_Id; Val : Node_Id); -- Node2
8645 procedure Set_Unknown_Discriminants_Present
8646 (N : Node_Id; Val : Boolean := True); -- Flag13
8648 procedure Set_Unreferenced_In_Spec
8649 (N : Node_Id; Val : Boolean := True); -- Flag7
8651 procedure Set_Variant_Part
8652 (N : Node_Id; Val : Node_Id); -- Node4
8654 procedure Set_Variants
8655 (N : Node_Id; Val : List_Id); -- List1
8657 procedure Set_Visible_Declarations
8658 (N : Node_Id; Val : List_Id); -- List2
8660 procedure Set_Was_Originally_Stub
8661 (N : Node_Id; Val : Boolean := True); -- Flag13
8663 procedure Set_Zero_Cost_Handling
8664 (N : Node_Id; Val : Boolean := True); -- Flag5
8666 -------------------------
8667 -- Iterator Procedures --
8668 -------------------------
8670 -- The call to Next_xxx (N) is equivalent to N := Next_xxx (N)
8672 procedure Next_Entity (N : in out Node_Id);
8673 procedure Next_Named_Actual (N : in out Node_Id);
8674 procedure Next_Rep_Item (N : in out Node_Id);
8675 procedure Next_Use_Clause (N : in out Node_Id);
8677 --------------------------------------
8678 -- Logical Access to End_Span Field --
8679 --------------------------------------
8681 function End_Location (N : Node_Id) return Source_Ptr;
8682 -- N is an N_If_Statement or N_Case_Statement node, and this
8683 -- function returns the location of the IF token in the END IF
8684 -- sequence by translating the value of the End_Span field.
8686 procedure Set_End_Location (N : Node_Id; S : Source_Ptr);
8687 -- N is an N_If_Statement or N_Case_Statement node. This procedure
8688 -- sets the End_Span field to correspond to the given value S. In
8689 -- other words, End_Span is set to the difference between S and
8690 -- Sloc (N), the starting location.
8692 --------------------
8693 -- Inline Pragmas --
8694 --------------------
8696 pragma Inline (ABE_Is_Certain);
8697 pragma Inline (Abort_Present);
8698 pragma Inline (Abortable_Part);
8699 pragma Inline (Abstract_Present);
8700 pragma Inline (Accept_Handler_Records);
8701 pragma Inline (Accept_Statement);
8702 pragma Inline (Access_Definition);
8703 pragma Inline (Access_To_Subprogram_Definition);
8704 pragma Inline (Access_Types_To_Process);
8705 pragma Inline (Actions);
8706 pragma Inline (Activation_Chain_Entity);
8707 pragma Inline (Acts_As_Spec);
8708 pragma Inline (Aggregate_Bounds);
8709 pragma Inline (Aliased_Present);
8710 pragma Inline (All_Others);
8711 pragma Inline (All_Present);
8712 pragma Inline (Alternatives);
8713 pragma Inline (Ancestor_Part);
8714 pragma Inline (Array_Aggregate);
8715 pragma Inline (Assignment_OK);
8716 pragma Inline (Associated_Node);
8717 pragma Inline (At_End_Proc);
8718 pragma Inline (Attribute_Name);
8719 pragma Inline (Aux_Decls_Node);
8720 pragma Inline (Backwards_OK);
8721 pragma Inline (Bad_Is_Detected);
8722 pragma Inline (Body_To_Inline);
8723 pragma Inline (Body_Required);
8724 pragma Inline (By_Ref);
8725 pragma Inline (Box_Present);
8726 pragma Inline (Char_Literal_Value);
8727 pragma Inline (Chars);
8728 pragma Inline (Check_Address_Alignment);
8729 pragma Inline (Choice_Parameter);
8730 pragma Inline (Choices);
8731 pragma Inline (Compile_Time_Known_Aggregate);
8732 pragma Inline (Component_Associations);
8733 pragma Inline (Component_Clauses);
8734 pragma Inline (Component_Definition);
8735 pragma Inline (Component_Items);
8736 pragma Inline (Component_List);
8737 pragma Inline (Component_Name);
8738 pragma Inline (Condition);
8739 pragma Inline (Condition_Actions);
8740 pragma Inline (Config_Pragmas);
8741 pragma Inline (Constant_Present);
8742 pragma Inline (Constraint);
8743 pragma Inline (Constraints);
8744 pragma Inline (Context_Installed);
8745 pragma Inline (Context_Items);
8746 pragma Inline (Controlling_Argument);
8747 pragma Inline (Conversion_OK);
8748 pragma Inline (Corresponding_Body);
8749 pragma Inline (Corresponding_Formal_Spec);
8750 pragma Inline (Corresponding_Generic_Association);
8751 pragma Inline (Corresponding_Integer_Value);
8752 pragma Inline (Corresponding_Spec);
8753 pragma Inline (Corresponding_Stub);
8754 pragma Inline (Dcheck_Function);
8755 pragma Inline (Debug_Statement);
8756 pragma Inline (Declarations);
8757 pragma Inline (Default_Expression);
8758 pragma Inline (Default_Name);
8759 pragma Inline (Defining_Identifier);
8760 pragma Inline (Defining_Unit_Name);
8761 pragma Inline (Delay_Alternative);
8762 pragma Inline (Delay_Finalize_Attach);
8763 pragma Inline (Delay_Statement);
8764 pragma Inline (Delta_Expression);
8765 pragma Inline (Digits_Expression);
8766 pragma Inline (Discr_Check_Funcs_Built);
8767 pragma Inline (Discrete_Choices);
8768 pragma Inline (Discrete_Range);
8769 pragma Inline (Discrete_Subtype_Definition);
8770 pragma Inline (Discrete_Subtype_Definitions);
8771 pragma Inline (Discriminant_Specifications);
8772 pragma Inline (Discriminant_Type);
8773 pragma Inline (Do_Accessibility_Check);
8774 pragma Inline (Do_Discriminant_Check);
8775 pragma Inline (Do_Length_Check);
8776 pragma Inline (Do_Division_Check);
8777 pragma Inline (Do_Overflow_Check);
8778 pragma Inline (Do_Range_Check);
8779 pragma Inline (Do_Storage_Check);
8780 pragma Inline (Do_Tag_Check);
8781 pragma Inline (Elaborate_Present);
8782 pragma Inline (Elaborate_All_Present);
8783 pragma Inline (Elaboration_Boolean);
8784 pragma Inline (Else_Actions);
8785 pragma Inline (Else_Statements);
8786 pragma Inline (Elsif_Parts);
8787 pragma Inline (Enclosing_Variant);
8788 pragma Inline (End_Label);
8789 pragma Inline (End_Span);
8790 pragma Inline (Entity);
8791 pragma Inline (Entity_Or_Associated_Node);
8792 pragma Inline (Entry_Body_Formal_Part);
8793 pragma Inline (Entry_Call_Alternative);
8794 pragma Inline (Entry_Call_Statement);
8795 pragma Inline (Entry_Direct_Name);
8796 pragma Inline (Entry_Index);
8797 pragma Inline (Entry_Index_Specification);
8798 pragma Inline (Etype);
8799 pragma Inline (Exception_Choices);
8800 pragma Inline (Exception_Junk);
8801 pragma Inline (Exception_Handlers);
8802 pragma Inline (Expansion_Delayed);
8803 pragma Inline (Explicit_Actual_Parameter);
8804 pragma Inline (Explicit_Generic_Actual_Parameter);
8805 pragma Inline (Expression);
8806 pragma Inline (Expressions);
8807 pragma Inline (First_Bit);
8808 pragma Inline (First_Inlined_Subprogram);
8809 pragma Inline (First_Name);
8810 pragma Inline (First_Named_Actual);
8811 pragma Inline (First_Real_Statement);
8812 pragma Inline (First_Subtype_Link);
8813 pragma Inline (Float_Truncate);
8814 pragma Inline (Formal_Type_Definition);
8815 pragma Inline (Forwards_OK);
8816 pragma Inline (From_At_Mod);
8817 pragma Inline (From_Default);
8818 pragma Inline (Generic_Associations);
8819 pragma Inline (Generic_Formal_Declarations);
8820 pragma Inline (Generic_Parent);
8821 pragma Inline (Generic_Parent_Type);
8822 pragma Inline (Handled_Statement_Sequence);
8823 pragma Inline (Handler_List_Entry);
8824 pragma Inline (Has_Created_Identifier);
8825 pragma Inline (Has_Dynamic_Length_Check);
8826 pragma Inline (Has_Dynamic_Range_Check);
8827 pragma Inline (Has_No_Elaboration_Code);
8828 pragma Inline (Has_Priority_Pragma);
8829 pragma Inline (Has_Private_View);
8830 pragma Inline (Has_Storage_Size_Pragma);
8831 pragma Inline (Has_Task_Info_Pragma);
8832 pragma Inline (Has_Task_Name_Pragma);
8833 pragma Inline (Has_Wide_Character);
8834 pragma Inline (Hidden_By_Use_Clause);
8835 pragma Inline (High_Bound);
8836 pragma Inline (Identifier);
8837 pragma Inline (Implicit_With);
8838 pragma Inline (Interface_List);
8839 pragma Inline (Interface_Present);
8840 pragma Inline (Includes_Infinities);
8841 pragma Inline (In_Present);
8842 pragma Inline (Instance_Spec);
8843 pragma Inline (Intval);
8844 pragma Inline (Is_Asynchronous_Call_Block);
8845 pragma Inline (Is_Component_Left_Opnd);
8846 pragma Inline (Is_Component_Right_Opnd);
8847 pragma Inline (Is_Controlling_Actual);
8848 pragma Inline (Is_In_Discriminant_Check);
8849 pragma Inline (Is_Machine_Number);
8850 pragma Inline (Is_Null_Loop);
8851 pragma Inline (Is_Overloaded);
8852 pragma Inline (Is_Power_Of_2_For_Shift);
8853 pragma Inline (Is_Protected_Subprogram_Body);
8854 pragma Inline (Is_Static_Expression);
8855 pragma Inline (Is_Subprogram_Descriptor);
8856 pragma Inline (Is_Task_Allocation_Block);
8857 pragma Inline (Is_Task_Master);
8858 pragma Inline (Iteration_Scheme);
8859 pragma Inline (Itype);
8860 pragma Inline (Kill_Range_Check);
8861 pragma Inline (Last_Bit);
8862 pragma Inline (Last_Name);
8863 pragma Inline (Library_Unit);
8864 pragma Inline (Label_Construct);
8865 pragma Inline (Left_Opnd);
8866 pragma Inline (Limited_View_Installed);
8867 pragma Inline (Limited_Present);
8868 pragma Inline (Literals);
8869 pragma Inline (Loop_Actions);
8870 pragma Inline (Loop_Parameter_Specification);
8871 pragma Inline (Low_Bound);
8872 pragma Inline (Mod_Clause);
8873 pragma Inline (More_Ids);
8874 pragma Inline (Must_Be_Byte_Aligned);
8875 pragma Inline (Must_Not_Freeze);
8876 pragma Inline (Must_Not_Override);
8877 pragma Inline (Must_Override);
8878 pragma Inline (Name);
8879 pragma Inline (Names);
8880 pragma Inline (Next_Entity);
8881 pragma Inline (Next_Named_Actual);
8882 pragma Inline (Next_Rep_Item);
8883 pragma Inline (Next_Use_Clause);
8884 pragma Inline (No_Ctrl_Actions);
8885 pragma Inline (No_Elaboration_Check);
8886 pragma Inline (No_Entities_Ref_In_Spec);
8887 pragma Inline (No_Initialization);
8888 pragma Inline (No_Truncation);
8889 pragma Inline (Null_Present);
8890 pragma Inline (Null_Exclusion_Present);
8891 pragma Inline (Null_Record_Present);
8892 pragma Inline (Object_Definition);
8893 pragma Inline (Original_Discriminant);
8894 pragma Inline (Original_Entity);
8895 pragma Inline (Others_Discrete_Choices);
8896 pragma Inline (Out_Present);
8897 pragma Inline (Parameter_Associations);
8898 pragma Inline (Parameter_Specifications);
8899 pragma Inline (Parameter_List_Truncated);
8900 pragma Inline (Parameter_Type);
8901 pragma Inline (Parent_Spec);
8902 pragma Inline (Position);
8903 pragma Inline (Pragma_Argument_Associations);
8904 pragma Inline (Pragmas_After);
8905 pragma Inline (Pragmas_Before);
8906 pragma Inline (Prefix);
8907 pragma Inline (Present_Expr);
8908 pragma Inline (Prev_Ids);
8909 pragma Inline (Print_In_Hex);
8910 pragma Inline (Private_Declarations);
8911 pragma Inline (Private_Present);
8912 pragma Inline (Procedure_To_Call);
8913 pragma Inline (Proper_Body);
8914 pragma Inline (Protected_Definition);
8915 pragma Inline (Protected_Present);
8916 pragma Inline (Raises_Constraint_Error);
8917 pragma Inline (Range_Constraint);
8918 pragma Inline (Range_Expression);
8919 pragma Inline (Real_Range_Specification);
8920 pragma Inline (Realval);
8921 pragma Inline (Reason);
8922 pragma Inline (Record_Extension_Part);
8923 pragma Inline (Redundant_Use);
8924 pragma Inline (Return_Type);
8925 pragma Inline (Reverse_Present);
8926 pragma Inline (Right_Opnd);
8927 pragma Inline (Rounded_Result);
8928 pragma Inline (Scope);
8929 pragma Inline (Select_Alternatives);
8930 pragma Inline (Selector_Name);
8931 pragma Inline (Selector_Names);
8932 pragma Inline (Shift_Count_OK);
8933 pragma Inline (Source_Type);
8934 pragma Inline (Specification);
8935 pragma Inline (Statements);
8936 pragma Inline (Static_Processing_OK);
8937 pragma Inline (Storage_Pool);
8938 pragma Inline (Strval);
8939 pragma Inline (Subtype_Indication);
8940 pragma Inline (Subtype_Mark);
8941 pragma Inline (Subtype_Marks);
8942 pragma Inline (Synchronized_Present);
8943 pragma Inline (Tagged_Present);
8944 pragma Inline (Target_Type);
8945 pragma Inline (Task_Definition);
8946 pragma Inline (Task_Present);
8947 pragma Inline (Then_Actions);
8948 pragma Inline (Then_Statements);
8949 pragma Inline (Triggering_Alternative);
8950 pragma Inline (Triggering_Statement);
8951 pragma Inline (Treat_Fixed_As_Integer);
8952 pragma Inline (TSS_Elist);
8953 pragma Inline (Type_Definition);
8954 pragma Inline (Unit);
8955 pragma Inline (Unknown_Discriminants_Present);
8956 pragma Inline (Unreferenced_In_Spec);
8957 pragma Inline (Variant_Part);
8958 pragma Inline (Variants);
8959 pragma Inline (Visible_Declarations);
8960 pragma Inline (Was_Originally_Stub);
8961 pragma Inline (Zero_Cost_Handling);
8963 pragma Inline (Set_ABE_Is_Certain);
8964 pragma Inline (Set_Abort_Present);
8965 pragma Inline (Set_Abortable_Part);
8966 pragma Inline (Set_Abstract_Present);
8967 pragma Inline (Set_Accept_Handler_Records);
8968 pragma Inline (Set_Accept_Statement);
8969 pragma Inline (Set_Access_Definition);
8970 pragma Inline (Set_Access_To_Subprogram_Definition);
8971 pragma Inline (Set_Access_Types_To_Process);
8972 pragma Inline (Set_Actions);
8973 pragma Inline (Set_Activation_Chain_Entity);
8974 pragma Inline (Set_Acts_As_Spec);
8975 pragma Inline (Set_Aggregate_Bounds);
8976 pragma Inline (Set_Aliased_Present);
8977 pragma Inline (Set_All_Others);
8978 pragma Inline (Set_All_Present);
8979 pragma Inline (Set_Alternatives);
8980 pragma Inline (Set_Ancestor_Part);
8981 pragma Inline (Set_Array_Aggregate);
8982 pragma Inline (Set_Assignment_OK);
8983 pragma Inline (Set_Associated_Node);
8984 pragma Inline (Set_At_End_Proc);
8985 pragma Inline (Set_Attribute_Name);
8986 pragma Inline (Set_Aux_Decls_Node);
8987 pragma Inline (Set_Backwards_OK);
8988 pragma Inline (Set_Bad_Is_Detected);
8989 pragma Inline (Set_Body_To_Inline);
8990 pragma Inline (Set_Body_Required);
8991 pragma Inline (Set_By_Ref);
8992 pragma Inline (Set_Box_Present);
8993 pragma Inline (Set_Char_Literal_Value);
8994 pragma Inline (Set_Chars);
8995 pragma Inline (Set_Check_Address_Alignment);
8996 pragma Inline (Set_Choice_Parameter);
8997 pragma Inline (Set_Choices);
8998 pragma Inline (Set_Compile_Time_Known_Aggregate);
8999 pragma Inline (Set_Component_Associations);
9000 pragma Inline (Set_Component_Clauses);
9001 pragma Inline (Set_Component_Definition);
9002 pragma Inline (Set_Component_Items);
9003 pragma Inline (Set_Component_List);
9004 pragma Inline (Set_Component_Name);
9005 pragma Inline (Set_Condition);
9006 pragma Inline (Set_Condition_Actions);
9007 pragma Inline (Set_Config_Pragmas);
9008 pragma Inline (Set_Constant_Present);
9009 pragma Inline (Set_Constraint);
9010 pragma Inline (Set_Constraints);
9011 pragma Inline (Set_Context_Installed);
9012 pragma Inline (Set_Context_Items);
9013 pragma Inline (Set_Controlling_Argument);
9014 pragma Inline (Set_Conversion_OK);
9015 pragma Inline (Set_Corresponding_Body);
9016 pragma Inline (Set_Corresponding_Formal_Spec);
9017 pragma Inline (Set_Corresponding_Generic_Association);
9018 pragma Inline (Set_Corresponding_Integer_Value);
9019 pragma Inline (Set_Corresponding_Spec);
9020 pragma Inline (Set_Corresponding_Stub);
9021 pragma Inline (Set_Dcheck_Function);
9022 pragma Inline (Set_Debug_Statement);
9023 pragma Inline (Set_Declarations);
9024 pragma Inline (Set_Default_Expression);
9025 pragma Inline (Set_Default_Name);
9026 pragma Inline (Set_Defining_Identifier);
9027 pragma Inline (Set_Defining_Unit_Name);
9028 pragma Inline (Set_Delay_Alternative);
9029 pragma Inline (Set_Delay_Finalize_Attach);
9030 pragma Inline (Set_Delay_Statement);
9031 pragma Inline (Set_Delta_Expression);
9032 pragma Inline (Set_Digits_Expression);
9033 pragma Inline (Set_Discr_Check_Funcs_Built);
9034 pragma Inline (Set_Discrete_Choices);
9035 pragma Inline (Set_Discrete_Range);
9036 pragma Inline (Set_Discrete_Subtype_Definition);
9037 pragma Inline (Set_Discrete_Subtype_Definitions);
9038 pragma Inline (Set_Discriminant_Specifications);
9039 pragma Inline (Set_Discriminant_Type);
9040 pragma Inline (Set_Do_Accessibility_Check);
9041 pragma Inline (Set_Do_Discriminant_Check);
9042 pragma Inline (Set_Do_Length_Check);
9043 pragma Inline (Set_Do_Division_Check);
9044 pragma Inline (Set_Do_Overflow_Check);
9045 pragma Inline (Set_Do_Range_Check);
9046 pragma Inline (Set_Do_Storage_Check);
9047 pragma Inline (Set_Do_Tag_Check);
9048 pragma Inline (Set_Elaborate_Present);
9049 pragma Inline (Set_Elaborate_All_Present);
9050 pragma Inline (Set_Elaboration_Boolean);
9051 pragma Inline (Set_Else_Actions);
9052 pragma Inline (Set_Else_Statements);
9053 pragma Inline (Set_Elsif_Parts);
9054 pragma Inline (Set_Enclosing_Variant);
9055 pragma Inline (Set_End_Label);
9056 pragma Inline (Set_End_Span);
9057 pragma Inline (Set_Entity);
9058 pragma Inline (Set_Entry_Body_Formal_Part);
9059 pragma Inline (Set_Entry_Call_Alternative);
9060 pragma Inline (Set_Entry_Call_Statement);
9061 pragma Inline (Set_Entry_Direct_Name);
9062 pragma Inline (Set_Entry_Index);
9063 pragma Inline (Set_Entry_Index_Specification);
9064 pragma Inline (Set_Etype);
9065 pragma Inline (Set_Exception_Choices);
9066 pragma Inline (Set_Exception_Junk);
9067 pragma Inline (Set_Exception_Handlers);
9068 pragma Inline (Set_Expansion_Delayed);
9069 pragma Inline (Set_Explicit_Actual_Parameter);
9070 pragma Inline (Set_Explicit_Generic_Actual_Parameter);
9071 pragma Inline (Set_Expression);
9072 pragma Inline (Set_Expressions);
9073 pragma Inline (Set_First_Bit);
9074 pragma Inline (Set_First_Inlined_Subprogram);
9075 pragma Inline (Set_First_Name);
9076 pragma Inline (Set_First_Named_Actual);
9077 pragma Inline (Set_First_Real_Statement);
9078 pragma Inline (Set_First_Subtype_Link);
9079 pragma Inline (Set_Float_Truncate);
9080 pragma Inline (Set_Formal_Type_Definition);
9081 pragma Inline (Set_Forwards_OK);
9082 pragma Inline (Set_From_At_Mod);
9083 pragma Inline (Set_From_Default);
9084 pragma Inline (Set_Generic_Associations);
9085 pragma Inline (Set_Generic_Formal_Declarations);
9086 pragma Inline (Set_Generic_Parent);
9087 pragma Inline (Set_Generic_Parent_Type);
9088 pragma Inline (Set_Handled_Statement_Sequence);
9089 pragma Inline (Set_Handler_List_Entry);
9090 pragma Inline (Set_Has_Created_Identifier);
9091 pragma Inline (Set_Has_Dynamic_Length_Check);
9092 pragma Inline (Set_Has_Dynamic_Range_Check);
9093 pragma Inline (Set_Has_No_Elaboration_Code);
9094 pragma Inline (Set_Has_Priority_Pragma);
9095 pragma Inline (Set_Has_Private_View);
9096 pragma Inline (Set_Has_Storage_Size_Pragma);
9097 pragma Inline (Set_Has_Task_Info_Pragma);
9098 pragma Inline (Set_Has_Task_Name_Pragma);
9099 pragma Inline (Set_Has_Wide_Character);
9100 pragma Inline (Set_Hidden_By_Use_Clause);
9101 pragma Inline (Set_High_Bound);
9102 pragma Inline (Set_Identifier);
9103 pragma Inline (Set_Implicit_With);
9104 pragma Inline (Set_Includes_Infinities);
9105 pragma Inline (Set_Interface_List);
9106 pragma Inline (Set_Interface_Present);
9107 pragma Inline (Set_In_Present);
9108 pragma Inline (Set_Instance_Spec);
9109 pragma Inline (Set_Intval);
9110 pragma Inline (Set_Is_Asynchronous_Call_Block);
9111 pragma Inline (Set_Is_Component_Left_Opnd);
9112 pragma Inline (Set_Is_Component_Right_Opnd);
9113 pragma Inline (Set_Is_Controlling_Actual);
9114 pragma Inline (Set_Is_In_Discriminant_Check);
9115 pragma Inline (Set_Is_Machine_Number);
9116 pragma Inline (Set_Is_Null_Loop);
9117 pragma Inline (Set_Is_Overloaded);
9118 pragma Inline (Set_Is_Power_Of_2_For_Shift);
9119 pragma Inline (Set_Is_Protected_Subprogram_Body);
9120 pragma Inline (Set_Is_Static_Expression);
9121 pragma Inline (Set_Is_Subprogram_Descriptor);
9122 pragma Inline (Set_Is_Task_Allocation_Block);
9123 pragma Inline (Set_Is_Task_Master);
9124 pragma Inline (Set_Iteration_Scheme);
9125 pragma Inline (Set_Itype);
9126 pragma Inline (Set_Kill_Range_Check);
9127 pragma Inline (Set_Last_Bit);
9128 pragma Inline (Set_Last_Name);
9129 pragma Inline (Set_Library_Unit);
9130 pragma Inline (Set_Label_Construct);
9131 pragma Inline (Set_Left_Opnd);
9132 pragma Inline (Set_Limited_View_Installed);
9133 pragma Inline (Set_Limited_Present);
9134 pragma Inline (Set_Literals);
9135 pragma Inline (Set_Loop_Actions);
9136 pragma Inline (Set_Loop_Parameter_Specification);
9137 pragma Inline (Set_Low_Bound);
9138 pragma Inline (Set_Mod_Clause);
9139 pragma Inline (Set_More_Ids);
9140 pragma Inline (Set_Must_Be_Byte_Aligned);
9141 pragma Inline (Set_Must_Not_Freeze);
9142 pragma Inline (Set_Must_Not_Override);
9143 pragma Inline (Set_Must_Override);
9144 pragma Inline (Set_Name);
9145 pragma Inline (Set_Names);
9146 pragma Inline (Set_Next_Entity);
9147 pragma Inline (Set_Next_Named_Actual);
9148 pragma Inline (Set_Next_Use_Clause);
9149 pragma Inline (Set_No_Ctrl_Actions);
9150 pragma Inline (Set_No_Elaboration_Check);
9151 pragma Inline (Set_No_Entities_Ref_In_Spec);
9152 pragma Inline (Set_No_Initialization);
9153 pragma Inline (Set_No_Truncation);
9154 pragma Inline (Set_Null_Present);
9155 pragma Inline (Set_Null_Exclusion_Present);
9156 pragma Inline (Set_Null_Record_Present);
9157 pragma Inline (Set_Object_Definition);
9158 pragma Inline (Set_Original_Discriminant);
9159 pragma Inline (Set_Original_Entity);
9160 pragma Inline (Set_Others_Discrete_Choices);
9161 pragma Inline (Set_Out_Present);
9162 pragma Inline (Set_Parameter_Associations);
9163 pragma Inline (Set_Parameter_Specifications);
9164 pragma Inline (Set_Parameter_List_Truncated);
9165 pragma Inline (Set_Parameter_Type);
9166 pragma Inline (Set_Parent_Spec);
9167 pragma Inline (Set_Position);
9168 pragma Inline (Set_Pragma_Argument_Associations);
9169 pragma Inline (Set_Pragmas_After);
9170 pragma Inline (Set_Pragmas_Before);
9171 pragma Inline (Set_Prefix);
9172 pragma Inline (Set_Present_Expr);
9173 pragma Inline (Set_Prev_Ids);
9174 pragma Inline (Set_Print_In_Hex);
9175 pragma Inline (Set_Private_Declarations);
9176 pragma Inline (Set_Private_Present);
9177 pragma Inline (Set_Procedure_To_Call);
9178 pragma Inline (Set_Proper_Body);
9179 pragma Inline (Set_Protected_Definition);
9180 pragma Inline (Set_Protected_Present);
9181 pragma Inline (Set_Raises_Constraint_Error);
9182 pragma Inline (Set_Range_Constraint);
9183 pragma Inline (Set_Range_Expression);
9184 pragma Inline (Set_Real_Range_Specification);
9185 pragma Inline (Set_Realval);
9186 pragma Inline (Set_Reason);
9187 pragma Inline (Set_Record_Extension_Part);
9188 pragma Inline (Set_Redundant_Use);
9189 pragma Inline (Set_Return_Type);
9190 pragma Inline (Set_Reverse_Present);
9191 pragma Inline (Set_Right_Opnd);
9192 pragma Inline (Set_Rounded_Result);
9193 pragma Inline (Set_Scope);
9194 pragma Inline (Set_Select_Alternatives);
9195 pragma Inline (Set_Selector_Name);
9196 pragma Inline (Set_Selector_Names);
9197 pragma Inline (Set_Shift_Count_OK);
9198 pragma Inline (Set_Source_Type);
9199 pragma Inline (Set_Specification);
9200 pragma Inline (Set_Statements);
9201 pragma Inline (Set_Static_Processing_OK);
9202 pragma Inline (Set_Storage_Pool);
9203 pragma Inline (Set_Strval);
9204 pragma Inline (Set_Subtype_Indication);
9205 pragma Inline (Set_Subtype_Mark);
9206 pragma Inline (Set_Subtype_Marks);
9207 pragma Inline (Set_Synchronized_Present);
9208 pragma Inline (Set_Tagged_Present);
9209 pragma Inline (Set_Target_Type);
9210 pragma Inline (Set_Task_Definition);
9211 pragma Inline (Set_Task_Present);
9212 pragma Inline (Set_Then_Actions);
9213 pragma Inline (Set_Then_Statements);
9214 pragma Inline (Set_Triggering_Alternative);
9215 pragma Inline (Set_Triggering_Statement);
9216 pragma Inline (Set_Treat_Fixed_As_Integer);
9217 pragma Inline (Set_TSS_Elist);
9218 pragma Inline (Set_Type_Definition);
9219 pragma Inline (Set_Unit);
9220 pragma Inline (Set_Unknown_Discriminants_Present);
9221 pragma Inline (Set_Unreferenced_In_Spec);
9222 pragma Inline (Set_Variant_Part);
9223 pragma Inline (Set_Variants);
9224 pragma Inline (Set_Visible_Declarations);
9225 pragma Inline (Set_Was_Originally_Stub);
9226 pragma Inline (Set_Zero_Cost_Handling);