OSDN Git Service

2007-04-20 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / atree.ads
index e7e2358..2902aea 100644 (file)
@@ -6,8 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                                                                          --
---          Copyright (C) 1992-2001, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -17,8 +16,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- As a special exception,  if other files  instantiate  generics from this --
 -- unit, or you link  this unit with other files  to produce an executable, --
@@ -35,6 +34,7 @@
 with Alloc;
 with Sinfo;  use Sinfo;
 with Einfo;  use Einfo;
+with Namet;  use Namet;
 with Types;  use Types;
 with Snames; use Snames;
 with System; use System;
@@ -50,7 +50,7 @@ package Atree is
 --  this tree. There is no separate symbol table structure.
 
 --  WARNING: There is a C version of this package. Any changes to this
---  source file must be properly reflected in the C header file tree.h
+--  source file must be properly reflected in the C header file atree.h
 
 --  Package Atree defines the basic structure of the tree and its nodes and
 --  provides the basic abstract interface for manipulating the tree. Two
@@ -60,7 +60,7 @@ package Atree is
 --  by the parser. The package Entity_Info defines the semantic information
 --  which is added to the tree nodes that represent declared entities (i.e.
 --  the information which might typically be described in a separate symbol
---  table structure.
+--  table structure).
 
 --  The front end of the compiler first parses the program and generates a
 --  tree that is simply a syntactic representation of the program in abstract
@@ -76,121 +76,131 @@ package Atree is
    --  a node contains a number of fields, much as though the nodes were
    --  defined as a record type. The fields in a node are as follows:
 
-   --   Nkind            Indicates the kind of the node. This field is present
-   --                    in all nodes. The type is Node_Kind, which is declared
-   --                    in the package Sinfo.
+   --   Nkind         Indicates the kind of the node. This field is present
+   --                 in all nodes. The type is Node_Kind, which is declared
+   --                 in the package Sinfo.
 
-   --   Sloc             Location (Source_Ptr) of the corresponding token
-   --                    in the Source buffer. The individual node definitions
-   --                    show which token is referenced by this pointer.
+   --   Sloc          Location (Source_Ptr) of the corresponding token
+   --                 in the Source buffer. The individual node definitions
+   --                 show which token is referenced by this pointer.
 
-   --   In_List          A flag used to indicate if the node is a member
-   --                    of a node list.
+   --   In_List       A flag used to indicate if the node is a member
+   --                 of a node list.
 
-   --   Rewrite_Sub      A flag set if the node has been rewritten using
-   --                    the Rewrite procedure. The original value of the
-   --                    node is retrievable with Original_Node.
+   --   Rewrite_Sub   A flag set if the node has been rewritten using
+   --                 the Rewrite procedure. The original value of the
+   --                 node is retrievable with Original_Node.
 
-   --   Rewrite_Ins      A flag set if a node is marked as a rewrite inserted
-   --                    node as a result of a call to Mark_Rewrite_Insertion.
+   --   Rewrite_Ins   A flag set if a node is marked as a rewrite inserted
+   --                 node as a result of a call to Mark_Rewrite_Insertion.
 
-   --   Paren_Count      A 2-bit count used on expression nodes to indicate
-   --                    the level of parentheses. Up to 3 levels can be
-   --                    accomodated. Anything more than 3 levels is treated
-   --                    as 3 levels (conformance tests that complain about
-   --                    this are hereby deemed pathological!) Set to zero
-   --                    for non-subexpression nodes.
+   --   Paren_Count   A 2-bit count used on expression nodes to indicate
+   --                 the level of parentheses. Up to 3 levels can be
+   --                 accomodated. Anything more than 3 levels is treated
+   --                 as 3 levels (conformance tests that complain about
+   --                 this are hereby deemed pathological!). Set to zero
+   --                 for non-subexpression nodes.
 
    --   Comes_From_Source
-   --                    This flag is present in all nodes. It is set if the
-   --                    node is built by the scanner or parser, and clear if
-   --                    the node is built by the analyzer or expander. It
-   --                    indicates that the node corresponds to a construct
-   --                    that appears in the original source program.
-
-   --   Analyzed         This flag is present in all nodes. It is set when
-   --                    a node is analyzed, and is used to avoid analyzing
-   --                    the same node twice. Analysis includes expansion if
-   --                    expansion is active, so in this case if the flag is
-   --                    set it means the node has been analyzed and expanded.
-
-   --   Error_Posted     This flag is present in all nodes. It is set when
-   --                    an error message is posted which is associated with
-   --                    the flagged node. This is used to avoid posting more
-   --                    than one message on the same node.
+   --                 This flag is present in all nodes. It is set if the
+   --                 node is built by the scanner or parser, and clear if
+   --                 the node is built by the analyzer or expander. It
+   --                 indicates that the node corresponds to a construct
+   --                 that appears in the original source program.
+
+   --   Analyzed      This flag is present in all nodes. It is set when
+   --                 a node is analyzed, and is used to avoid analyzing
+   --                 the same node twice. Analysis includes expansion if
+   --                 expansion is active, so in this case if the flag is
+   --                 set it means the node has been analyzed and expanded.
+
+   --   Error_Posted  This flag is present in all nodes. It is set when
+   --                 an error message is posted which is associated with
+   --                 the flagged node. This is used to avoid posting more
+   --                 than one message on the same node.
 
    --   Field1
    --   Field2
    --   Field3
    --   Field4
-   --   Field5           Five fields holding Union_Id values
-
-   --   Char_CodeN       Synonym for FieldN typed as Char_Code
-   --   ElistN           Synonym for FieldN typed as Elist_Id
-   --   ListN            Synonym for FieldN typed as List_Id
-   --   NameN            Synonym for FieldN typed as Name_Id
-   --   NodeN            Synonym for FieldN typed as Node_Id
-   --   StrN             Synonym for FieldN typed as String_Id
-   --   UintN            Synonym for FieldN typed as Uint (Empty = Uint_0)
-   --   UrealN           Synonym for FieldN typed as Ureal
-
-   --   Note: the actual usage of FieldN (i.e. whether it contains a Char_Code,
-   --   Elist_Id, List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal), depends
-   --   on the value in Nkind. Generally the access to this field is always via
-   --   the functional interface, so the field names Char_CodeN, ElistN, ListN,
-   --   NameN, NodeN, StrN, UintN and UrealN are used only in the bodies of the
-   --   access functions (i.e. in the bodies of Sinfo and Einfo). These access
-   --   functions contain debugging code that checks that the use is consistent
-   --   with Nkind and Ekind values.
+   --   Field5        Five fields holding Union_Id values
+
+   --   ElistN        Synonym for FieldN typed as Elist_Id (Empty = No_Elist)
+   --   ListN         Synonym for FieldN typed as List_Id
+   --   NameN         Synonym for FieldN typed as Name_Id
+   --   NodeN         Synonym for FieldN typed as Node_Id
+   --   StrN          Synonym for FieldN typed as String_Id
+   --   UintN         Synonym for FieldN typed as Uint (Empty = Uint_0)
+   --   UrealN        Synonym for FieldN typed as Ureal
+
+   --   Note: in the case of ElistN and UintN fields, it is common that we
+   --   end up with a value of Union_Id'(0) as the default value. This value
+   --   is meaningless as a Uint or Elist_Id value. We have two choices here.
+   --   We could require that all Uint and Elist fields be initialized to an
+   --   appropriate value, but that's error prone, since it would be easy to
+   --   miss an initialization. So instead we have the retrieval functions
+   --   generate an appropriate default value (Uint_0 or No_Elist). Probably
+   --   it would be cleaner to generate No_Uint in the Uint case but we got
+   --   stuck with representing an "unset" size value as zero early on, and
+   --   it will take a bit of fiddling to change that ???
+
+   --   Note: the actual usage of FieldN (i.e. whether it contains a Elist_Id,
+   --   List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal) depends on the
+   --   value in Nkind. Generally the access to this field is always via the
+   --   functional interface, so the field names ElistN, ListN, NameN, NodeN,
+   --   StrN, UintN and UrealN are used only in the bodies of the access
+   --   functions (i.e. in the bodies of Sinfo and Einfo). These access
+   --   functions contain debugging code that checks that the use is
+   --   consistent with Nkind and Ekind values.
 
    --   However, in specialized circumstances (examples are the circuit in
    --   generic instantiation to copy trees, and in the tree dump routine),
    --   it is useful to be able to do untyped traversals, and an internal
    --   package in Atree allows for direct untyped accesses in such cases.
 
-   --   Flag4            Fifteen Boolean flags (use depends on Nkind and
-   --   Flag5            Ekind, as described for Fieldn). Again the access
-   --   Flag6            is usually via subprograms in Sinfo and Einfo which
-   --   Flag7            provide high-level synonyms for these flags, and
-   --   Flag8            contain debugging code that checks that the values
-   --   Flag9            in Nkind and Ekind are appropriate for the access.
+   --   Flag4         Fifteen Boolean flags (use depends on Nkind and
+   --   Flag5         Ekind, as described for FieldN). Again the access
+   --   Flag6         is usually via subprograms in Sinfo and Einfo which
+   --   Flag7         provide high-level synonyms for these flags, and
+   --   Flag8         contain debugging code that checks that the values
+   --   Flag9         in Nkind and Ekind are appropriate for the access.
    --   Flag10
-   --   Flag11           Note that Flag1-3 are missing from this list. The
-   --   Flag12           first three flag positions are reserved for the
-   --   Flag13           standard flags (Comes_From_Source, Error_Posted,
-   --   Flag14           and Analyzed)
+   --   Flag11        Note that Flag1-3 are missing from this list. The
+   --   Flag12        first three flag positions are reserved for the
+   --   Flag13        standard flags (Comes_From_Source, Error_Posted,
+   --   Flag14        and Analyzed)
    --   Flag15
    --   Flag16
    --   Flag17
    --   Flag18
 
-   --   Link             For a node, points to the Parent. For a list, points
-   --                    to the list header. Note that in the latter case, a
-   --                    client cannot modify the link field. This field is
-   --                    private to the Atree package (but is also modified
-   --                    by the Nlists package).
+   --   Link          For a node, points to the Parent. For a list, points
+   --                 to the list header. Note that in the latter case, a
+   --                 client cannot modify the link field. This field is
+   --                 private to the Atree package (but is also modified
+   --                 by the Nlists package).
 
    --  The following additional fields are present in extended nodes used
    --  for entities (Nkind in N_Entity).
 
-   --   Ekind            Entity type. This field indicates the type of the
-   --                    entity, it is of type Entity_Kind which is defined
-   --                    in package Einfo.
+   --   Ekind         Entity type. This field indicates the type of the
+   --                 entity, it is of type Entity_Kind which is defined
+   --                 in package Einfo.
 
-   --   Flag19           133 additional flags
+   --   Flag19        229 additional flags
    --   ...
-   --   Flag151
+   --   Flag247
 
-   --   Convention       Entity convention (Convention_Id value)
+   --   Convention    Entity convention (Convention_Id value)
 
-   --   Field6           Additional Union_Id value stored in tree
+   --   Field6        Additional Union_Id value stored in tree
 
-   --   Node6            Synonym for Field6 typed as Node_Id
-   --   Elist6           Synonym for Field6 typed as Elist_Id
-   --   Uint6            Synonym for Field6 typed as Uint (Empty = Uint_0)
+   --   Node6         Synonym for Field6 typed as Node_Id
+   --   Elist6        Synonym for Field6 typed as Elist_Id (Empty = No_Elist)
+   --   Uint6         Synonym for Field6 typed as Uint (Empty = Uint_0)
 
-   --   Similar definitions for Field7 to Field23 (and Node7-Node23,
-   --   Elist7-Elist23, Uint7-Uint23, Ureal7-Ureal23). Note that not all
+   --   Similar definitions for Field7 to Field28 (and Node7-Node28,
+   --   Elist7-Elist28, Uint7-Uint28, Ureal7-Ureal28). Note that not all
    --   these functions are defined, only the ones that are actually used.
 
    type Paren_Count_Type is mod 4;
@@ -243,9 +253,9 @@ package Atree is
    --  avoid posting related cascaded error messages, and to propagate
    --  the error node if necessary.
 
-   -----------------------
+   ------------------------
    -- Current_Error_Node --
-   -----------------------
+   ------------------------
 
    --  The current error node is a global location indicating the current
    --  node that is being processed for the purposes of placing a compiler
@@ -253,7 +263,15 @@ package Atree is
    --  just a reasonably accurate best guess. It is used to output the
    --  source location in the abort message by Comperr, and also to
    --  implement the d3 debugging flag. This is also used by Rtsfind
-   --  to generate error messages for No_Run_Time mode.
+   --  to generate error messages for high integrity mode.
+
+   --  There are two ways this gets set. During parsing, when new source
+   --  nodes are being constructed by calls to New_Node and New_Entity,
+   --  either one of these calls sets Current_Error_Node to the newly
+   --  created node. During semantic analysis, this mechanism is not
+   --  used, and instead Current_Error_Node is set by the subprograms in
+   --  Debug_A that mark the start and end of analysis/expansion of a
+   --  node in the tree.
 
    Current_Error_Node : Node_Id;
    --  Node to place error messages
@@ -285,8 +303,8 @@ package Atree is
    -------------------------------------
 
    --  A subpackage Atree.Unchecked_Access provides routines for reading and
-   --  writing the fields defined above (Field1-17, Node1-17, Flag1-88 etc).
-   --  These unchecked access routines can be used for untyped traversals. In
+   --  writing the fields defined above (Field1-27, Node1-27, Flag1-247 etc).
+   --  These unchecked access routines can be used for untyped traversals.
    --  In addition they are used in the implementations of the Sinfo and
    --  Einfo packages. These packages both provide logical synonyms for
    --  the generic fields, together with an appropriate set of access routines.
@@ -304,7 +322,7 @@ package Atree is
    --  which the parser could not parse correctly, and adding additional
    --  semantic information (e.g. making constraint checks explicit). The
    --  following subprograms are used for constructing the tree in the first
-   --  place, and then for subsequent modifications as required
+   --  place, and then for subsequent modifications as required.
 
    procedure Initialize;
    --  Called at the start of compilation to initialize the allocation of
@@ -313,42 +331,51 @@ package Atree is
    --  Tree_Read is used.
 
    procedure Lock;
-   --  Called before the backend is invoked to lock the nodes table
+   --  Called before the back end is invoked to lock the nodes table
+   --  Also called after Unlock to relock???
+
+   procedure Unlock;
+   --  Unlocks nodes table, in cases where the back end needs to modify it
 
    procedure Tree_Read;
-   --  Initializes internal tables from current tree file using Tree_Read.
-   --  Note that Initialize should not be called if Tree_Read is used.
-   --  Tree_Read includes all necessary initialization.
+   --  Initializes internal tables from current tree file using the relevant
+   --  Table.Tree_Read routines. Note that Initialize should not be called if
+   --  Tree_Read is used. Tree_Read includes all necessary initialization.
 
    procedure Tree_Write;
-   --  Writes out internal tables to current tree file using Tree_Write
+   --  Writes out internal tables to current tree file using the relevant
+   --  Table.Tree_Write routines.
 
    function New_Node
      (New_Node_Kind : Node_Kind;
-      New_Sloc      : Source_Ptr)
-      return          Node_Id;
+      New_Sloc      : Source_Ptr) return Node_Id;
    --  Allocates a completely new node with the given node type and source
    --  location values. All other fields are set to their standard defaults:
    --
-   --    Empty for all Fieldn fields
-   --    False for all Flagn fields
+   --    Empty for all FieldN fields
+   --    False for all FlagN fields
    --
    --  The usual approach is to build a new node using this function and
    --  then, using the value returned, use the Set_xxx functions to set
    --  fields of the node as required. New_Node can only be used for
    --  non-entity nodes, i.e. it never generates an extended node.
+   --
+   --  If we are currently parsing, as indicated by a previous call to
+   --  Set_Comes_From_Source_Default (True), then this call also resets
+   --  the value of Current_Error_Node.
 
    function New_Entity
      (New_Node_Kind : Node_Kind;
-      New_Sloc      : Source_Ptr)
-      return          Entity_Id;
+      New_Sloc      : Source_Ptr) return Entity_Id;
    --  Similar to New_Node, except that it is used only for entity nodes
    --  and returns an extended node.
 
    procedure Set_Comes_From_Source_Default (Default : Boolean);
    --  Sets value of Comes_From_Source flag to be used in all subsequent
    --  New_Node and New_Entity calls until another call to this procedure
-   --  changes the default.
+   --  changes the default. This value is set True during parsing and
+   --  False during semantic analysis. This is also used to determine
+   --  if New_Node and New_Entity should set Current_Error_Node.
 
    function Get_Comes_From_Source_Default return Boolean;
    pragma Inline (Get_Comes_From_Source_Default);
@@ -412,10 +439,9 @@ package Atree is
 
    function New_Copy_Tree
      (Source    : Node_Id;
-      Map       : Elist_Id := No_Elist;
+      Map       : Elist_Id   := No_Elist;
       New_Sloc  : Source_Ptr := No_Location;
-      New_Scope : Entity_Id := Empty)
-      return      Node_Id;
+      New_Scope : Entity_Id  := Empty) return Node_Id;
    --  Given a node that is the root of a subtree, Copy_Tree copies the entire
    --  syntactic subtree, including recursively any descendents whose parent
    --  field references a copied node (descendents not linked to a copied node
@@ -485,7 +511,7 @@ package Atree is
    function Extend_Node (Node : Node_Id) return Entity_Id;
    --  This function returns a copy of its input node with an extension
    --  added. The fields of the extension are set to Empty. Due to the way
-   --  extensions are handled (as two consecutive array elements), it may
+   --  extensions are handled (as four consecutive array elements), it may
    --  be necessary to reallocate the node, so that the returned value is
    --  not the same as the input value, but where possible the returned
    --  value will be the same as the input value (i.e. the extension will
@@ -827,6 +853,21 @@ package Atree is
       function Field23 (N : Node_Id) return Union_Id;
       pragma Inline (Field23);
 
+      function Field24 (N : Node_Id) return Union_Id;
+      pragma Inline (Field24);
+
+      function Field25 (N : Node_Id) return Union_Id;
+      pragma Inline (Field25);
+
+      function Field26 (N : Node_Id) return Union_Id;
+      pragma Inline (Field26);
+
+      function Field27 (N : Node_Id) return Union_Id;
+      pragma Inline (Field27);
+
+      function Field28 (N : Node_Id) return Union_Id;
+      pragma Inline (Field28);
+
       function Node1 (N : Node_Id) return Node_Id;
       pragma Inline (Node1);
 
@@ -896,6 +937,21 @@ package Atree is
       function Node23 (N : Node_Id) return Node_Id;
       pragma Inline (Node23);
 
+      function Node24 (N : Node_Id) return Node_Id;
+      pragma Inline (Node24);
+
+      function Node25 (N : Node_Id) return Node_Id;
+      pragma Inline (Node25);
+
+      function Node26 (N : Node_Id) return Node_Id;
+      pragma Inline (Node26);
+
+      function Node27 (N : Node_Id) return Node_Id;
+      pragma Inline (Node27);
+
+      function Node28 (N : Node_Id) return Node_Id;
+      pragma Inline (Node28);
+
       function List1 (N : Node_Id) return List_Id;
       pragma Inline (List1);
 
@@ -917,6 +973,9 @@ package Atree is
       function List14 (N : Node_Id) return List_Id;
       pragma Inline (List14);
 
+      function Elist1 (N : Node_Id) return Elist_Id;
+      pragma Inline (Elist1);
+
       function Elist2 (N : Node_Id) return Elist_Id;
       pragma Inline (Elist2);
 
@@ -947,15 +1006,15 @@ package Atree is
       function Elist23 (N : Node_Id) return Elist_Id;
       pragma Inline (Elist23);
 
+      function Elist25 (N : Node_Id) return Elist_Id;
+      pragma Inline (Elist25);
+
       function Name1 (N : Node_Id) return Name_Id;
       pragma Inline (Name1);
 
       function Name2 (N : Node_Id) return Name_Id;
       pragma Inline (Name2);
 
-      function Char_Code2 (N : Node_Id) return Char_Code;
-      pragma Inline (Char_Code2);
-
       function Str3 (N : Node_Id) return String_Id;
       pragma Inline (Str3);
 
@@ -964,6 +1023,9 @@ package Atree is
       --  Uint_0 is returned. This avoids the rather tricky requirement
       --  of initializing all Uint fields in nodes and entities.
 
+      function Uint2 (N : Node_Id) return Uint;
+      pragma Inline (Uint2);
+
       function Uint3 (N : Node_Id) return Uint;
       pragma Inline (Uint3);
 
@@ -1460,25 +1522,25 @@ package Atree is
       pragma Inline (Flag151);
 
       function Flag152 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag152);
 
       function Flag153 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag153);
 
       function Flag154 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag154);
 
       function Flag155 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag155);
 
       function Flag156 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag156);
 
       function Flag157 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag157);
 
       function Flag158 (N : Node_Id) return Boolean;
-      pragma Inline (Flag151);
+      pragma Inline (Flag158);
 
       function Flag159 (N : Node_Id) return Boolean;
       pragma Inline (Flag159);
@@ -1555,6 +1617,147 @@ package Atree is
       function Flag183 (N : Node_Id) return Boolean;
       pragma Inline (Flag183);
 
+      function Flag184 (N : Node_Id) return Boolean;
+      pragma Inline (Flag184);
+
+      function Flag185 (N : Node_Id) return Boolean;
+      pragma Inline (Flag185);
+
+      function Flag186 (N : Node_Id) return Boolean;
+      pragma Inline (Flag186);
+
+      function Flag187 (N : Node_Id) return Boolean;
+      pragma Inline (Flag187);
+
+      function Flag188 (N : Node_Id) return Boolean;
+      pragma Inline (Flag188);
+
+      function Flag189 (N : Node_Id) return Boolean;
+      pragma Inline (Flag189);
+
+      function Flag190 (N : Node_Id) return Boolean;
+      pragma Inline (Flag190);
+
+      function Flag191 (N : Node_Id) return Boolean;
+      pragma Inline (Flag191);
+
+      function Flag192 (N : Node_Id) return Boolean;
+      pragma Inline (Flag192);
+
+      function Flag193 (N : Node_Id) return Boolean;
+      pragma Inline (Flag193);
+
+      function Flag194 (N : Node_Id) return Boolean;
+      pragma Inline (Flag194);
+
+      function Flag195 (N : Node_Id) return Boolean;
+      pragma Inline (Flag195);
+
+      function Flag196 (N : Node_Id) return Boolean;
+      pragma Inline (Flag196);
+
+      function Flag197 (N : Node_Id) return Boolean;
+      pragma Inline (Flag197);
+
+      function Flag198 (N : Node_Id) return Boolean;
+      pragma Inline (Flag198);
+
+      function Flag199 (N : Node_Id) return Boolean;
+      pragma Inline (Flag199);
+
+      function Flag200 (N : Node_Id) return Boolean;
+      pragma Inline (Flag200);
+
+      function Flag201 (N : Node_Id) return Boolean;
+      pragma Inline (Flag201);
+
+      function Flag202 (N : Node_Id) return Boolean;
+      pragma Inline (Flag202);
+
+      function Flag203 (N : Node_Id) return Boolean;
+      pragma Inline (Flag203);
+
+      function Flag204 (N : Node_Id) return Boolean;
+      pragma Inline (Flag204);
+
+      function Flag205 (N : Node_Id) return Boolean;
+      pragma Inline (Flag205);
+
+      function Flag206 (N : Node_Id) return Boolean;
+      pragma Inline (Flag206);
+
+      function Flag207 (N : Node_Id) return Boolean;
+      pragma Inline (Flag207);
+
+      function Flag208 (N : Node_Id) return Boolean;
+      pragma Inline (Flag208);
+
+      function Flag209 (N : Node_Id) return Boolean;
+      pragma Inline (Flag209);
+
+      function Flag210 (N : Node_Id) return Boolean;
+      pragma Inline (Flag210);
+
+      function Flag211 (N : Node_Id) return Boolean;
+      pragma Inline (Flag211);
+
+      function Flag212 (N : Node_Id) return Boolean;
+      pragma Inline (Flag212);
+
+      function Flag213 (N : Node_Id) return Boolean;
+      pragma Inline (Flag213);
+
+      function Flag214 (N : Node_Id) return Boolean;
+      pragma Inline (Flag214);
+
+      function Flag215 (N : Node_Id) return Boolean;
+      pragma Inline (Flag215);
+
+      function Flag216 (N : Node_Id) return Boolean;
+      pragma Inline (Flag216);
+
+      function Flag217 (N : Node_Id) return Boolean;
+      pragma Inline (Flag217);
+
+      function Flag218 (N : Node_Id) return Boolean;
+      pragma Inline (Flag218);
+
+      function Flag219 (N : Node_Id) return Boolean;
+      pragma Inline (Flag219);
+
+      function Flag220 (N : Node_Id) return Boolean;
+      pragma Inline (Flag220);
+
+      function Flag221 (N : Node_Id) return Boolean;
+      pragma Inline (Flag221);
+
+      function Flag222 (N : Node_Id) return Boolean;
+      pragma Inline (Flag222);
+
+      function Flag223 (N : Node_Id) return Boolean;
+      pragma Inline (Flag223);
+
+      function Flag224 (N : Node_Id) return Boolean;
+      pragma Inline (Flag224);
+
+      function Flag225 (N : Node_Id) return Boolean;
+      pragma Inline (Flag225);
+
+      function Flag226 (N : Node_Id) return Boolean;
+      pragma Inline (Flag226);
+
+      function Flag227 (N : Node_Id) return Boolean;
+      pragma Inline (Flag227);
+
+      function Flag228 (N : Node_Id) return Boolean;
+      pragma Inline (Flag228);
+
+      function Flag229 (N : Node_Id) return Boolean;
+      pragma Inline (Flag229);
+
+      function Flag230 (N : Node_Id) return Boolean;
+      pragma Inline (Flag230);
+
       --  Procedures to set value of indicated field
 
       procedure Set_Nkind (N : Node_Id; Val : Node_Kind);
@@ -1629,6 +1832,21 @@ package Atree is
       procedure Set_Field23 (N : Node_Id; Val : Union_Id);
       pragma Inline (Set_Field23);
 
+      procedure Set_Field24 (N : Node_Id; Val : Union_Id);
+      pragma Inline (Set_Field24);
+
+      procedure Set_Field25 (N : Node_Id; Val : Union_Id);
+      pragma Inline (Set_Field25);
+
+      procedure Set_Field26 (N : Node_Id; Val : Union_Id);
+      pragma Inline (Set_Field26);
+
+      procedure Set_Field27 (N : Node_Id; Val : Union_Id);
+      pragma Inline (Set_Field27);
+
+      procedure Set_Field28 (N : Node_Id; Val : Union_Id);
+      pragma Inline (Set_Field28);
+
       procedure Set_Node1 (N : Node_Id; Val : Node_Id);
       pragma Inline (Set_Node1);
 
@@ -1698,6 +1916,21 @@ package Atree is
       procedure Set_Node23 (N : Node_Id; Val : Node_Id);
       pragma Inline (Set_Node23);
 
+      procedure Set_Node24 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node24);
+
+      procedure Set_Node25 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node25);
+
+      procedure Set_Node26 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node26);
+
+      procedure Set_Node27 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node27);
+
+      procedure Set_Node28 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node28);
+
       procedure Set_List1 (N : Node_Id; Val : List_Id);
       pragma Inline (Set_List1);
 
@@ -1719,6 +1952,9 @@ package Atree is
       procedure Set_List14 (N : Node_Id; Val : List_Id);
       pragma Inline (Set_List14);
 
+      procedure Set_Elist1 (N : Node_Id; Val : Elist_Id);
+      pragma Inline (Set_Elist1);
+
       procedure Set_Elist2 (N : Node_Id; Val : Elist_Id);
       pragma Inline (Set_Elist2);
 
@@ -1749,18 +1985,21 @@ package Atree is
       procedure Set_Elist23 (N : Node_Id; Val : Elist_Id);
       pragma Inline (Set_Elist23);
 
+      procedure Set_Elist25 (N : Node_Id; Val : Elist_Id);
+      pragma Inline (Set_Elist25);
+
       procedure Set_Name1 (N : Node_Id; Val : Name_Id);
       pragma Inline (Set_Name1);
 
       procedure Set_Name2 (N : Node_Id; Val : Name_Id);
       pragma Inline (Set_Name2);
 
-      procedure Set_Char_Code2 (N : Node_Id; Val : Char_Code);
-      pragma Inline (Set_Char_Code2);
-
       procedure Set_Str3 (N : Node_Id; Val : String_Id);
       pragma Inline (Set_Str3);
 
+      procedure Set_Uint2 (N : Node_Id; Val : Uint);
+      pragma Inline (Set_Uint2);
+
       procedure Set_Uint3 (N : Node_Id; Val : Uint);
       pragma Inline (Set_Uint3);
 
@@ -2352,6 +2591,147 @@ package Atree is
       procedure Set_Flag183 (N : Node_Id; Val : Boolean);
       pragma Inline (Set_Flag183);
 
+      procedure Set_Flag184 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag184);
+
+      procedure Set_Flag185 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag185);
+
+      procedure Set_Flag186 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag186);
+
+      procedure Set_Flag187 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag187);
+
+      procedure Set_Flag188 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag188);
+
+      procedure Set_Flag189 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag189);
+
+      procedure Set_Flag190 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag190);
+
+      procedure Set_Flag191 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag191);
+
+      procedure Set_Flag192 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag192);
+
+      procedure Set_Flag193 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag193);
+
+      procedure Set_Flag194 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag194);
+
+      procedure Set_Flag195 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag195);
+
+      procedure Set_Flag196 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag196);
+
+      procedure Set_Flag197 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag197);
+
+      procedure Set_Flag198 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag198);
+
+      procedure Set_Flag199 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag199);
+
+      procedure Set_Flag200 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag200);
+
+      procedure Set_Flag201 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag201);
+
+      procedure Set_Flag202 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag202);
+
+      procedure Set_Flag203 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag203);
+
+      procedure Set_Flag204 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag204);
+
+      procedure Set_Flag205 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag205);
+
+      procedure Set_Flag206 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag206);
+
+      procedure Set_Flag207 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag207);
+
+      procedure Set_Flag208 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag208);
+
+      procedure Set_Flag209 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag209);
+
+      procedure Set_Flag210 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag210);
+
+      procedure Set_Flag211 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag211);
+
+      procedure Set_Flag212 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag212);
+
+      procedure Set_Flag213 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag213);
+
+      procedure Set_Flag214 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag214);
+
+      procedure Set_Flag215 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag215);
+
+      procedure Set_Flag216 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag216);
+
+      procedure Set_Flag217 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag217);
+
+      procedure Set_Flag218 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag218);
+
+      procedure Set_Flag219 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag219);
+
+      procedure Set_Flag220 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag220);
+
+      procedure Set_Flag221 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag221);
+
+      procedure Set_Flag222 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag222);
+
+      procedure Set_Flag223 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag223);
+
+      procedure Set_Flag224 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag224);
+
+      procedure Set_Flag225 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag225);
+
+      procedure Set_Flag226 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag226);
+
+      procedure Set_Flag227 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag227);
+
+      procedure Set_Flag228 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag228);
+
+      procedure Set_Flag229 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag229);
+
+      procedure Set_Flag230 (N : Node_Id; Val : Boolean);
+      pragma Inline (Set_Flag230);
+
       --  The following versions of Set_Noden also set the parent
       --  pointer of the referenced node if it is non_Empty
 
@@ -2408,12 +2788,12 @@ package Atree is
       -------------------------
 
       --  The nodes of the tree are stored in a table (i.e. an array). In the
-      --  case of extended nodes four consecutive components in the array are
+      --  case of extended nodes five consecutive components in the array are
       --  used. There are thus two formats for array components. One is used
       --  for non-extended nodes, and for the first component of extended
-      --  nodes. The other is used for the extension parts (second, third and
-      --  fourth components) of an extended node. A variant record structure
-      --  is used to distinguish the two formats.
+      --  nodes. The other is used for the extension parts (second, third,
+      --  fourth and fifth components) of an extended node. A variant record
+      --  structure is used to distinguish the two formats.
 
       type Node_Record (Is_Extension : Boolean := False) is record
 
@@ -2469,7 +2849,8 @@ package Atree is
          --  The eighteen flags for a normal node
 
          --  The above fields are used as follows in components 2-4 of
-         --  an extended node entry.
+         --  an extended node entry. These fields are not currently
+         --  used in component 5 (where we still have lots of room!)
 
          --    In_List            used as  Flag19, Flag40, Flag129
          --    Unused_1           used as  Flag20, Flag41, Flag130
@@ -2527,13 +2908,14 @@ package Atree is
                Field4 : Union_Id;
                Field5 : Union_Id;
                --  Five general use fields, which can contain Node_Id, List_Id,
-               --  Elist_Id, String_Id, Name_Id, or Char_Code values depending
-               --  on the values in Nkind and (for extended nodes), in Ekind.
-               --  See packages Sinfo and Einfo for details of their use.
+               --  Elist_Id, String_Id, or Name_Id values depending on the
+               --  values in Nkind and (for extended nodes), in Ekind. See
+               --  packages Sinfo and Einfo for details of their use.
 
             --  Extension (second component) of extended node
 
             when True =>
+
                Field6  : Union_Id;
                Field7  : Union_Id;
                Field8  : Union_Id;
@@ -2557,9 +2939,17 @@ package Atree is
             --  as follows:
 
             --    Field6-10      Holds Field19-Field23
-            --    Field11        Holds Flag152-Flag167 (16 bits unused)
+            --    Field11        Holds Flag152-Flag183
             --    Field12        Holds Flag97-Flag128
 
+            --  In the fifth component, the extension format as described
+            --  above is used to hold additional general fields and flags
+            --  as follows:
+
+            --    Field6-10      Holds Field24-Field28
+            --    Field11        Holds Flag184-Flag215
+            --    Field12        Holds Flag216-Flag230
+
          end case;
       end record;
 
@@ -2567,12 +2957,12 @@ package Atree is
       for Node_Record'Size use 8*32;
       for Node_Record'Alignment use 4;
 
-      --  The following defines the extendible array used for the nodes table
-      --  Nodes with extensions use two consecutive entries in the array
+      --  The following defines the extendable array used for the nodes table
+      --  Nodes with extensions use five consecutive entries in the array
 
       package Nodes is new Table.Table (
         Table_Component_Type => Node_Record,
-        Table_Index_Type     => Node_Id,
+        Table_Index_Type     => Node_Id'Base,
         Table_Low_Bound      => First_Node_Id,
         Table_Initial        => Alloc.Nodes_Initial,
         Table_Increment      => Alloc.Nodes_Increment,