1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
11 * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
13 * GNAT is free software; you can redistribute it and/or modify it under *
14 * terms of the GNU General Public License as published by the Free Soft- *
15 * ware Foundation; either version 2, or (at your option) any later ver- *
16 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
17 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
19 * for more details. You should have received a copy of the GNU General *
20 * Public License distributed with GNAT; see file COPYING. If not, write *
21 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
22 * MA 02111-1307, USA. *
24 * GNAT was originally developed by the GNAT team at New York University. *
25 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
27 ****************************************************************************/
29 /* This is the C header corresponding to the Ada package specification for
30 Elists. It also contains the implementations of inlined functions from the
31 package body for Elists. It was generated manually from elists.ads and
32 elists.adb and must be kept synchronized with changes in these files.
34 Note that only routines for reading the tree are included, since the
35 tree transformer is not supposed to modify the tree in any way. */
37 /* The following are the structures used to hold element lists */
51 /* The element list headers and element descriptors themselves are stored in
52 two arrays. The pointers to these arrays are passed as a parameter to the
53 tree transformer procedure and stored in the global variables Elists_Ptr
54 and Elmts_Ptr after adjusting them by subtracting Elist_First_Entry and
55 Elmt_First_Entry, so that Elist_Id and Elmt_Id values can be used as
56 subscripts into these arrays */
58 extern struct Elist_Header *Elists_Ptr;
59 extern struct Elmt_Item *Elmts_Ptr;
61 /* Element List Access Functions: */
63 static Node_Id Node PARAMS ((Elmt_Id));
64 static Elmt_Id First_Elmt PARAMS ((Elist_Id));
65 static Elmt_Id Last_Elmt PARAMS ((Elist_Id));
66 static Elmt_Id Next_Elmt PARAMS ((Elmt_Id));
67 static Boolean Is_Empty_Elmt_List PARAMS ((Elist_Id));
73 return Elmts_Ptr [Elmt].node;
80 return Elists_Ptr [List].first;
87 return Elists_Ptr [List].last;
94 Int N = Elmts_Ptr [Node].next;
96 if (IN (N, Elist_Range))
103 Is_Empty_Elmt_List (Id)
106 return Elists_Ptr [Id].first == No_Elmt;