OSDN Git Service

* 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads,
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_strm.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             E X P _ S T R M                              --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                            $Revision: 1.7 $
10 --                                                                          --
11 --          Copyright (C) 1992-1999 Free Software Foundation, Inc.          --
12 --                                                                          --
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.                                                      --
23 --                                                                          --
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). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28
29 --  Routines to build stream subprograms for composite types
30
31 with Types; use Types;
32
33 package Exp_Strm is
34
35    function Build_Elementary_Input_Call (N : Node_Id) return Node_Id;
36    --  Build call to Read attribute function for elementary type. Also used
37    --  for Input attributes for elementary types with an appropriate extra
38    --  assignment statement. N is the attribute reference node.
39
40    function Build_Elementary_Write_Call (N : Node_Id) return Node_Id;
41    --  Build call to Write attribute function for elementary type. Also used
42    --  for Output attributes for elementary types (since the effect of the
43    --  two attributes is identical for elementary types). N is the attribute
44    --  reference node.
45
46    function Build_Stream_Attr_Profile
47      (Loc  : Source_Ptr;
48       Typ  : Entity_Id;
49       Nam  : Name_Id)
50       return List_Id;
51    --  Builds the parameter profile for the stream attribute identified by
52    --  the given name (which is the underscore version, e.g. Name_uWrite to
53    --  identify the Write attribute). This is used for the tagged case to
54    --  build the spec for the primitive operation.
55
56    --  The following routines build procedures and functions for stream
57    --  attributes applied to composite types. For each of these routines,
58    --  Loc is used to provide the location for the constructed subprogram
59    --  declaration. Typ is the base type to which the subprogram applies
60    --  (i.e. the base type of the stream attribute prefix). The returned
61    --  results are the declaration and name (entity) of the subprogram.
62
63    procedure Build_Array_Input_Function
64      (Loc  : Source_Ptr;
65       Typ  : Entity_Id;
66       Decl : out Node_Id;
67       Fnam : out Entity_Id);
68    --  Build function for Input attribute for array type
69
70    procedure Build_Array_Output_Procedure
71      (Loc  : Source_Ptr;
72       Typ  : Entity_Id;
73       Decl : out Node_Id;
74       Pnam : out Entity_Id);
75    --  Build procedure for Output attribute for array type
76
77    procedure Build_Array_Read_Procedure
78      (Nod  : Node_Id;
79       Typ  : Entity_Id;
80       Decl : out Node_Id;
81       Pnam : out Entity_Id);
82    --  Build procedure for Read attribute for array type. Nod provides the
83    --  Sloc value for generated code.
84
85    procedure Build_Array_Write_Procedure
86      (Nod  : Node_Id;
87       Typ  : Entity_Id;
88       Decl : out Node_Id;
89       Pnam : out Entity_Id);
90    --  Build procedure for Write attribute for array type. Nod provides the
91    --  Sloc value for generated code.
92
93    procedure Build_Mutable_Record_Read_Procedure
94      (Loc  : Source_Ptr;
95       Typ  : Entity_Id;
96       Decl : out Node_Id;
97       Pnam : out Entity_Id);
98    --  Build procedure to Read a record with default discriminants.
99    --  Discriminants must be read explicitly (RM 13.13.2(9)) in the
100    --  same manner as is done for 'Input.
101
102    procedure Build_Mutable_Record_Write_Procedure
103      (Loc  : Source_Ptr;
104       Typ  : Entity_Id;
105       Decl : out Node_Id;
106       Pnam : out Entity_Id);
107    --  Build procedure to write a record with default discriminants.
108    --  Discriminants must be written explicitly (RM 13.13.2(9)) in
109    --  the same manner as is done for 'Output.
110
111    procedure Build_Record_Or_Elementary_Input_Function
112      (Loc  : Source_Ptr;
113       Typ  : Entity_Id;
114       Decl : out Node_Id;
115       Fnam : out Entity_Id);
116    --  Build function for Input attribute for record type or for an
117    --  elementary type (the latter is used only in the case where a
118    --  user defined Read routine is defined, since in other cases,
119    --  Input calls the appropriate runtime library routine directly.
120
121    procedure Build_Record_Or_Elementary_Output_Procedure
122      (Loc  : Source_Ptr;
123       Typ  : Entity_Id;
124       Decl : out Node_Id;
125       Pnam : out Entity_Id);
126    --  Build procedure for Output attribute for record type or for an
127    --  elementary type (the latter is used only in the case where a
128    --  user defined Write routine is defined, since in other cases,
129    --  Output calls the appropriate runtime library routine directly.
130
131    procedure Build_Record_Read_Procedure
132      (Loc  : Source_Ptr;
133       Typ  : Entity_Id;
134       Decl : out Node_Id;
135       Pnam : out Entity_Id);
136    --  Build procedure for Read attribute for record type
137
138    procedure Build_Record_Write_Procedure
139      (Loc  : Source_Ptr;
140       Typ  : Entity_Id;
141       Decl : out Node_Id;
142       Pnam : out Entity_Id);
143    --  Build procedure for Write attribute for record type
144
145 end Exp_Strm;