OSDN Git Service

optimize
[pf3gnuchains/gcc-fork.git] / gcc / ada / atree.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                                A T R E E                                 --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2004, Free Software Foundation, Inc.         --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
19 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
20 -- MA 02111-1307, USA.                                                      --
21 --                                                                          --
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.                                      --
28 --                                                                          --
29 -- GNAT was originally developed  by the GNAT team at  New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
34 with Alloc;
35 with Sinfo;  use Sinfo;
36 with Einfo;  use Einfo;
37 with Types;  use Types;
38 with Snames; use Snames;
39 with System; use System;
40 with Table;
41 with Uintp;  use Uintp;
42 with Urealp; use Urealp;
43 with Unchecked_Conversion;
44
45 package Atree is
46
47 --  This package defines the format of the tree used to represent the Ada
48 --  program internally. Syntactic and semantic information is combined in
49 --  this tree. There is no separate symbol table structure.
50
51 --  WARNING: There is a C version of this package. Any changes to this
52 --  source file must be properly reflected in the C header file tree.h
53
54 --  Package Atree defines the basic structure of the tree and its nodes and
55 --  provides the basic abstract interface for manipulating the tree. Two
56 --  other packages use this interface to define the representation of Ada
57 --  programs using this tree format. The package Sinfo defines the basic
58 --  representation of the syntactic structure of the program, as output
59 --  by the parser. The package Entity_Info defines the semantic information
60 --  which is added to the tree nodes that represent declared entities (i.e.
61 --  the information which might typically be described in a separate symbol
62 --  table structure.
63
64 --  The front end of the compiler first parses the program and generates a
65 --  tree that is simply a syntactic representation of the program in abstract
66 --  syntax tree format. Subsequent processing in the front end traverses the
67 --  tree, transforming it in various ways and adding semantic information.
68
69    ----------------------------------------
70    -- Definitions of Fields in Tree Node --
71    ----------------------------------------
72
73    --  The representation of the tree is completely hidden, using a functional
74    --  interface for accessing and modifying the contents of nodes. Logically
75    --  a node contains a number of fields, much as though the nodes were
76    --  defined as a record type. The fields in a node are as follows:
77
78    --   Nkind            Indicates the kind of the node. This field is present
79    --                    in all nodes. The type is Node_Kind, which is declared
80    --                    in the package Sinfo.
81
82    --   Sloc             Location (Source_Ptr) of the corresponding token
83    --                    in the Source buffer. The individual node definitions
84    --                    show which token is referenced by this pointer.
85
86    --   In_List          A flag used to indicate if the node is a member
87    --                    of a node list.
88
89    --   Rewrite_Sub      A flag set if the node has been rewritten using
90    --                    the Rewrite procedure. The original value of the
91    --                    node is retrievable with Original_Node.
92
93    --   Rewrite_Ins      A flag set if a node is marked as a rewrite inserted
94    --                    node as a result of a call to Mark_Rewrite_Insertion.
95
96    --   Paren_Count      A 2-bit count used on expression nodes to indicate
97    --                    the level of parentheses. Up to 3 levels can be
98    --                    accomodated. Anything more than 3 levels is treated
99    --                    as 3 levels (conformance tests that complain about
100    --                    this are hereby deemed pathological!) Set to zero
101    --                    for non-subexpression nodes.
102
103    --   Comes_From_Source
104    --                    This flag is present in all nodes. It is set if the
105    --                    node is built by the scanner or parser, and clear if
106    --                    the node is built by the analyzer or expander. It
107    --                    indicates that the node corresponds to a construct
108    --                    that appears in the original source program.
109
110    --   Analyzed         This flag is present in all nodes. It is set when
111    --                    a node is analyzed, and is used to avoid analyzing
112    --                    the same node twice. Analysis includes expansion if
113    --                    expansion is active, so in this case if the flag is
114    --                    set it means the node has been analyzed and expanded.
115
116    --   Error_Posted     This flag is present in all nodes. It is set when
117    --                    an error message is posted which is associated with
118    --                    the flagged node. This is used to avoid posting more
119    --                    than one message on the same node.
120
121    --   Field1
122    --   Field2
123    --   Field3
124    --   Field4
125    --   Field5           Five fields holding Union_Id values
126
127    --   Char_CodeN       Synonym for FieldN typed as Char_Code
128    --   ElistN           Synonym for FieldN typed as Elist_Id
129    --   ListN            Synonym for FieldN typed as List_Id
130    --   NameN            Synonym for FieldN typed as Name_Id
131    --   NodeN            Synonym for FieldN typed as Node_Id
132    --   StrN             Synonym for FieldN typed as String_Id
133    --   UintN            Synonym for FieldN typed as Uint (Empty = Uint_0)
134    --   UrealN           Synonym for FieldN typed as Ureal
135
136    --   Note: the actual usage of FieldN (i.e. whether it contains a Char_Code,
137    --   Elist_Id, List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal), depends
138    --   on the value in Nkind. Generally the access to this field is always via
139    --   the functional interface, so the field names Char_CodeN, ElistN, ListN,
140    --   NameN, NodeN, StrN, UintN and UrealN are used only in the bodies of the
141    --   access functions (i.e. in the bodies of Sinfo and Einfo). These access
142    --   functions contain debugging code that checks that the use is consistent
143    --   with Nkind and Ekind values.
144
145    --   However, in specialized circumstances (examples are the circuit in
146    --   generic instantiation to copy trees, and in the tree dump routine),
147    --   it is useful to be able to do untyped traversals, and an internal
148    --   package in Atree allows for direct untyped accesses in such cases.
149
150    --   Flag4            Fifteen Boolean flags (use depends on Nkind and
151    --   Flag5            Ekind, as described for FieldN). Again the access
152    --   Flag6            is usually via subprograms in Sinfo and Einfo which
153    --   Flag7            provide high-level synonyms for these flags, and
154    --   Flag8            contain debugging code that checks that the values
155    --   Flag9            in Nkind and Ekind are appropriate for the access.
156    --   Flag10
157    --   Flag11           Note that Flag1-3 are missing from this list. The
158    --   Flag12           first three flag positions are reserved for the
159    --   Flag13           standard flags (Comes_From_Source, Error_Posted,
160    --   Flag14           and Analyzed)
161    --   Flag15
162    --   Flag16
163    --   Flag17
164    --   Flag18
165
166    --   Link             For a node, points to the Parent. For a list, points
167    --                    to the list header. Note that in the latter case, a
168    --                    client cannot modify the link field. This field is
169    --                    private to the Atree package (but is also modified
170    --                    by the Nlists package).
171
172    --  The following additional fields are present in extended nodes used
173    --  for entities (Nkind in N_Entity).
174
175    --   Ekind            Entity type. This field indicates the type of the
176    --                    entity, it is of type Entity_Kind which is defined
177    --                    in package Einfo.
178
179    --   Flag19           133 additional flags
180    --   ...
181    --   Flag151
182
183    --   Convention       Entity convention (Convention_Id value)
184
185    --   Field6           Additional Union_Id value stored in tree
186
187    --   Node6            Synonym for Field6 typed as Node_Id
188    --   Elist6           Synonym for Field6 typed as Elist_Id
189    --   Uint6            Synonym for Field6 typed as Uint (Empty = Uint_0)
190
191    --   Similar definitions for Field7 to Field23 (and Node7-Node23,
192    --   Elist7-Elist23, Uint7-Uint23, Ureal7-Ureal23). Note that not all
193    --   these functions are defined, only the ones that are actually used.
194
195    type Paren_Count_Type is mod 4;
196    for Paren_Count_Type'Size use 2;
197    --  Type used for Paren_Count field
198
199    function Last_Node_Id return Node_Id;
200    pragma Inline (Last_Node_Id);
201    --  Returns Id of last allocated node Id
202
203    function Nodes_Address return System.Address;
204    --  Return address of Nodes table (used in Back_End for Gigi call)
205
206    function Num_Nodes return Nat;
207    --  Total number of nodes allocated, where an entity counts as a single
208    --  node. This count is incremented every time a node or entity is
209    --  allocated, and decremented every time a node or entity is deleted.
210    --  This value is used by Xref and by Treepr to allocate hash tables of
211    --  suitable size for hashing Node_Id values.
212
213    -----------------------
214    -- Use of Empty Node --
215    -----------------------
216
217    --  The special Node_Id Empty is used to mark missing fields. Whenever the
218    --  syntax has an optional component, then the corresponding field will be
219    --  set to Empty if the component is missing.
220
221    --  Note: Empty is not used to describe an empty list. Instead in this
222    --  case the node field contains a list which is empty, and these cases
223    --  should be distinguished (essentially from a type point of view, Empty
224    --  is a Node, and is thus not a list).
225
226    --  Note: Empty does in fact correspond to an allocated node. Only the
227    --  Nkind field of this node may be referenced. It contains N_Empty, which
228    --  uniquely identifies the empty case. This allows the Nkind field to be
229    --  dereferenced before the check for Empty which is sometimes useful.
230
231    -----------------------
232    -- Use of Error Node --
233    -----------------------
234
235    --  The Error node is used during syntactic and semantic analysis to
236    --  indicate that the corresponding piece of syntactic structure or
237    --  semantic meaning cannot properly be represented in the tree because
238    --  of an illegality in the program.
239
240    --  If an Error node is encountered, then you know that a previous
241    --  illegality has been detected. The proper reaction should be to
242    --  avoid posting related cascaded error messages, and to propagate
243    --  the error node if necessary.
244
245    ------------------------
246    -- Current_Error_Node --
247    ------------------------
248
249    --  The current error node is a global location indicating the current
250    --  node that is being processed for the purposes of placing a compiler
251    --  abort message. This is not necessarily perfectly accurate, it is
252    --  just a reasonably accurate best guess. It is used to output the
253    --  source location in the abort message by Comperr, and also to
254    --  implement the d3 debugging flag. This is also used by Rtsfind
255    --  to generate error messages for high integrity mode.
256
257    --  There are two ways this gets set. During parsing, when new source
258    --  nodes are being constructed by calls to New_Node and New_Entity,
259    --  either one of these calls sets Current_Error_Node to the newly
260    --  created node. During semantic analysis, this mechanism is not
261    --  used, and instead Current_Error_Node is set by the subprograms in
262    --  Debug_A that mark the start and end of analysis/expansion of a
263    --  node in the tree.
264
265    Current_Error_Node : Node_Id;
266    --  Node to place error messages
267
268    -------------------------------
269    -- Default Setting of Fields --
270    -------------------------------
271
272    --  Nkind is set to N_Unused_At_Start
273
274    --  Ekind is set to E_Void
275
276    --  Sloc is always set, there is no default value
277
278    --  Field1-5 fields are set to Empty
279
280    --  Field6-22 fields in extended nodes are set to Empty
281
282    --  Parent is set to Empty
283
284    --  All Boolean flag fields are set to False
285
286    --  Note: the value Empty is used in Field1-Field17 to indicate a null node.
287    --  The usage varies. The common uses are to indicate absence of an
288    --  optional clause or a completely unused Field1-17 field.
289
290    -------------------------------------
291    -- Use of Synonyms for Node Fields --
292    -------------------------------------
293
294    --  A subpackage Atree.Unchecked_Access provides routines for reading and
295    --  writing the fields defined above (Field1-17, Node1-17, Flag1-88 etc).
296    --  These unchecked access routines can be used for untyped traversals.
297    --  In addition they are used in the implementations of the Sinfo and
298    --  Einfo packages. These packages both provide logical synonyms for
299    --  the generic fields, together with an appropriate set of access routines.
300    --  Normally access to information within tree nodes uses these synonyms,
301    --  providing a high level typed interface to the tree information.
302
303    --------------------------------------------------
304    -- Node Allocation and Modification Subprograms --
305    --------------------------------------------------
306
307    --  Generally the parser builds the tree and then it is further decorated
308    --  (e.g. by setting the entity fields), but not fundamentally modified.
309    --  However, there are cases in which the tree must be restructured by
310    --  adding and rearranging nodes, as a result of disambiguating cases
311    --  which the parser could not parse correctly, and adding additional
312    --  semantic information (e.g. making constraint checks explicit). The
313    --  following subprograms are used for constructing the tree in the first
314    --  place, and then for subsequent modifications as required
315
316    procedure Initialize;
317    --  Called at the start of compilation to initialize the allocation of
318    --  the node and list tables and make the standard entries for Empty,
319    --  Error and Error_List. Note that Initialize must not be called if
320    --  Tree_Read is used.
321
322    procedure Lock;
323    --  Called before the backend is invoked to lock the nodes table
324
325    procedure Tree_Read;
326    --  Initializes internal tables from current tree file using Tree_Read.
327    --  Note that Initialize should not be called if Tree_Read is used.
328    --  Tree_Read includes all necessary initialization.
329
330    procedure Tree_Write;
331    --  Writes out internal tables to current tree file using Tree_Write
332
333    function New_Node
334      (New_Node_Kind : Node_Kind;
335       New_Sloc      : Source_Ptr) return Node_Id;
336    --  Allocates a completely new node with the given node type and source
337    --  location values. All other fields are set to their standard defaults:
338    --
339    --    Empty for all FieldN fields
340    --    False for all FlagN fields
341    --
342    --  The usual approach is to build a new node using this function and
343    --  then, using the value returned, use the Set_xxx functions to set
344    --  fields of the node as required. New_Node can only be used for
345    --  non-entity nodes, i.e. it never generates an extended node.
346    --
347    --  If we are currently parsing, as indicated by a previous call to
348    --  Set_Comes_From_Source_Default (True), then this call also resets
349    --  the value of Current_Error_Node.
350
351    function New_Entity
352      (New_Node_Kind : Node_Kind;
353       New_Sloc      : Source_Ptr) return Entity_Id;
354    --  Similar to New_Node, except that it is used only for entity nodes
355    --  and returns an extended node.
356
357    procedure Set_Comes_From_Source_Default (Default : Boolean);
358    --  Sets value of Comes_From_Source flag to be used in all subsequent
359    --  New_Node and New_Entity calls until another call to this procedure
360    --  changes the default. This value is set True during parsing and
361    --  False during semantic analysis. This is also used to determine
362    --  if New_Node and New_Entity should set Current_Error_Node.
363
364    function Get_Comes_From_Source_Default return Boolean;
365    pragma Inline (Get_Comes_From_Source_Default);
366    --  Gets the current value of the Comes_From_Source flag
367
368    procedure Preserve_Comes_From_Source (NewN, OldN : Node_Id);
369    pragma Inline (Preserve_Comes_From_Source);
370    --  When a node is rewritten, it is sometimes appropriate to preserve the
371    --  original comes from source indication. This is true when the rewrite
372    --  essentially corresponds to a transformation corresponding exactly to
373    --  semantics in the reference manual. This procedure copies the setting
374    --  of Comes_From_Source from OldN to NewN.
375
376    function Has_Extension (N : Node_Id) return Boolean;
377    pragma Inline (Has_Extension);
378    --  Returns True if the given node has an extension (i.e. was created by
379    --  a call to New_Entity rather than New_Node, and Nkind is in N_Entity)
380
381    procedure Change_Node (N : Node_Id; New_Node_Kind : Node_Kind);
382    --  This procedure replaces the given node by setting its Nkind field to
383    --  the indicated value and resetting all other fields to their default
384    --  values except for Sloc, which is unchanged, and the Parent pointer
385    --  and list links, which are also unchanged. All other information in
386    --  the original node is lost. The new node has an extension if the
387    --  original node had an extension.
388
389    procedure Copy_Node (Source : Node_Id; Destination : Node_Id);
390    --  Copy the entire contents of the source node to the destination node.
391    --  The contents of the source node is not affected. If the source node
392    --  has an extension, then the destination must have an extension also.
393    --  The parent pointer of the destination and its list link, if any, are
394    --  not affected by the copy. Note that parent pointers of descendents
395    --  are not adjusted, so the descendents of the destination node after
396    --  the Copy_Node is completed have dubious parent pointers.
397
398    function New_Copy (Source : Node_Id) return Node_Id;
399    --  This function allocates a completely new node, and then initializes
400    --  it by copying the contents of the source node into it. The contents
401    --  of the source node is not affected. The target node is always marked
402    --  as not being in a list (even if the source is a list member). The
403    --  new node will have an extension if the source has an extension.
404    --  New_Copy (Empty) returns Empty and New_Copy (Error) returns Error.
405    --  Note that, unlike New_Copy_Tree, New_Copy does not recursively copy any
406    --  descendents, so in general parent pointers are not set correctly for
407    --  the descendents of the copied node. Both normal and extended nodes
408    --  (entities) may be copied using New_Copy.
409
410    function Relocate_Node (Source : Node_Id) return Node_Id;
411    --  Source is a non-entity node that is to be relocated. A new node is
412    --  allocated and the contents of Source are copied to this node using
413    --  Copy_Node. The parent pointers of descendents of the node are then
414    --  adjusted to point to the relocated copy. The original node is not
415    --  modified, but the parent pointers of its descendents are no longer
416    --  valid. This routine is used in conjunction with the tree rewrite
417    --  routines (see descriptions of Replace/Rewrite).
418    --
419    --  Note that the resulting node has the same parent as the source
420    --  node, and is thus still attached to the tree. It is valid for
421    --  Source to be Empty, in which case Relocate_Node simply returns
422    --  Empty as the result.
423
424    function New_Copy_Tree
425      (Source    : Node_Id;
426       Map       : Elist_Id := No_Elist;
427       New_Sloc  : Source_Ptr := No_Location;
428       New_Scope : Entity_Id := Empty) return Node_Id;
429    --  Given a node that is the root of a subtree, Copy_Tree copies the entire
430    --  syntactic subtree, including recursively any descendents whose parent
431    --  field references a copied node (descendents not linked to a copied node
432    --  by the parent field are not copied, instead the copied tree references
433    --  the same descendent as the original in this case, which is appropriate
434    --  for non-syntactic fields such as Etype). The parent pointers in the
435    --  copy are properly set. Copy_Tree (Empty/Error) returns Empty/Error.
436    --  The one exception to the rule of not copying semantic fields is that
437    --  any implicit types attached to the subtree are duplicated, so that
438    --  the copy contains a distinct set of implicit type entities. The Map
439    --  argument, if set to a non-empty Elist, specifies a set of mappings
440    --  to be applied to entities in the tree. The map has the form:
441    --
442    --     old entity 1
443    --     new entity to replace references to entity 1
444    --     old entity 2
445    --     new entity to replace references to entity 2
446    --     ...
447    --
448    --  The call destroys the contents of Map in this case
449    --
450    --  The parameter New_Sloc, if set to a value other than No_Location, is
451    --  used as the Sloc value for all nodes in the new copy. If New_Sloc is
452    --  set to its default value No_Location, then the Sloc values of the
453    --  nodes in the copy are simply copied from the corresponding original.
454    --
455    --  The Comes_From_Source indication is unchanged if New_Sloc is set to
456    --  the default No_Location value, but is reset if New_Sloc is given, since
457    --  in this case the result clearly is neither a source node or an exact
458    --  copy of a source node.
459    --
460    --  The parameter New_Scope, if set to a value other than Empty, is the
461    --  value to use as the Scope for any Itypes that are copied. The most
462    --  typical value for this parameter, if given, is Current_Scope.
463
464    function Copy_Separate_Tree (Source : Node_Id) return Node_Id;
465    --  Given a node that is the root of a subtree, Copy_Separate_Tree copies
466    --  the entire syntactic subtree, including recursively any descendants
467    --  whose parent field references a copied node (descendants not linked to
468    --  a copied node by the parent field are also copied.) The parent pointers
469    --  in the copy are properly set. Copy_Separate_Tree (Empty/Error) returns
470    --  Empty/Error. The semantic fields are not copied and the new subtree
471    --  does not share any entity with source subtree.
472    --  But the code *does* copy semantic fields, and the description above
473    --  is in any case unclear on this point ??? (RBKD)
474
475    procedure Exchange_Entities (E1 : Entity_Id; E2 : Entity_Id);
476    --  Exchange the contents of two entities. The parent pointers are switched
477    --  as well as the Defining_Identifier fields in the parents, so that the
478    --  entities point correctly to their original parents. The effect is thus
479    --  to leave the tree completely unchanged in structure, except that the
480    --  entity ID values of the two entities are interchanged. Neither of the
481    --  two entities may be list members.
482
483    procedure Delete_Node (Node : Node_Id);
484    --  The node, which must not be a list member, is deleted from the tree and
485    --  its type is set to N_Unused_At_End. It is an error (not necessarily
486    --  detected) to reference this node after it has been deleted. The
487    --  implementation of the body of Atree is free to reuse the node to
488    --  satisfy future node allocation requests, but is not required to do so.
489
490    procedure Delete_Tree (Node : Node_Id);
491    --  The entire syntactic subtree referenced by Node (i.e. the given node
492    --  and all its syntactic descendents) are deleted as described above for
493    --  Delete_Node.
494
495    function Extend_Node (Node : Node_Id) return Entity_Id;
496    --  This function returns a copy of its input node with an extension
497    --  added. The fields of the extension are set to Empty. Due to the way
498    --  extensions are handled (as four consecutive array elements), it may
499    --  be necessary to reallocate the node, so that the returned value is
500    --  not the same as the input value, but where possible the returned
501    --  value will be the same as the input value (i.e. the extension will
502    --  occur in place). It is the caller's responsibility to ensure that
503    --  any pointers to the original node are appropriately updated. This
504    --  function is used only by Sinfo.CN to change nodes into their
505    --  corresponding entities.
506
507    type Traverse_Result is (OK, OK_Orig, Skip, Abandon);
508    --  This is the type of the result returned by the Process function passed
509    --  to Traverse_Func and Traverse_Proc and also the type of the result of
510    --  Traverse_Func itself. See descriptions below for details.
511
512    generic
513      with function Process (N : Node_Id) return Traverse_Result is <>;
514    function Traverse_Func (Node : Node_Id) return Traverse_Result;
515    --  This is a generic function that, given the parent node for a subtree,
516    --  traverses all syntactic nodes of this tree, calling the given function
517    --  Process on each one. The traversal is controlled as follows by the
518    --  result returned by Process:
519
520    --    OK       The traversal continues normally with the syntactic
521    --             children of the node just processed.
522
523    --    OK_Orig  The traversal continues normally with the syntactic
524    --             children of the original node of the node just processed.
525
526    --    Skip     The children of the node just processed are skipped and
527    --             excluded from the traversal, but otherwise processing
528    --             continues elsewhere in the tree.
529
530    --    Abandon  The entire traversal is immediately abandoned, and the
531    --             original call to Traverse returns Abandon.
532
533    --  The result returned by Traverse is Abandon if processing was terminated
534    --  by a call to Process returning Abandon, otherwise it is OK (meaning that
535    --  all calls to process returned either OK or Skip).
536
537    generic
538      with function Process (N : Node_Id) return Traverse_Result is <>;
539    procedure Traverse_Proc (Node : Node_Id);
540    pragma Inline (Traverse_Proc);
541    --  This is similar to Traverse_Func except that no result is returned,
542    --  i.e. Traverse_Func is called and the result is simply discarded.
543
544    ---------------------------
545    -- Node Access Functions --
546    ---------------------------
547
548    --  The following functions return the contents of the indicated field of
549    --  the node referenced by the argument, which is a Node_Id.
550
551    function Nkind             (N : Node_Id) return Node_Kind;
552    pragma Inline (Nkind);
553
554    function Analyzed          (N : Node_Id) return Boolean;
555    pragma Inline (Analyzed);
556
557    function Comes_From_Source (N : Node_Id) return Boolean;
558    pragma Inline (Comes_From_Source);
559
560    function Error_Posted      (N : Node_Id) return Boolean;
561    pragma Inline (Error_Posted);
562
563    function Sloc              (N : Node_Id) return Source_Ptr;
564    pragma Inline (Sloc);
565
566    function Paren_Count       (N : Node_Id) return Paren_Count_Type;
567    pragma Inline (Paren_Count);
568
569    function Parent            (N : Node_Id) return Node_Id;
570    pragma Inline (Parent);
571    --  Returns the parent of a node if the node is not a list member, or
572    --  else the parent of the list containing the node if the node is a
573    --  list member.
574
575    function No                (N : Node_Id) return Boolean;
576    pragma Inline (No);
577    --  Tests given Id for equality with the Empty node. This allows notations
578    --  like "if No (Variant_Part)" as opposed to "if Variant_Part = Empty".
579
580    function Present           (N : Node_Id) return Boolean;
581    pragma Inline (Present);
582    --  Tests given Id for inequality with the Empty node. This allows notations
583    --  like "if Present (Statement)" as opposed to "if Statement /= Empty".
584
585    -----------------------------
586    -- Entity Access Functions --
587    -----------------------------
588
589    --  The following functions apply only to Entity_Id values, i.e.
590    --  to extended nodes.
591
592    function Ekind (E : Entity_Id) return Entity_Kind;
593    pragma Inline (Ekind);
594
595    function Convention (E : Entity_Id) return Convention_Id;
596    pragma Inline (Convention);
597
598    ----------------------------
599    -- Node Update Procedures --
600    ----------------------------
601
602    --  The following functions set a specified field in the node whose Id is
603    --  passed as the first argument. The second parameter is the new value
604    --  to be set in the specified field. Note that Set_Nkind is in the next
605    --  section, since its use is restricted.
606
607    procedure Set_Sloc         (N : Node_Id; Val : Source_Ptr);
608    pragma Inline (Set_Sloc);
609
610    procedure Set_Paren_Count  (N : Node_Id; Val : Paren_Count_Type);
611    pragma Inline (Set_Paren_Count);
612
613    procedure Set_Parent       (N : Node_Id; Val : Node_Id);
614    pragma Inline (Set_Parent);
615
616    procedure Set_Analyzed     (N : Node_Id; Val : Boolean := True);
617    pragma Inline (Set_Analyzed);
618
619    procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True);
620    pragma Inline (Set_Error_Posted);
621
622    procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean);
623    pragma Inline (Set_Comes_From_Source);
624    --  Note that this routine is very rarely used, since usually the
625    --  default mechanism provided sets the right value, but in some
626    --  unusual cases, the value needs to be reset (e.g. when a source
627    --  node is copied, and the copy must not have Comes_From_Source set.
628
629    ------------------------------
630    -- Entity Update Procedures --
631    ------------------------------
632
633    --  The following procedures apply only to Entity_Id values, i.e.
634    --  to extended nodes.
635
636    procedure Set_Ekind (E : Entity_Id; Val : Entity_Kind);
637    pragma Inline (Set_Ekind);
638
639    procedure Set_Convention (E : Entity_Id; Val : Convention_Id);
640    pragma Inline (Set_Convention);
641
642    ---------------------------
643    -- Tree Rewrite Routines --
644    ---------------------------
645
646    --  During the compilation process it is necessary in a number of situations
647    --  to rewrite the tree. In some cases, such rewrites do not affect the
648    --  structure of the tree, for example, when an indexed component node is
649    --  replaced by the corresponding call node (the parser cannot distinguish
650    --  between these two cases).
651
652    --  In other situations, the rewrite does affect the structure of the
653    --  tree. Examples are the replacement of a generic instantiation by the
654    --  instantiated spec and body, and the static evaluation of expressions.
655
656    --  If such structural modifications are done by the expander, there are
657    --  no difficulties, since the form of the tree after the expander has no
658    --  special significance, except as input to the backend of the compiler.
659    --  However, if these modifications are done by the semantic phase, then
660    --  it is important that they be done in a manner which allows the original
661    --  tree to be preserved. This is because tools like pretty printers need
662    --  to have this original tree structure available.
663
664    --  The subprograms in this section allow rewriting of the tree by either
665    --  insertion of new nodes in an existing list, or complete replacement of
666    --  a subtree. The resulting tree for most purposes looks as though it has
667    --  been really changed, and there is no trace of the original. However,
668    --  special subprograms, also defined in this section, allow the original
669    --  tree to be reconstructed if necessary.
670
671    --  For tree modifications done in the expander, it is permissible to
672    --  destroy the original tree, although it is also allowable to use the
673    --  tree rewrite routines where it is convenient to do so.
674
675    procedure Mark_Rewrite_Insertion (New_Node : Node_Id);
676    pragma Inline (Mark_Rewrite_Insertion);
677    --  This procedure marks the given node as an insertion made during a tree
678    --  rewriting operation. Only the root needs to be marked. The call does
679    --  not do the actual insertion, which must be done using one of the normal
680    --  list insertion routines. The node is treated normally in all respects
681    --  except for its response to Is_Rewrite_Insertion. The function of these
682    --  calls is to be able to get an accurate original tree. This helps the
683    --  accuracy of Sprint.Sprint_Node, and in particular, when stubs are being
684    --  generated, it is essential that the original tree be accurate.
685
686    function Is_Rewrite_Insertion (Node : Node_Id) return Boolean;
687    pragma Inline (Is_Rewrite_Insertion);
688    --  Tests whether the given node was marked using Set_Rewrite_Insert. This
689    --  is used in reconstructing the original tree (where such nodes are to
690    --  be eliminated from the reconstructed tree).
691
692    procedure Rewrite (Old_Node, New_Node : Node_Id);
693    --  This is used when a complete subtree is to be replaced. Old_Node is the
694    --  root of the old subtree to be replaced, and New_Node is the root of the
695    --  newly constructed replacement subtree. The actual mechanism is to swap
696    --  the contents of these two nodes fixing up the parent pointers of the
697    --  replaced node (we do not attempt to preserve parent pointers for the
698    --  original node). Neither Old_Node nor New_Node can be extended nodes.
699    --
700    --  Note: New_Node may not contain references to Old_Node, for example as
701    --  descendents, since the rewrite would make such references invalid. If
702    --  New_Node does need to reference Old_Node, then these references should
703    --  be to a relocated copy of Old_Node (see Relocate_Node procedure).
704    --
705    --  Note: The Original_Node function applied to Old_Node (which has now
706    --  been replaced by the contents of New_Node), can be used to obtain the
707    --  original node, i.e. the old contents of Old_Node.
708
709    procedure Replace (Old_Node, New_Node : Node_Id);
710    --  This is similar to Rewrite, except that the old value of Old_Node is
711    --  not saved, and the New_Node is deleted after the replace, since it
712    --  is assumed that it can no longer be legitimately needed. The flag
713    --  Is_Rewrite_Susbtitute will be False for the resulting node, unless
714    --  it was already true on entry, and Original_Node will not return the
715    --  original contents of the Old_Node, but rather the New_Node value (unless
716    --  Old_Node had already been rewritten using Rewrite). Replace also
717    --  preserves the setting of Comes_From_Source.
718    --
719    --  Note, New_Node may not contain references to Old_Node, for example as
720    --  descendents, since the rewrite would make such references invalid. If
721    --  New_Node does need to reference Old_Node, then these references should
722    --  be to a relocated copy of Old_Node (see Relocate_Node procedure).
723    --
724    --  Replace is used in certain circumstances where it is desirable to
725    --  suppress any history of the rewriting operation. Notably, it is used
726    --  when the parser has mis-classified a node (e.g. a task entry call
727    --  that the parser has parsed as a procedure call).
728
729    function Is_Rewrite_Substitution (Node : Node_Id) return Boolean;
730    pragma Inline (Is_Rewrite_Substitution);
731    --  Return True iff Node has been rewritten (i.e. if Node is the root
732    --  of a subtree which was installed using Rewrite).
733
734    function Original_Node (Node : Node_Id) return Node_Id;
735    pragma Inline (Original_Node);
736    --  If Node has not been rewritten, then returns its input argument
737    --  unchanged, else returns the Node for the original subtree.
738    --
739    --  Note: Parents are not preserved in original tree nodes that are
740    --  retrieved in this way (i.e. their children may have children whose
741    --  pointers which reference some other node).
742
743    --  Note: there is no direct mechanism for deleting an original node (in
744    --  a manner that can be reversed later). One possible approach is to use
745    --  Rewrite to substitute a null statement for the node to be deleted.
746
747    -----------------------------------
748    -- Generic Field Access Routines --
749    -----------------------------------
750
751    --  This subpackage provides the functions for accessing and procedures
752    --  for setting fields that are normally referenced by their logical
753    --  synonyms defined in packages Sinfo and Einfo. As previously
754    --  described the implementations of these packages use the package
755    --  Atree.Unchecked_Access.
756
757    package Unchecked_Access is
758
759       --  Functions to allow interpretation of Union_Id values as Uint
760       --  and Ureal values
761
762       function To_Union is new Unchecked_Conversion (Uint,  Union_Id);
763       function To_Union is new Unchecked_Conversion (Ureal, Union_Id);
764
765       function From_Union is new Unchecked_Conversion (Union_Id, Uint);
766       function From_Union is new Unchecked_Conversion (Union_Id, Ureal);
767
768       --  Functions to fetch contents of indicated field. It is an error
769       --  to attempt to read the value of a field which is not present.
770
771       function Field1 (N : Node_Id) return Union_Id;
772       pragma Inline (Field1);
773
774       function Field2 (N : Node_Id) return Union_Id;
775       pragma Inline (Field2);
776
777       function Field3 (N : Node_Id) return Union_Id;
778       pragma Inline (Field3);
779
780       function Field4 (N : Node_Id) return Union_Id;
781       pragma Inline (Field4);
782
783       function Field5 (N : Node_Id) return Union_Id;
784       pragma Inline (Field5);
785
786       function Field6 (N : Node_Id) return Union_Id;
787       pragma Inline (Field6);
788
789       function Field7 (N : Node_Id) return Union_Id;
790       pragma Inline (Field7);
791
792       function Field8 (N : Node_Id) return Union_Id;
793       pragma Inline (Field8);
794
795       function Field9 (N : Node_Id) return Union_Id;
796       pragma Inline (Field9);
797
798       function Field10 (N : Node_Id) return Union_Id;
799       pragma Inline (Field10);
800
801       function Field11 (N : Node_Id) return Union_Id;
802       pragma Inline (Field11);
803
804       function Field12 (N : Node_Id) return Union_Id;
805       pragma Inline (Field12);
806
807       function Field13 (N : Node_Id) return Union_Id;
808       pragma Inline (Field13);
809
810       function Field14 (N : Node_Id) return Union_Id;
811       pragma Inline (Field14);
812
813       function Field15 (N : Node_Id) return Union_Id;
814       pragma Inline (Field15);
815
816       function Field16 (N : Node_Id) return Union_Id;
817       pragma Inline (Field16);
818
819       function Field17 (N : Node_Id) return Union_Id;
820       pragma Inline (Field17);
821
822       function Field18 (N : Node_Id) return Union_Id;
823       pragma Inline (Field18);
824
825       function Field19 (N : Node_Id) return Union_Id;
826       pragma Inline (Field19);
827
828       function Field20 (N : Node_Id) return Union_Id;
829       pragma Inline (Field20);
830
831       function Field21 (N : Node_Id) return Union_Id;
832       pragma Inline (Field21);
833
834       function Field22 (N : Node_Id) return Union_Id;
835       pragma Inline (Field22);
836
837       function Field23 (N : Node_Id) return Union_Id;
838       pragma Inline (Field23);
839
840       function Node1 (N : Node_Id) return Node_Id;
841       pragma Inline (Node1);
842
843       function Node2 (N : Node_Id) return Node_Id;
844       pragma Inline (Node2);
845
846       function Node3 (N : Node_Id) return Node_Id;
847       pragma Inline (Node3);
848
849       function Node4 (N : Node_Id) return Node_Id;
850       pragma Inline (Node4);
851
852       function Node5 (N : Node_Id) return Node_Id;
853       pragma Inline (Node5);
854
855       function Node6 (N : Node_Id) return Node_Id;
856       pragma Inline (Node6);
857
858       function Node7 (N : Node_Id) return Node_Id;
859       pragma Inline (Node7);
860
861       function Node8 (N : Node_Id) return Node_Id;
862       pragma Inline (Node8);
863
864       function Node9 (N : Node_Id) return Node_Id;
865       pragma Inline (Node9);
866
867       function Node10 (N : Node_Id) return Node_Id;
868       pragma Inline (Node10);
869
870       function Node11 (N : Node_Id) return Node_Id;
871       pragma Inline (Node11);
872
873       function Node12 (N : Node_Id) return Node_Id;
874       pragma Inline (Node12);
875
876       function Node13 (N : Node_Id) return Node_Id;
877       pragma Inline (Node13);
878
879       function Node14 (N : Node_Id) return Node_Id;
880       pragma Inline (Node14);
881
882       function Node15 (N : Node_Id) return Node_Id;
883       pragma Inline (Node15);
884
885       function Node16 (N : Node_Id) return Node_Id;
886       pragma Inline (Node16);
887
888       function Node17 (N : Node_Id) return Node_Id;
889       pragma Inline (Node17);
890
891       function Node18 (N : Node_Id) return Node_Id;
892       pragma Inline (Node18);
893
894       function Node19 (N : Node_Id) return Node_Id;
895       pragma Inline (Node19);
896
897       function Node20 (N : Node_Id) return Node_Id;
898       pragma Inline (Node20);
899
900       function Node21 (N : Node_Id) return Node_Id;
901       pragma Inline (Node21);
902
903       function Node22 (N : Node_Id) return Node_Id;
904       pragma Inline (Node22);
905
906       function Node23 (N : Node_Id) return Node_Id;
907       pragma Inline (Node23);
908
909       function List1 (N : Node_Id) return List_Id;
910       pragma Inline (List1);
911
912       function List2 (N : Node_Id) return List_Id;
913       pragma Inline (List2);
914
915       function List3 (N : Node_Id) return List_Id;
916       pragma Inline (List3);
917
918       function List4 (N : Node_Id) return List_Id;
919       pragma Inline (List4);
920
921       function List5 (N : Node_Id) return List_Id;
922       pragma Inline (List5);
923
924       function List10 (N : Node_Id) return List_Id;
925       pragma Inline (List10);
926
927       function List14 (N : Node_Id) return List_Id;
928       pragma Inline (List14);
929
930       function Elist2 (N : Node_Id) return Elist_Id;
931       pragma Inline (Elist2);
932
933       function Elist3 (N : Node_Id) return Elist_Id;
934       pragma Inline (Elist3);
935
936       function Elist4 (N : Node_Id) return Elist_Id;
937       pragma Inline (Elist4);
938
939       function Elist8 (N : Node_Id) return Elist_Id;
940       pragma Inline (Elist8);
941
942       function Elist13 (N : Node_Id) return Elist_Id;
943       pragma Inline (Elist13);
944
945       function Elist15 (N : Node_Id) return Elist_Id;
946       pragma Inline (Elist15);
947
948       function Elist16 (N : Node_Id) return Elist_Id;
949       pragma Inline (Elist16);
950
951       function Elist18 (N : Node_Id) return Elist_Id;
952       pragma Inline (Elist18);
953
954       function Elist21 (N : Node_Id) return Elist_Id;
955       pragma Inline (Elist21);
956
957       function Elist23 (N : Node_Id) return Elist_Id;
958       pragma Inline (Elist23);
959
960       function Name1 (N : Node_Id) return Name_Id;
961       pragma Inline (Name1);
962
963       function Name2 (N : Node_Id) return Name_Id;
964       pragma Inline (Name2);
965
966       function Char_Code2 (N : Node_Id) return Char_Code;
967       pragma Inline (Char_Code2);
968
969       function Str3 (N : Node_Id) return String_Id;
970       pragma Inline (Str3);
971
972       --  Note: the following Uintnn functions have a special test for
973       --  the Field value being Empty. If an Empty value is found then
974       --  Uint_0 is returned. This avoids the rather tricky requirement
975       --  of initializing all Uint fields in nodes and entities.
976
977       function Uint3 (N : Node_Id) return Uint;
978       pragma Inline (Uint3);
979
980       function Uint4 (N : Node_Id) return Uint;
981       pragma Inline (Uint4);
982
983       function Uint5 (N : Node_Id) return Uint;
984       pragma Inline (Uint5);
985
986       function Uint8 (N : Node_Id) return Uint;
987       pragma Inline (Uint8);
988
989       function Uint9 (N : Node_Id) return Uint;
990       pragma Inline (Uint9);
991
992       function Uint10 (N : Node_Id) return Uint;
993       pragma Inline (Uint10);
994
995       function Uint11 (N : Node_Id) return Uint;
996       pragma Inline (Uint11);
997
998       function Uint12 (N : Node_Id) return Uint;
999       pragma Inline (Uint12);
1000
1001       function Uint13 (N : Node_Id) return Uint;
1002       pragma Inline (Uint13);
1003
1004       function Uint14 (N : Node_Id) return Uint;
1005       pragma Inline (Uint14);
1006
1007       function Uint15 (N : Node_Id) return Uint;
1008       pragma Inline (Uint15);
1009
1010       function Uint16 (N : Node_Id) return Uint;
1011       pragma Inline (Uint16);
1012
1013       function Uint17 (N : Node_Id) return Uint;
1014       pragma Inline (Uint17);
1015
1016       function Uint22 (N : Node_Id) return Uint;
1017       pragma Inline (Uint22);
1018
1019       function Ureal3 (N : Node_Id) return Ureal;
1020       pragma Inline (Ureal3);
1021
1022       function Ureal18 (N : Node_Id) return Ureal;
1023       pragma Inline (Ureal18);
1024
1025       function Ureal21 (N : Node_Id) return Ureal;
1026       pragma Inline (Ureal21);
1027
1028       function Flag4 (N : Node_Id) return Boolean;
1029       pragma Inline (Flag4);
1030
1031       function Flag5 (N : Node_Id) return Boolean;
1032       pragma Inline (Flag5);
1033
1034       function Flag6 (N : Node_Id) return Boolean;
1035       pragma Inline (Flag6);
1036
1037       function Flag7 (N : Node_Id) return Boolean;
1038       pragma Inline (Flag7);
1039
1040       function Flag8 (N : Node_Id) return Boolean;
1041       pragma Inline (Flag8);
1042
1043       function Flag9 (N : Node_Id) return Boolean;
1044       pragma Inline (Flag9);
1045
1046       function Flag10 (N : Node_Id) return Boolean;
1047       pragma Inline (Flag10);
1048
1049       function Flag11 (N : Node_Id) return Boolean;
1050       pragma Inline (Flag11);
1051
1052       function Flag12 (N : Node_Id) return Boolean;
1053       pragma Inline (Flag12);
1054
1055       function Flag13 (N : Node_Id) return Boolean;
1056       pragma Inline (Flag13);
1057
1058       function Flag14 (N : Node_Id) return Boolean;
1059       pragma Inline (Flag14);
1060
1061       function Flag15 (N : Node_Id) return Boolean;
1062       pragma Inline (Flag15);
1063
1064       function Flag16 (N : Node_Id) return Boolean;
1065       pragma Inline (Flag16);
1066
1067       function Flag17 (N : Node_Id) return Boolean;
1068       pragma Inline (Flag17);
1069
1070       function Flag18 (N : Node_Id) return Boolean;
1071       pragma Inline (Flag18);
1072
1073       function Flag19 (N : Node_Id) return Boolean;
1074       pragma Inline (Flag19);
1075
1076       function Flag20 (N : Node_Id) return Boolean;
1077       pragma Inline (Flag20);
1078
1079       function Flag21 (N : Node_Id) return Boolean;
1080       pragma Inline (Flag21);
1081
1082       function Flag22 (N : Node_Id) return Boolean;
1083       pragma Inline (Flag22);
1084
1085       function Flag23 (N : Node_Id) return Boolean;
1086       pragma Inline (Flag23);
1087
1088       function Flag24 (N : Node_Id) return Boolean;
1089       pragma Inline (Flag24);
1090
1091       function Flag25 (N : Node_Id) return Boolean;
1092       pragma Inline (Flag25);
1093
1094       function Flag26 (N : Node_Id) return Boolean;
1095       pragma Inline (Flag26);
1096
1097       function Flag27 (N : Node_Id) return Boolean;
1098       pragma Inline (Flag27);
1099
1100       function Flag28 (N : Node_Id) return Boolean;
1101       pragma Inline (Flag28);
1102
1103       function Flag29 (N : Node_Id) return Boolean;
1104       pragma Inline (Flag29);
1105
1106       function Flag30 (N : Node_Id) return Boolean;
1107       pragma Inline (Flag30);
1108
1109       function Flag31 (N : Node_Id) return Boolean;
1110       pragma Inline (Flag31);
1111
1112       function Flag32 (N : Node_Id) return Boolean;
1113       pragma Inline (Flag32);
1114
1115       function Flag33 (N : Node_Id) return Boolean;
1116       pragma Inline (Flag33);
1117
1118       function Flag34 (N : Node_Id) return Boolean;
1119       pragma Inline (Flag34);
1120
1121       function Flag35 (N : Node_Id) return Boolean;
1122       pragma Inline (Flag35);
1123
1124       function Flag36 (N : Node_Id) return Boolean;
1125       pragma Inline (Flag36);
1126
1127       function Flag37 (N : Node_Id) return Boolean;
1128       pragma Inline (Flag37);
1129
1130       function Flag38 (N : Node_Id) return Boolean;
1131       pragma Inline (Flag38);
1132
1133       function Flag39 (N : Node_Id) return Boolean;
1134       pragma Inline (Flag39);
1135
1136       function Flag40 (N : Node_Id) return Boolean;
1137       pragma Inline (Flag40);
1138
1139       function Flag41 (N : Node_Id) return Boolean;
1140       pragma Inline (Flag41);
1141
1142       function Flag42 (N : Node_Id) return Boolean;
1143       pragma Inline (Flag42);
1144
1145       function Flag43 (N : Node_Id) return Boolean;
1146       pragma Inline (Flag43);
1147
1148       function Flag44 (N : Node_Id) return Boolean;
1149       pragma Inline (Flag44);
1150
1151       function Flag45 (N : Node_Id) return Boolean;
1152       pragma Inline (Flag45);
1153
1154       function Flag46 (N : Node_Id) return Boolean;
1155       pragma Inline (Flag46);
1156
1157       function Flag47 (N : Node_Id) return Boolean;
1158       pragma Inline (Flag47);
1159
1160       function Flag48 (N : Node_Id) return Boolean;
1161       pragma Inline (Flag48);
1162
1163       function Flag49 (N : Node_Id) return Boolean;
1164       pragma Inline (Flag49);
1165
1166       function Flag50 (N : Node_Id) return Boolean;
1167       pragma Inline (Flag50);
1168
1169       function Flag51 (N : Node_Id) return Boolean;
1170       pragma Inline (Flag51);
1171
1172       function Flag52 (N : Node_Id) return Boolean;
1173       pragma Inline (Flag52);
1174
1175       function Flag53 (N : Node_Id) return Boolean;
1176       pragma Inline (Flag53);
1177
1178       function Flag54 (N : Node_Id) return Boolean;
1179       pragma Inline (Flag54);
1180
1181       function Flag55 (N : Node_Id) return Boolean;
1182       pragma Inline (Flag55);
1183
1184       function Flag56 (N : Node_Id) return Boolean;
1185       pragma Inline (Flag56);
1186
1187       function Flag57 (N : Node_Id) return Boolean;
1188       pragma Inline (Flag57);
1189
1190       function Flag58 (N : Node_Id) return Boolean;
1191       pragma Inline (Flag58);
1192
1193       function Flag59 (N : Node_Id) return Boolean;
1194       pragma Inline (Flag59);
1195
1196       function Flag60 (N : Node_Id) return Boolean;
1197       pragma Inline (Flag60);
1198
1199       function Flag61 (N : Node_Id) return Boolean;
1200       pragma Inline (Flag61);
1201
1202       function Flag62 (N : Node_Id) return Boolean;
1203       pragma Inline (Flag62);
1204
1205       function Flag63 (N : Node_Id) return Boolean;
1206       pragma Inline (Flag63);
1207
1208       function Flag64 (N : Node_Id) return Boolean;
1209       pragma Inline (Flag64);
1210
1211       function Flag65 (N : Node_Id) return Boolean;
1212       pragma Inline (Flag65);
1213
1214       function Flag66 (N : Node_Id) return Boolean;
1215       pragma Inline (Flag66);
1216
1217       function Flag67 (N : Node_Id) return Boolean;
1218       pragma Inline (Flag67);
1219
1220       function Flag68 (N : Node_Id) return Boolean;
1221       pragma Inline (Flag68);
1222
1223       function Flag69 (N : Node_Id) return Boolean;
1224       pragma Inline (Flag69);
1225
1226       function Flag70 (N : Node_Id) return Boolean;
1227       pragma Inline (Flag70);
1228
1229       function Flag71 (N : Node_Id) return Boolean;
1230       pragma Inline (Flag71);
1231
1232       function Flag72 (N : Node_Id) return Boolean;
1233       pragma Inline (Flag72);
1234
1235       function Flag73 (N : Node_Id) return Boolean;
1236       pragma Inline (Flag73);
1237
1238       function Flag74 (N : Node_Id) return Boolean;
1239       pragma Inline (Flag74);
1240
1241       function Flag75 (N : Node_Id) return Boolean;
1242       pragma Inline (Flag75);
1243
1244       function Flag76 (N : Node_Id) return Boolean;
1245       pragma Inline (Flag76);
1246
1247       function Flag77 (N : Node_Id) return Boolean;
1248       pragma Inline (Flag77);
1249
1250       function Flag78 (N : Node_Id) return Boolean;
1251       pragma Inline (Flag78);
1252
1253       function Flag79 (N : Node_Id) return Boolean;
1254       pragma Inline (Flag79);
1255
1256       function Flag80 (N : Node_Id) return Boolean;
1257       pragma Inline (Flag80);
1258
1259       function Flag81 (N : Node_Id) return Boolean;
1260       pragma Inline (Flag81);
1261
1262       function Flag82 (N : Node_Id) return Boolean;
1263       pragma Inline (Flag82);
1264
1265       function Flag83 (N : Node_Id) return Boolean;
1266       pragma Inline (Flag83);
1267
1268       function Flag84 (N : Node_Id) return Boolean;
1269       pragma Inline (Flag84);
1270
1271       function Flag85 (N : Node_Id) return Boolean;
1272       pragma Inline (Flag85);
1273
1274       function Flag86 (N : Node_Id) return Boolean;
1275       pragma Inline (Flag86);
1276
1277       function Flag87 (N : Node_Id) return Boolean;
1278       pragma Inline (Flag87);
1279
1280       function Flag88 (N : Node_Id) return Boolean;
1281       pragma Inline (Flag88);
1282
1283       function Flag89 (N : Node_Id) return Boolean;
1284       pragma Inline (Flag89);
1285
1286       function Flag90 (N : Node_Id) return Boolean;
1287       pragma Inline (Flag90);
1288
1289       function Flag91 (N : Node_Id) return Boolean;
1290       pragma Inline (Flag91);
1291
1292       function Flag92 (N : Node_Id) return Boolean;
1293       pragma Inline (Flag92);
1294
1295       function Flag93 (N : Node_Id) return Boolean;
1296       pragma Inline (Flag93);
1297
1298       function Flag94 (N : Node_Id) return Boolean;
1299       pragma Inline (Flag94);
1300
1301       function Flag95 (N : Node_Id) return Boolean;
1302       pragma Inline (Flag95);
1303
1304       function Flag96 (N : Node_Id) return Boolean;
1305       pragma Inline (Flag96);
1306
1307       function Flag97 (N : Node_Id) return Boolean;
1308       pragma Inline (Flag97);
1309
1310       function Flag98 (N : Node_Id) return Boolean;
1311       pragma Inline (Flag98);
1312
1313       function Flag99 (N : Node_Id) return Boolean;
1314       pragma Inline (Flag99);
1315
1316       function Flag100 (N : Node_Id) return Boolean;
1317       pragma Inline (Flag100);
1318
1319       function Flag101 (N : Node_Id) return Boolean;
1320       pragma Inline (Flag101);
1321
1322       function Flag102 (N : Node_Id) return Boolean;
1323       pragma Inline (Flag102);
1324
1325       function Flag103 (N : Node_Id) return Boolean;
1326       pragma Inline (Flag103);
1327
1328       function Flag104 (N : Node_Id) return Boolean;
1329       pragma Inline (Flag104);
1330
1331       function Flag105 (N : Node_Id) return Boolean;
1332       pragma Inline (Flag105);
1333
1334       function Flag106 (N : Node_Id) return Boolean;
1335       pragma Inline (Flag106);
1336
1337       function Flag107 (N : Node_Id) return Boolean;
1338       pragma Inline (Flag107);
1339
1340       function Flag108 (N : Node_Id) return Boolean;
1341       pragma Inline (Flag108);
1342
1343       function Flag109 (N : Node_Id) return Boolean;
1344       pragma Inline (Flag109);
1345
1346       function Flag110 (N : Node_Id) return Boolean;
1347       pragma Inline (Flag110);
1348
1349       function Flag111 (N : Node_Id) return Boolean;
1350       pragma Inline (Flag111);
1351
1352       function Flag112 (N : Node_Id) return Boolean;
1353       pragma Inline (Flag112);
1354
1355       function Flag113 (N : Node_Id) return Boolean;
1356       pragma Inline (Flag113);
1357
1358       function Flag114 (N : Node_Id) return Boolean;
1359       pragma Inline (Flag114);
1360
1361       function Flag115 (N : Node_Id) return Boolean;
1362       pragma Inline (Flag115);
1363
1364       function Flag116 (N : Node_Id) return Boolean;
1365       pragma Inline (Flag116);
1366
1367       function Flag117 (N : Node_Id) return Boolean;
1368       pragma Inline (Flag117);
1369
1370       function Flag118 (N : Node_Id) return Boolean;
1371       pragma Inline (Flag118);
1372
1373       function Flag119 (N : Node_Id) return Boolean;
1374       pragma Inline (Flag119);
1375
1376       function Flag120 (N : Node_Id) return Boolean;
1377       pragma Inline (Flag120);
1378
1379       function Flag121 (N : Node_Id) return Boolean;
1380       pragma Inline (Flag121);
1381
1382       function Flag122 (N : Node_Id) return Boolean;
1383       pragma Inline (Flag122);
1384
1385       function Flag123 (N : Node_Id) return Boolean;
1386       pragma Inline (Flag123);
1387
1388       function Flag124 (N : Node_Id) return Boolean;
1389       pragma Inline (Flag124);
1390
1391       function Flag125 (N : Node_Id) return Boolean;
1392       pragma Inline (Flag125);
1393
1394       function Flag126 (N : Node_Id) return Boolean;
1395       pragma Inline (Flag126);
1396
1397       function Flag127 (N : Node_Id) return Boolean;
1398       pragma Inline (Flag127);
1399
1400       function Flag128 (N : Node_Id) return Boolean;
1401       pragma Inline (Flag128);
1402
1403       function Flag129 (N : Node_Id) return Boolean;
1404       pragma Inline (Flag129);
1405
1406       function Flag130 (N : Node_Id) return Boolean;
1407       pragma Inline (Flag130);
1408
1409       function Flag131 (N : Node_Id) return Boolean;
1410       pragma Inline (Flag131);
1411
1412       function Flag132 (N : Node_Id) return Boolean;
1413       pragma Inline (Flag132);
1414
1415       function Flag133 (N : Node_Id) return Boolean;
1416       pragma Inline (Flag133);
1417
1418       function Flag134 (N : Node_Id) return Boolean;
1419       pragma Inline (Flag134);
1420
1421       function Flag135 (N : Node_Id) return Boolean;
1422       pragma Inline (Flag135);
1423
1424       function Flag136 (N : Node_Id) return Boolean;
1425       pragma Inline (Flag136);
1426
1427       function Flag137 (N : Node_Id) return Boolean;
1428       pragma Inline (Flag137);
1429
1430       function Flag138 (N : Node_Id) return Boolean;
1431       pragma Inline (Flag138);
1432
1433       function Flag139 (N : Node_Id) return Boolean;
1434       pragma Inline (Flag139);
1435
1436       function Flag140 (N : Node_Id) return Boolean;
1437       pragma Inline (Flag140);
1438
1439       function Flag141 (N : Node_Id) return Boolean;
1440       pragma Inline (Flag141);
1441
1442       function Flag142 (N : Node_Id) return Boolean;
1443       pragma Inline (Flag142);
1444
1445       function Flag143 (N : Node_Id) return Boolean;
1446       pragma Inline (Flag143);
1447
1448       function Flag144 (N : Node_Id) return Boolean;
1449       pragma Inline (Flag144);
1450
1451       function Flag145 (N : Node_Id) return Boolean;
1452       pragma Inline (Flag145);
1453
1454       function Flag146 (N : Node_Id) return Boolean;
1455       pragma Inline (Flag146);
1456
1457       function Flag147 (N : Node_Id) return Boolean;
1458       pragma Inline (Flag147);
1459
1460       function Flag148 (N : Node_Id) return Boolean;
1461       pragma Inline (Flag148);
1462
1463       function Flag149 (N : Node_Id) return Boolean;
1464       pragma Inline (Flag149);
1465
1466       function Flag150 (N : Node_Id) return Boolean;
1467       pragma Inline (Flag150);
1468
1469       function Flag151 (N : Node_Id) return Boolean;
1470       pragma Inline (Flag151);
1471
1472       function Flag152 (N : Node_Id) return Boolean;
1473       pragma Inline (Flag152);
1474
1475       function Flag153 (N : Node_Id) return Boolean;
1476       pragma Inline (Flag153);
1477
1478       function Flag154 (N : Node_Id) return Boolean;
1479       pragma Inline (Flag154);
1480
1481       function Flag155 (N : Node_Id) return Boolean;
1482       pragma Inline (Flag155);
1483
1484       function Flag156 (N : Node_Id) return Boolean;
1485       pragma Inline (Flag156);
1486
1487       function Flag157 (N : Node_Id) return Boolean;
1488       pragma Inline (Flag157);
1489
1490       function Flag158 (N : Node_Id) return Boolean;
1491       pragma Inline (Flag158);
1492
1493       function Flag159 (N : Node_Id) return Boolean;
1494       pragma Inline (Flag159);
1495
1496       function Flag160 (N : Node_Id) return Boolean;
1497       pragma Inline (Flag160);
1498
1499       function Flag161 (N : Node_Id) return Boolean;
1500       pragma Inline (Flag161);
1501
1502       function Flag162 (N : Node_Id) return Boolean;
1503       pragma Inline (Flag162);
1504
1505       function Flag163 (N : Node_Id) return Boolean;
1506       pragma Inline (Flag163);
1507
1508       function Flag164 (N : Node_Id) return Boolean;
1509       pragma Inline (Flag164);
1510
1511       function Flag165 (N : Node_Id) return Boolean;
1512       pragma Inline (Flag165);
1513
1514       function Flag166 (N : Node_Id) return Boolean;
1515       pragma Inline (Flag166);
1516
1517       function Flag167 (N : Node_Id) return Boolean;
1518       pragma Inline (Flag167);
1519
1520       function Flag168 (N : Node_Id) return Boolean;
1521       pragma Inline (Flag168);
1522
1523       function Flag169 (N : Node_Id) return Boolean;
1524       pragma Inline (Flag169);
1525
1526       function Flag170 (N : Node_Id) return Boolean;
1527       pragma Inline (Flag170);
1528
1529       function Flag171 (N : Node_Id) return Boolean;
1530       pragma Inline (Flag171);
1531
1532       function Flag172 (N : Node_Id) return Boolean;
1533       pragma Inline (Flag172);
1534
1535       function Flag173 (N : Node_Id) return Boolean;
1536       pragma Inline (Flag173);
1537
1538       function Flag174 (N : Node_Id) return Boolean;
1539       pragma Inline (Flag174);
1540
1541       function Flag175 (N : Node_Id) return Boolean;
1542       pragma Inline (Flag175);
1543
1544       function Flag176 (N : Node_Id) return Boolean;
1545       pragma Inline (Flag176);
1546
1547       function Flag177 (N : Node_Id) return Boolean;
1548       pragma Inline (Flag177);
1549
1550       function Flag178 (N : Node_Id) return Boolean;
1551       pragma Inline (Flag178);
1552
1553       function Flag179 (N : Node_Id) return Boolean;
1554       pragma Inline (Flag179);
1555
1556       function Flag180 (N : Node_Id) return Boolean;
1557       pragma Inline (Flag180);
1558
1559       function Flag181 (N : Node_Id) return Boolean;
1560       pragma Inline (Flag181);
1561
1562       function Flag182 (N : Node_Id) return Boolean;
1563       pragma Inline (Flag182);
1564
1565       function Flag183 (N : Node_Id) return Boolean;
1566       pragma Inline (Flag183);
1567
1568       --  Procedures to set value of indicated field
1569
1570       procedure Set_Nkind (N : Node_Id; Val : Node_Kind);
1571       pragma Inline (Set_Nkind);
1572
1573       procedure Set_Field1 (N : Node_Id; Val : Union_Id);
1574       pragma Inline (Set_Field1);
1575
1576       procedure Set_Field2 (N : Node_Id; Val : Union_Id);
1577       pragma Inline (Set_Field2);
1578
1579       procedure Set_Field3 (N : Node_Id; Val : Union_Id);
1580       pragma Inline (Set_Field3);
1581
1582       procedure Set_Field4 (N : Node_Id; Val : Union_Id);
1583       pragma Inline (Set_Field4);
1584
1585       procedure Set_Field5 (N : Node_Id; Val : Union_Id);
1586       pragma Inline (Set_Field5);
1587
1588       procedure Set_Field6 (N : Node_Id; Val : Union_Id);
1589       pragma Inline (Set_Field6);
1590
1591       procedure Set_Field7 (N : Node_Id; Val : Union_Id);
1592       pragma Inline (Set_Field7);
1593
1594       procedure Set_Field8 (N : Node_Id; Val : Union_Id);
1595       pragma Inline (Set_Field8);
1596
1597       procedure Set_Field9 (N : Node_Id; Val : Union_Id);
1598       pragma Inline (Set_Field9);
1599
1600       procedure Set_Field10 (N : Node_Id; Val : Union_Id);
1601       pragma Inline (Set_Field10);
1602
1603       procedure Set_Field11 (N : Node_Id; Val : Union_Id);
1604       pragma Inline (Set_Field11);
1605
1606       procedure Set_Field12 (N : Node_Id; Val : Union_Id);
1607       pragma Inline (Set_Field12);
1608
1609       procedure Set_Field13 (N : Node_Id; Val : Union_Id);
1610       pragma Inline (Set_Field13);
1611
1612       procedure Set_Field14 (N : Node_Id; Val : Union_Id);
1613       pragma Inline (Set_Field14);
1614
1615       procedure Set_Field15 (N : Node_Id; Val : Union_Id);
1616       pragma Inline (Set_Field15);
1617
1618       procedure Set_Field16 (N : Node_Id; Val : Union_Id);
1619       pragma Inline (Set_Field16);
1620
1621       procedure Set_Field17 (N : Node_Id; Val : Union_Id);
1622       pragma Inline (Set_Field17);
1623
1624       procedure Set_Field18 (N : Node_Id; Val : Union_Id);
1625       pragma Inline (Set_Field18);
1626
1627       procedure Set_Field19 (N : Node_Id; Val : Union_Id);
1628       pragma Inline (Set_Field19);
1629
1630       procedure Set_Field20 (N : Node_Id; Val : Union_Id);
1631       pragma Inline (Set_Field20);
1632
1633       procedure Set_Field21 (N : Node_Id; Val : Union_Id);
1634       pragma Inline (Set_Field21);
1635
1636       procedure Set_Field22 (N : Node_Id; Val : Union_Id);
1637       pragma Inline (Set_Field22);
1638
1639       procedure Set_Field23 (N : Node_Id; Val : Union_Id);
1640       pragma Inline (Set_Field23);
1641
1642       procedure Set_Node1 (N : Node_Id; Val : Node_Id);
1643       pragma Inline (Set_Node1);
1644
1645       procedure Set_Node2 (N : Node_Id; Val : Node_Id);
1646       pragma Inline (Set_Node2);
1647
1648       procedure Set_Node3 (N : Node_Id; Val : Node_Id);
1649       pragma Inline (Set_Node3);
1650
1651       procedure Set_Node4 (N : Node_Id; Val : Node_Id);
1652       pragma Inline (Set_Node4);
1653
1654       procedure Set_Node5 (N : Node_Id; Val : Node_Id);
1655       pragma Inline (Set_Node5);
1656
1657       procedure Set_Node6 (N : Node_Id; Val : Node_Id);
1658       pragma Inline (Set_Node6);
1659
1660       procedure Set_Node7 (N : Node_Id; Val : Node_Id);
1661       pragma Inline (Set_Node7);
1662
1663       procedure Set_Node8 (N : Node_Id; Val : Node_Id);
1664       pragma Inline (Set_Node8);
1665
1666       procedure Set_Node9 (N : Node_Id; Val : Node_Id);
1667       pragma Inline (Set_Node9);
1668
1669       procedure Set_Node10 (N : Node_Id; Val : Node_Id);
1670       pragma Inline (Set_Node10);
1671
1672       procedure Set_Node11 (N : Node_Id; Val : Node_Id);
1673       pragma Inline (Set_Node11);
1674
1675       procedure Set_Node12 (N : Node_Id; Val : Node_Id);
1676       pragma Inline (Set_Node12);
1677
1678       procedure Set_Node13 (N : Node_Id; Val : Node_Id);
1679       pragma Inline (Set_Node13);
1680
1681       procedure Set_Node14 (N : Node_Id; Val : Node_Id);
1682       pragma Inline (Set_Node14);
1683
1684       procedure Set_Node15 (N : Node_Id; Val : Node_Id);
1685       pragma Inline (Set_Node15);
1686
1687       procedure Set_Node16 (N : Node_Id; Val : Node_Id);
1688       pragma Inline (Set_Node16);
1689
1690       procedure Set_Node17 (N : Node_Id; Val : Node_Id);
1691       pragma Inline (Set_Node17);
1692
1693       procedure Set_Node18 (N : Node_Id; Val : Node_Id);
1694       pragma Inline (Set_Node18);
1695
1696       procedure Set_Node19 (N : Node_Id; Val : Node_Id);
1697       pragma Inline (Set_Node19);
1698
1699       procedure Set_Node20 (N : Node_Id; Val : Node_Id);
1700       pragma Inline (Set_Node20);
1701
1702       procedure Set_Node21 (N : Node_Id; Val : Node_Id);
1703       pragma Inline (Set_Node21);
1704
1705       procedure Set_Node22 (N : Node_Id; Val : Node_Id);
1706       pragma Inline (Set_Node22);
1707
1708       procedure Set_Node23 (N : Node_Id; Val : Node_Id);
1709       pragma Inline (Set_Node23);
1710
1711       procedure Set_List1 (N : Node_Id; Val : List_Id);
1712       pragma Inline (Set_List1);
1713
1714       procedure Set_List2 (N : Node_Id; Val : List_Id);
1715       pragma Inline (Set_List2);
1716
1717       procedure Set_List3 (N : Node_Id; Val : List_Id);
1718       pragma Inline (Set_List3);
1719
1720       procedure Set_List4 (N : Node_Id; Val : List_Id);
1721       pragma Inline (Set_List4);
1722
1723       procedure Set_List5 (N : Node_Id; Val : List_Id);
1724       pragma Inline (Set_List5);
1725
1726       procedure Set_List10 (N : Node_Id; Val : List_Id);
1727       pragma Inline (Set_List10);
1728
1729       procedure Set_List14 (N : Node_Id; Val : List_Id);
1730       pragma Inline (Set_List14);
1731
1732       procedure Set_Elist2 (N : Node_Id; Val : Elist_Id);
1733       pragma Inline (Set_Elist2);
1734
1735       procedure Set_Elist3 (N : Node_Id; Val : Elist_Id);
1736       pragma Inline (Set_Elist3);
1737
1738       procedure Set_Elist4 (N : Node_Id; Val : Elist_Id);
1739       pragma Inline (Set_Elist4);
1740
1741       procedure Set_Elist8 (N : Node_Id; Val : Elist_Id);
1742       pragma Inline (Set_Elist8);
1743
1744       procedure Set_Elist13 (N : Node_Id; Val : Elist_Id);
1745       pragma Inline (Set_Elist13);
1746
1747       procedure Set_Elist15 (N : Node_Id; Val : Elist_Id);
1748       pragma Inline (Set_Elist15);
1749
1750       procedure Set_Elist16 (N : Node_Id; Val : Elist_Id);
1751       pragma Inline (Set_Elist16);
1752
1753       procedure Set_Elist18 (N : Node_Id; Val : Elist_Id);
1754       pragma Inline (Set_Elist18);
1755
1756       procedure Set_Elist21 (N : Node_Id; Val : Elist_Id);
1757       pragma Inline (Set_Elist21);
1758
1759       procedure Set_Elist23 (N : Node_Id; Val : Elist_Id);
1760       pragma Inline (Set_Elist23);
1761
1762       procedure Set_Name1 (N : Node_Id; Val : Name_Id);
1763       pragma Inline (Set_Name1);
1764
1765       procedure Set_Name2 (N : Node_Id; Val : Name_Id);
1766       pragma Inline (Set_Name2);
1767
1768       procedure Set_Char_Code2 (N : Node_Id; Val : Char_Code);
1769       pragma Inline (Set_Char_Code2);
1770
1771       procedure Set_Str3 (N : Node_Id; Val : String_Id);
1772       pragma Inline (Set_Str3);
1773
1774       procedure Set_Uint3 (N : Node_Id; Val : Uint);
1775       pragma Inline (Set_Uint3);
1776
1777       procedure Set_Uint4 (N : Node_Id; Val : Uint);
1778       pragma Inline (Set_Uint4);
1779
1780       procedure Set_Uint5 (N : Node_Id; Val : Uint);
1781       pragma Inline (Set_Uint5);
1782
1783       procedure Set_Uint8 (N : Node_Id; Val : Uint);
1784       pragma Inline (Set_Uint8);
1785
1786       procedure Set_Uint9 (N : Node_Id; Val : Uint);
1787       pragma Inline (Set_Uint9);
1788
1789       procedure Set_Uint10 (N : Node_Id; Val : Uint);
1790       pragma Inline (Set_Uint10);
1791
1792       procedure Set_Uint11 (N : Node_Id; Val : Uint);
1793       pragma Inline (Set_Uint11);
1794
1795       procedure Set_Uint12 (N : Node_Id; Val : Uint);
1796       pragma Inline (Set_Uint12);
1797
1798       procedure Set_Uint13 (N : Node_Id; Val : Uint);
1799       pragma Inline (Set_Uint13);
1800
1801       procedure Set_Uint14 (N : Node_Id; Val : Uint);
1802       pragma Inline (Set_Uint14);
1803
1804       procedure Set_Uint15 (N : Node_Id; Val : Uint);
1805       pragma Inline (Set_Uint15);
1806
1807       procedure Set_Uint16 (N : Node_Id; Val : Uint);
1808       pragma Inline (Set_Uint16);
1809
1810       procedure Set_Uint17 (N : Node_Id; Val : Uint);
1811       pragma Inline (Set_Uint17);
1812
1813       procedure Set_Uint22 (N : Node_Id; Val : Uint);
1814       pragma Inline (Set_Uint22);
1815
1816       procedure Set_Ureal3 (N : Node_Id; Val : Ureal);
1817       pragma Inline (Set_Ureal3);
1818
1819       procedure Set_Ureal18 (N : Node_Id; Val : Ureal);
1820       pragma Inline (Set_Ureal18);
1821
1822       procedure Set_Ureal21 (N : Node_Id; Val : Ureal);
1823       pragma Inline (Set_Ureal21);
1824
1825       procedure Set_Flag4 (N : Node_Id; Val : Boolean);
1826       pragma Inline (Set_Flag4);
1827
1828       procedure Set_Flag5 (N : Node_Id; Val : Boolean);
1829       pragma Inline (Set_Flag5);
1830
1831       procedure Set_Flag6 (N : Node_Id; Val : Boolean);
1832       pragma Inline (Set_Flag6);
1833
1834       procedure Set_Flag7 (N : Node_Id; Val : Boolean);
1835       pragma Inline (Set_Flag7);
1836
1837       procedure Set_Flag8 (N : Node_Id; Val : Boolean);
1838       pragma Inline (Set_Flag8);
1839
1840       procedure Set_Flag9 (N : Node_Id; Val : Boolean);
1841       pragma Inline (Set_Flag9);
1842
1843       procedure Set_Flag10 (N : Node_Id; Val : Boolean);
1844       pragma Inline (Set_Flag10);
1845
1846       procedure Set_Flag11 (N : Node_Id; Val : Boolean);
1847       pragma Inline (Set_Flag11);
1848
1849       procedure Set_Flag12 (N : Node_Id; Val : Boolean);
1850       pragma Inline (Set_Flag12);
1851
1852       procedure Set_Flag13 (N : Node_Id; Val : Boolean);
1853       pragma Inline (Set_Flag13);
1854
1855       procedure Set_Flag14 (N : Node_Id; Val : Boolean);
1856       pragma Inline (Set_Flag14);
1857
1858       procedure Set_Flag15 (N : Node_Id; Val : Boolean);
1859       pragma Inline (Set_Flag15);
1860
1861       procedure Set_Flag16 (N : Node_Id; Val : Boolean);
1862       pragma Inline (Set_Flag16);
1863
1864       procedure Set_Flag17 (N : Node_Id; Val : Boolean);
1865       pragma Inline (Set_Flag17);
1866
1867       procedure Set_Flag18 (N : Node_Id; Val : Boolean);
1868       pragma Inline (Set_Flag18);
1869
1870       procedure Set_Flag19 (N : Node_Id; Val : Boolean);
1871       pragma Inline (Set_Flag19);
1872
1873       procedure Set_Flag20 (N : Node_Id; Val : Boolean);
1874       pragma Inline (Set_Flag20);
1875
1876       procedure Set_Flag21 (N : Node_Id; Val : Boolean);
1877       pragma Inline (Set_Flag21);
1878
1879       procedure Set_Flag22 (N : Node_Id; Val : Boolean);
1880       pragma Inline (Set_Flag22);
1881
1882       procedure Set_Flag23 (N : Node_Id; Val : Boolean);
1883       pragma Inline (Set_Flag23);
1884
1885       procedure Set_Flag24 (N : Node_Id; Val : Boolean);
1886       pragma Inline (Set_Flag24);
1887
1888       procedure Set_Flag25 (N : Node_Id; Val : Boolean);
1889       pragma Inline (Set_Flag25);
1890
1891       procedure Set_Flag26 (N : Node_Id; Val : Boolean);
1892       pragma Inline (Set_Flag26);
1893
1894       procedure Set_Flag27 (N : Node_Id; Val : Boolean);
1895       pragma Inline (Set_Flag27);
1896
1897       procedure Set_Flag28 (N : Node_Id; Val : Boolean);
1898       pragma Inline (Set_Flag28);
1899
1900       procedure Set_Flag29 (N : Node_Id; Val : Boolean);
1901       pragma Inline (Set_Flag29);
1902
1903       procedure Set_Flag30 (N : Node_Id; Val : Boolean);
1904       pragma Inline (Set_Flag30);
1905
1906       procedure Set_Flag31 (N : Node_Id; Val : Boolean);
1907       pragma Inline (Set_Flag31);
1908
1909       procedure Set_Flag32 (N : Node_Id; Val : Boolean);
1910       pragma Inline (Set_Flag32);
1911
1912       procedure Set_Flag33 (N : Node_Id; Val : Boolean);
1913       pragma Inline (Set_Flag33);
1914
1915       procedure Set_Flag34 (N : Node_Id; Val : Boolean);
1916       pragma Inline (Set_Flag34);
1917
1918       procedure Set_Flag35 (N : Node_Id; Val : Boolean);
1919       pragma Inline (Set_Flag35);
1920
1921       procedure Set_Flag36 (N : Node_Id; Val : Boolean);
1922       pragma Inline (Set_Flag36);
1923
1924       procedure Set_Flag37 (N : Node_Id; Val : Boolean);
1925       pragma Inline (Set_Flag37);
1926
1927       procedure Set_Flag38 (N : Node_Id; Val : Boolean);
1928       pragma Inline (Set_Flag38);
1929
1930       procedure Set_Flag39 (N : Node_Id; Val : Boolean);
1931       pragma Inline (Set_Flag39);
1932
1933       procedure Set_Flag40 (N : Node_Id; Val : Boolean);
1934       pragma Inline (Set_Flag40);
1935
1936       procedure Set_Flag41 (N : Node_Id; Val : Boolean);
1937       pragma Inline (Set_Flag41);
1938
1939       procedure Set_Flag42 (N : Node_Id; Val : Boolean);
1940       pragma Inline (Set_Flag42);
1941
1942       procedure Set_Flag43 (N : Node_Id; Val : Boolean);
1943       pragma Inline (Set_Flag43);
1944
1945       procedure Set_Flag44 (N : Node_Id; Val : Boolean);
1946       pragma Inline (Set_Flag44);
1947
1948       procedure Set_Flag45 (N : Node_Id; Val : Boolean);
1949       pragma Inline (Set_Flag45);
1950
1951       procedure Set_Flag46 (N : Node_Id; Val : Boolean);
1952       pragma Inline (Set_Flag46);
1953
1954       procedure Set_Flag47 (N : Node_Id; Val : Boolean);
1955       pragma Inline (Set_Flag47);
1956
1957       procedure Set_Flag48 (N : Node_Id; Val : Boolean);
1958       pragma Inline (Set_Flag48);
1959
1960       procedure Set_Flag49 (N : Node_Id; Val : Boolean);
1961       pragma Inline (Set_Flag49);
1962
1963       procedure Set_Flag50 (N : Node_Id; Val : Boolean);
1964       pragma Inline (Set_Flag50);
1965
1966       procedure Set_Flag51 (N : Node_Id; Val : Boolean);
1967       pragma Inline (Set_Flag51);
1968
1969       procedure Set_Flag52 (N : Node_Id; Val : Boolean);
1970       pragma Inline (Set_Flag52);
1971
1972       procedure Set_Flag53 (N : Node_Id; Val : Boolean);
1973       pragma Inline (Set_Flag53);
1974
1975       procedure Set_Flag54 (N : Node_Id; Val : Boolean);
1976       pragma Inline (Set_Flag54);
1977
1978       procedure Set_Flag55 (N : Node_Id; Val : Boolean);
1979       pragma Inline (Set_Flag55);
1980
1981       procedure Set_Flag56 (N : Node_Id; Val : Boolean);
1982       pragma Inline (Set_Flag56);
1983
1984       procedure Set_Flag57 (N : Node_Id; Val : Boolean);
1985       pragma Inline (Set_Flag57);
1986
1987       procedure Set_Flag58 (N : Node_Id; Val : Boolean);
1988       pragma Inline (Set_Flag58);
1989
1990       procedure Set_Flag59 (N : Node_Id; Val : Boolean);
1991       pragma Inline (Set_Flag59);
1992
1993       procedure Set_Flag60 (N : Node_Id; Val : Boolean);
1994       pragma Inline (Set_Flag60);
1995
1996       procedure Set_Flag61 (N : Node_Id; Val : Boolean);
1997       pragma Inline (Set_Flag61);
1998
1999       procedure Set_Flag62 (N : Node_Id; Val : Boolean);
2000       pragma Inline (Set_Flag62);
2001
2002       procedure Set_Flag63 (N : Node_Id; Val : Boolean);
2003       pragma Inline (Set_Flag63);
2004
2005       procedure Set_Flag64 (N : Node_Id; Val : Boolean);
2006       pragma Inline (Set_Flag64);
2007
2008       procedure Set_Flag65 (N : Node_Id; Val : Boolean);
2009       pragma Inline (Set_Flag65);
2010
2011       procedure Set_Flag66 (N : Node_Id; Val : Boolean);
2012       pragma Inline (Set_Flag66);
2013
2014       procedure Set_Flag67 (N : Node_Id; Val : Boolean);
2015       pragma Inline (Set_Flag67);
2016
2017       procedure Set_Flag68 (N : Node_Id; Val : Boolean);
2018       pragma Inline (Set_Flag68);
2019
2020       procedure Set_Flag69 (N : Node_Id; Val : Boolean);
2021       pragma Inline (Set_Flag69);
2022
2023       procedure Set_Flag70 (N : Node_Id; Val : Boolean);
2024       pragma Inline (Set_Flag70);
2025
2026       procedure Set_Flag71 (N : Node_Id; Val : Boolean);
2027       pragma Inline (Set_Flag71);
2028
2029       procedure Set_Flag72 (N : Node_Id; Val : Boolean);
2030       pragma Inline (Set_Flag72);
2031
2032       procedure Set_Flag73 (N : Node_Id; Val : Boolean);
2033       pragma Inline (Set_Flag73);
2034
2035       procedure Set_Flag74 (N : Node_Id; Val : Boolean);
2036       pragma Inline (Set_Flag74);
2037
2038       procedure Set_Flag75 (N : Node_Id; Val : Boolean);
2039       pragma Inline (Set_Flag75);
2040
2041       procedure Set_Flag76 (N : Node_Id; Val : Boolean);
2042       pragma Inline (Set_Flag76);
2043
2044       procedure Set_Flag77 (N : Node_Id; Val : Boolean);
2045       pragma Inline (Set_Flag77);
2046
2047       procedure Set_Flag78 (N : Node_Id; Val : Boolean);
2048       pragma Inline (Set_Flag78);
2049
2050       procedure Set_Flag79 (N : Node_Id; Val : Boolean);
2051       pragma Inline (Set_Flag79);
2052
2053       procedure Set_Flag80 (N : Node_Id; Val : Boolean);
2054       pragma Inline (Set_Flag80);
2055
2056       procedure Set_Flag81 (N : Node_Id; Val : Boolean);
2057       pragma Inline (Set_Flag81);
2058
2059       procedure Set_Flag82 (N : Node_Id; Val : Boolean);
2060       pragma Inline (Set_Flag82);
2061
2062       procedure Set_Flag83 (N : Node_Id; Val : Boolean);
2063       pragma Inline (Set_Flag83);
2064
2065       procedure Set_Flag84 (N : Node_Id; Val : Boolean);
2066       pragma Inline (Set_Flag84);
2067
2068       procedure Set_Flag85 (N : Node_Id; Val : Boolean);
2069       pragma Inline (Set_Flag85);
2070
2071       procedure Set_Flag86 (N : Node_Id; Val : Boolean);
2072       pragma Inline (Set_Flag86);
2073
2074       procedure Set_Flag87 (N : Node_Id; Val : Boolean);
2075       pragma Inline (Set_Flag87);
2076
2077       procedure Set_Flag88 (N : Node_Id; Val : Boolean);
2078       pragma Inline (Set_Flag88);
2079
2080       procedure Set_Flag89 (N : Node_Id; Val : Boolean);
2081       pragma Inline (Set_Flag89);
2082
2083       procedure Set_Flag90 (N : Node_Id; Val : Boolean);
2084       pragma Inline (Set_Flag90);
2085
2086       procedure Set_Flag91 (N : Node_Id; Val : Boolean);
2087       pragma Inline (Set_Flag91);
2088
2089       procedure Set_Flag92 (N : Node_Id; Val : Boolean);
2090       pragma Inline (Set_Flag92);
2091
2092       procedure Set_Flag93 (N : Node_Id; Val : Boolean);
2093       pragma Inline (Set_Flag93);
2094
2095       procedure Set_Flag94 (N : Node_Id; Val : Boolean);
2096       pragma Inline (Set_Flag94);
2097
2098       procedure Set_Flag95 (N : Node_Id; Val : Boolean);
2099       pragma Inline (Set_Flag95);
2100
2101       procedure Set_Flag96 (N : Node_Id; Val : Boolean);
2102       pragma Inline (Set_Flag96);
2103
2104       procedure Set_Flag97 (N : Node_Id; Val : Boolean);
2105       pragma Inline (Set_Flag97);
2106
2107       procedure Set_Flag98 (N : Node_Id; Val : Boolean);
2108       pragma Inline (Set_Flag98);
2109
2110       procedure Set_Flag99 (N : Node_Id; Val : Boolean);
2111       pragma Inline (Set_Flag99);
2112
2113       procedure Set_Flag100 (N : Node_Id; Val : Boolean);
2114       pragma Inline (Set_Flag100);
2115
2116       procedure Set_Flag101 (N : Node_Id; Val : Boolean);
2117       pragma Inline (Set_Flag101);
2118
2119       procedure Set_Flag102 (N : Node_Id; Val : Boolean);
2120       pragma Inline (Set_Flag102);
2121
2122       procedure Set_Flag103 (N : Node_Id; Val : Boolean);
2123       pragma Inline (Set_Flag103);
2124
2125       procedure Set_Flag104 (N : Node_Id; Val : Boolean);
2126       pragma Inline (Set_Flag104);
2127
2128       procedure Set_Flag105 (N : Node_Id; Val : Boolean);
2129       pragma Inline (Set_Flag105);
2130
2131       procedure Set_Flag106 (N : Node_Id; Val : Boolean);
2132       pragma Inline (Set_Flag106);
2133
2134       procedure Set_Flag107 (N : Node_Id; Val : Boolean);
2135       pragma Inline (Set_Flag107);
2136
2137       procedure Set_Flag108 (N : Node_Id; Val : Boolean);
2138       pragma Inline (Set_Flag108);
2139
2140       procedure Set_Flag109 (N : Node_Id; Val : Boolean);
2141       pragma Inline (Set_Flag109);
2142
2143       procedure Set_Flag110 (N : Node_Id; Val : Boolean);
2144       pragma Inline (Set_Flag110);
2145
2146       procedure Set_Flag111 (N : Node_Id; Val : Boolean);
2147       pragma Inline (Set_Flag111);
2148
2149       procedure Set_Flag112 (N : Node_Id; Val : Boolean);
2150       pragma Inline (Set_Flag112);
2151
2152       procedure Set_Flag113 (N : Node_Id; Val : Boolean);
2153       pragma Inline (Set_Flag113);
2154
2155       procedure Set_Flag114 (N : Node_Id; Val : Boolean);
2156       pragma Inline (Set_Flag114);
2157
2158       procedure Set_Flag115 (N : Node_Id; Val : Boolean);
2159       pragma Inline (Set_Flag115);
2160
2161       procedure Set_Flag116 (N : Node_Id; Val : Boolean);
2162       pragma Inline (Set_Flag116);
2163
2164       procedure Set_Flag117 (N : Node_Id; Val : Boolean);
2165       pragma Inline (Set_Flag117);
2166
2167       procedure Set_Flag118 (N : Node_Id; Val : Boolean);
2168       pragma Inline (Set_Flag118);
2169
2170       procedure Set_Flag119 (N : Node_Id; Val : Boolean);
2171       pragma Inline (Set_Flag119);
2172
2173       procedure Set_Flag120 (N : Node_Id; Val : Boolean);
2174       pragma Inline (Set_Flag120);
2175
2176       procedure Set_Flag121 (N : Node_Id; Val : Boolean);
2177       pragma Inline (Set_Flag121);
2178
2179       procedure Set_Flag122 (N : Node_Id; Val : Boolean);
2180       pragma Inline (Set_Flag122);
2181
2182       procedure Set_Flag123 (N : Node_Id; Val : Boolean);
2183       pragma Inline (Set_Flag123);
2184
2185       procedure Set_Flag124 (N : Node_Id; Val : Boolean);
2186       pragma Inline (Set_Flag124);
2187
2188       procedure Set_Flag125 (N : Node_Id; Val : Boolean);
2189       pragma Inline (Set_Flag125);
2190
2191       procedure Set_Flag126 (N : Node_Id; Val : Boolean);
2192       pragma Inline (Set_Flag126);
2193
2194       procedure Set_Flag127 (N : Node_Id; Val : Boolean);
2195       pragma Inline (Set_Flag127);
2196
2197       procedure Set_Flag128 (N : Node_Id; Val : Boolean);
2198       pragma Inline (Set_Flag128);
2199
2200       procedure Set_Flag129 (N : Node_Id; Val : Boolean);
2201       pragma Inline (Set_Flag129);
2202
2203       procedure Set_Flag130 (N : Node_Id; Val : Boolean);
2204       pragma Inline (Set_Flag130);
2205
2206       procedure Set_Flag131 (N : Node_Id; Val : Boolean);
2207       pragma Inline (Set_Flag131);
2208
2209       procedure Set_Flag132 (N : Node_Id; Val : Boolean);
2210       pragma Inline (Set_Flag132);
2211
2212       procedure Set_Flag133 (N : Node_Id; Val : Boolean);
2213       pragma Inline (Set_Flag133);
2214
2215       procedure Set_Flag134 (N : Node_Id; Val : Boolean);
2216       pragma Inline (Set_Flag134);
2217
2218       procedure Set_Flag135 (N : Node_Id; Val : Boolean);
2219       pragma Inline (Set_Flag135);
2220
2221       procedure Set_Flag136 (N : Node_Id; Val : Boolean);
2222       pragma Inline (Set_Flag136);
2223
2224       procedure Set_Flag137 (N : Node_Id; Val : Boolean);
2225       pragma Inline (Set_Flag137);
2226
2227       procedure Set_Flag138 (N : Node_Id; Val : Boolean);
2228       pragma Inline (Set_Flag138);
2229
2230       procedure Set_Flag139 (N : Node_Id; Val : Boolean);
2231       pragma Inline (Set_Flag139);
2232
2233       procedure Set_Flag140 (N : Node_Id; Val : Boolean);
2234       pragma Inline (Set_Flag140);
2235
2236       procedure Set_Flag141 (N : Node_Id; Val : Boolean);
2237       pragma Inline (Set_Flag141);
2238
2239       procedure Set_Flag142 (N : Node_Id; Val : Boolean);
2240       pragma Inline (Set_Flag142);
2241
2242       procedure Set_Flag143 (N : Node_Id; Val : Boolean);
2243       pragma Inline (Set_Flag143);
2244
2245       procedure Set_Flag144 (N : Node_Id; Val : Boolean);
2246       pragma Inline (Set_Flag144);
2247
2248       procedure Set_Flag145 (N : Node_Id; Val : Boolean);
2249       pragma Inline (Set_Flag145);
2250
2251       procedure Set_Flag146 (N : Node_Id; Val : Boolean);
2252       pragma Inline (Set_Flag146);
2253
2254       procedure Set_Flag147 (N : Node_Id; Val : Boolean);
2255       pragma Inline (Set_Flag147);
2256
2257       procedure Set_Flag148 (N : Node_Id; Val : Boolean);
2258       pragma Inline (Set_Flag148);
2259
2260       procedure Set_Flag149 (N : Node_Id; Val : Boolean);
2261       pragma Inline (Set_Flag149);
2262
2263       procedure Set_Flag150 (N : Node_Id; Val : Boolean);
2264       pragma Inline (Set_Flag150);
2265
2266       procedure Set_Flag151 (N : Node_Id; Val : Boolean);
2267       pragma Inline (Set_Flag151);
2268
2269       procedure Set_Flag152 (N : Node_Id; Val : Boolean);
2270       pragma Inline (Set_Flag152);
2271
2272       procedure Set_Flag153 (N : Node_Id; Val : Boolean);
2273       pragma Inline (Set_Flag153);
2274
2275       procedure Set_Flag154 (N : Node_Id; Val : Boolean);
2276       pragma Inline (Set_Flag154);
2277
2278       procedure Set_Flag155 (N : Node_Id; Val : Boolean);
2279       pragma Inline (Set_Flag155);
2280
2281       procedure Set_Flag156 (N : Node_Id; Val : Boolean);
2282       pragma Inline (Set_Flag156);
2283
2284       procedure Set_Flag157 (N : Node_Id; Val : Boolean);
2285       pragma Inline (Set_Flag157);
2286
2287       procedure Set_Flag158 (N : Node_Id; Val : Boolean);
2288       pragma Inline (Set_Flag158);
2289
2290       procedure Set_Flag159 (N : Node_Id; Val : Boolean);
2291       pragma Inline (Set_Flag159);
2292
2293       procedure Set_Flag160 (N : Node_Id; Val : Boolean);
2294       pragma Inline (Set_Flag160);
2295
2296       procedure Set_Flag161 (N : Node_Id; Val : Boolean);
2297       pragma Inline (Set_Flag161);
2298
2299       procedure Set_Flag162 (N : Node_Id; Val : Boolean);
2300       pragma Inline (Set_Flag162);
2301
2302       procedure Set_Flag163 (N : Node_Id; Val : Boolean);
2303       pragma Inline (Set_Flag163);
2304
2305       procedure Set_Flag164 (N : Node_Id; Val : Boolean);
2306       pragma Inline (Set_Flag164);
2307
2308       procedure Set_Flag165 (N : Node_Id; Val : Boolean);
2309       pragma Inline (Set_Flag165);
2310
2311       procedure Set_Flag166 (N : Node_Id; Val : Boolean);
2312       pragma Inline (Set_Flag166);
2313
2314       procedure Set_Flag167 (N : Node_Id; Val : Boolean);
2315       pragma Inline (Set_Flag167);
2316
2317       procedure Set_Flag168 (N : Node_Id; Val : Boolean);
2318       pragma Inline (Set_Flag168);
2319
2320       procedure Set_Flag169 (N : Node_Id; Val : Boolean);
2321       pragma Inline (Set_Flag169);
2322
2323       procedure Set_Flag170 (N : Node_Id; Val : Boolean);
2324       pragma Inline (Set_Flag170);
2325
2326       procedure Set_Flag171 (N : Node_Id; Val : Boolean);
2327       pragma Inline (Set_Flag171);
2328
2329       procedure Set_Flag172 (N : Node_Id; Val : Boolean);
2330       pragma Inline (Set_Flag172);
2331
2332       procedure Set_Flag173 (N : Node_Id; Val : Boolean);
2333       pragma Inline (Set_Flag173);
2334
2335       procedure Set_Flag174 (N : Node_Id; Val : Boolean);
2336       pragma Inline (Set_Flag174);
2337
2338       procedure Set_Flag175 (N : Node_Id; Val : Boolean);
2339       pragma Inline (Set_Flag175);
2340
2341       procedure Set_Flag176 (N : Node_Id; Val : Boolean);
2342       pragma Inline (Set_Flag176);
2343
2344       procedure Set_Flag177 (N : Node_Id; Val : Boolean);
2345       pragma Inline (Set_Flag177);
2346
2347       procedure Set_Flag178 (N : Node_Id; Val : Boolean);
2348       pragma Inline (Set_Flag178);
2349
2350       procedure Set_Flag179 (N : Node_Id; Val : Boolean);
2351       pragma Inline (Set_Flag179);
2352
2353       procedure Set_Flag180 (N : Node_Id; Val : Boolean);
2354       pragma Inline (Set_Flag180);
2355
2356       procedure Set_Flag181 (N : Node_Id; Val : Boolean);
2357       pragma Inline (Set_Flag181);
2358
2359       procedure Set_Flag182 (N : Node_Id; Val : Boolean);
2360       pragma Inline (Set_Flag182);
2361
2362       procedure Set_Flag183 (N : Node_Id; Val : Boolean);
2363       pragma Inline (Set_Flag183);
2364
2365       --  The following versions of Set_Noden also set the parent
2366       --  pointer of the referenced node if it is non_Empty
2367
2368       procedure Set_Node1_With_Parent (N : Node_Id; Val : Node_Id);
2369       pragma Inline (Set_Node1_With_Parent);
2370
2371       procedure Set_Node2_With_Parent (N : Node_Id; Val : Node_Id);
2372       pragma Inline (Set_Node2_With_Parent);
2373
2374       procedure Set_Node3_With_Parent (N : Node_Id; Val : Node_Id);
2375       pragma Inline (Set_Node3_With_Parent);
2376
2377       procedure Set_Node4_With_Parent (N : Node_Id; Val : Node_Id);
2378       pragma Inline (Set_Node4_With_Parent);
2379
2380       procedure Set_Node5_With_Parent (N : Node_Id; Val : Node_Id);
2381       pragma Inline (Set_Node5_With_Parent);
2382
2383       --  The following versions of Set_Listn also set the parent pointer of
2384       --  the referenced node if it is non_Empty. The procedures for List6
2385       --  to List12 can only be applied to nodes which have an extension.
2386
2387       procedure Set_List1_With_Parent (N : Node_Id; Val : List_Id);
2388       pragma Inline (Set_List1_With_Parent);
2389
2390       procedure Set_List2_With_Parent (N : Node_Id; Val : List_Id);
2391       pragma Inline (Set_List2_With_Parent);
2392
2393       procedure Set_List3_With_Parent (N : Node_Id; Val : List_Id);
2394       pragma Inline (Set_List3_With_Parent);
2395
2396       procedure Set_List4_With_Parent (N : Node_Id; Val : List_Id);
2397       pragma Inline (Set_List4_With_Parent);
2398
2399       procedure Set_List5_With_Parent (N : Node_Id; Val : List_Id);
2400       pragma Inline (Set_List5_With_Parent);
2401
2402    end Unchecked_Access;
2403
2404    -----------------------------
2405    -- Private Part Subpackage --
2406    -----------------------------
2407
2408    --  The following package contains the definition of the data structure
2409    --  used by the implementation of the Atree package. Logically it really
2410    --  corresponds to the private part, hence the name. The reason that it
2411    --  is defined as a sub-package is to allow special access from clients
2412    --  that need to see the internals of the data structures.
2413
2414    package Atree_Private_Part is
2415
2416       -------------------------
2417       -- Tree Representation --
2418       -------------------------
2419
2420       --  The nodes of the tree are stored in a table (i.e. an array). In the
2421       --  case of extended nodes four consecutive components in the array are
2422       --  used. There are thus two formats for array components. One is used
2423       --  for non-extended nodes, and for the first component of extended
2424       --  nodes. The other is used for the extension parts (second, third and
2425       --  fourth components) of an extended node. A variant record structure
2426       --  is used to distinguish the two formats.
2427
2428       type Node_Record (Is_Extension : Boolean := False) is record
2429
2430          --  Logically, the only field in the common part is the above
2431          --  Is_Extension discriminant (a single bit). However, Gigi cannot
2432          --  yet handle such a structure, so we fill out the common part of
2433          --  the record with fields that are used in different ways for
2434          --  normal nodes and node extensions.
2435
2436          Pflag1, Pflag2 : Boolean;
2437          --  The Paren_Count field is represented using two boolean flags,
2438          --  where Pflag1 is worth 1, and Pflag2 is worth 2. This is done
2439          --  because we need to be easily able to reuse this field for
2440          --  extra flags in the extended node case.
2441
2442          In_List : Boolean;
2443          --  Flag used to indicate if node is a member of a list.
2444          --  This field is considered private to the Atree package.
2445
2446          Unused_1 : Boolean;
2447          --  Currently unused flag
2448
2449          Rewrite_Ins : Boolean;
2450          --  Flag set by Mark_Rewrite_Insertion procedure.
2451          --  This field is considered private to the Atree package.
2452
2453          Analyzed : Boolean;
2454          --  Flag to indicate the node has been analyzed (and expanded)
2455
2456          Comes_From_Source : Boolean;
2457          --  Flag to indicate that node comes from the source program (i.e.
2458          --  was built by the parser or scanner, not the analyzer or expander).
2459
2460          Error_Posted : Boolean;
2461          --  Flag to indicate that an error message has been posted on the
2462          --  node (to avoid duplicate flags on the same node)
2463
2464          Flag4  : Boolean;
2465          Flag5  : Boolean;
2466          Flag6  : Boolean;
2467          Flag7  : Boolean;
2468          Flag8  : Boolean;
2469          Flag9  : Boolean;
2470          Flag10 : Boolean;
2471          Flag11 : Boolean;
2472          Flag12 : Boolean;
2473          Flag13 : Boolean;
2474          Flag14 : Boolean;
2475          Flag15 : Boolean;
2476          Flag16 : Boolean;
2477          Flag17 : Boolean;
2478          Flag18 : Boolean;
2479          --  The eighteen flags for a normal node
2480
2481          --  The above fields are used as follows in components 2-4 of
2482          --  an extended node entry.
2483
2484          --    In_List            used as  Flag19, Flag40, Flag129
2485          --    Unused_1           used as  Flag20, Flag41, Flag130
2486          --    Rewrite_Ins        used as  Flag21, Flag42, Flag131
2487          --    Analyzed           used as  Flag22, Flag43, Flag132
2488          --    Comes_From_Source  used as  Flag23, Flag44, Flag133
2489          --    Error_Posted       used as  Flag24, Flag45, Flag134
2490          --    Flag4              used as  Flag25, Flag46, Flag135
2491          --    Flag5              used as  Flag26, Flag47, Flag136
2492          --    Flag6              used as  Flag27, Flag48, Flag137
2493          --    Flag7              used as  Flag28, Flag49, Flag138
2494          --    Flag8              used as  Flag29, Flag50, Flag139
2495          --    Flag9              used as  Flag30, Flag51, Flag140
2496          --    Flag10             used as  Flag31, Flag52, Flag141
2497          --    Flag11             used as  Flag32, Flag53, Flag142
2498          --    Flag12             used as  Flag33, Flag54, Flag143
2499          --    Flag13             used as  Flag34, Flag55, Flag144
2500          --    Flag14             used as  Flag35, Flag56, Flag145
2501          --    Flag15             used as  Flag36, Flag57, Flag146
2502          --    Flag16             used as  Flag37, Flag58, Flag147
2503          --    Flag17             used as  Flag38, Flag59, Flag148
2504          --    Flag18             used as  Flag39, Flag60, Flag149
2505          --    Pflag1             used as  Flag61, Flag62, Flag150
2506          --    Pflag2             used as  Flag63, Flag64, Flag151
2507
2508          Nkind : Node_Kind;
2509          --  For a non-extended node, or the initial section of an extended
2510          --  node, this field holds the Node_Kind value. For an extended node,
2511          --  The Nkind field is used as follows:
2512          --
2513          --     Second entry: holds the Ekind field of the entity
2514          --     Third entry:  holds 8 additional flags (Flag65-Flag72)
2515          --     Fourth entry: not currently used
2516
2517          --  Now finally (on an 32-bit boundary!) comes the variant part
2518
2519          case Is_Extension is
2520
2521             --  Non-extended node, or first component of extended node
2522
2523             when False =>
2524
2525                Sloc : Source_Ptr;
2526                --  Source location for this node
2527
2528                Link : Union_Id;
2529                --  This field is used either as the Parent pointer (if In_List
2530                --  is False), or to point to the list header (if In_List is
2531                --  True). This field is considered private and can be modified
2532                --  only by Atree or by Nlists.
2533
2534                Field1 : Union_Id;
2535                Field2 : Union_Id;
2536                Field3 : Union_Id;
2537                Field4 : Union_Id;
2538                Field5 : Union_Id;
2539                --  Five general use fields, which can contain Node_Id, List_Id,
2540                --  Elist_Id, String_Id, Name_Id, or Char_Code values depending
2541                --  on the values in Nkind and (for extended nodes), in Ekind.
2542                --  See packages Sinfo and Einfo for details of their use.
2543
2544             --  Extension (second component) of extended node
2545
2546             when True =>
2547                Field6  : Union_Id;
2548                Field7  : Union_Id;
2549                Field8  : Union_Id;
2550                Field9  : Union_Id;
2551                Field10 : Union_Id;
2552                Field11 : Union_Id;
2553                Field12 : Union_Id;
2554                --  Seven additional general fields available only for entities
2555                --  See package Einfo for details of their use (which depends
2556                --  on the value in the Ekind field).
2557
2558             --  In the third component, the extension format as described
2559             --  above is used to hold additional general fields and flags
2560             --  as follows:
2561
2562             --    Field6-11      Holds Field13-Field18
2563             --    Field12        Holds Flag73-Flag96 and Convention
2564
2565             --  In the fourth component, the extension format as described
2566             --  above is used to hold additional general fields and flags
2567             --  as follows:
2568
2569             --    Field6-10      Holds Field19-Field23
2570             --    Field11        Holds Flag152-Flag167 (16 bits unused)
2571             --    Field12        Holds Flag97-Flag128
2572
2573          end case;
2574       end record;
2575
2576       pragma Pack (Node_Record);
2577       for Node_Record'Size use 8*32;
2578       for Node_Record'Alignment use 4;
2579
2580       --  The following defines the extendible array used for the nodes table
2581       --  Nodes with extensions use two consecutive entries in the array
2582
2583       package Nodes is new Table.Table (
2584         Table_Component_Type => Node_Record,
2585         Table_Index_Type     => Node_Id,
2586         Table_Low_Bound      => First_Node_Id,
2587         Table_Initial        => Alloc.Nodes_Initial,
2588         Table_Increment      => Alloc.Nodes_Increment,
2589         Table_Name           => "Nodes");
2590
2591    end Atree_Private_Part;
2592
2593 end Atree;