OSDN Git Service

2005-06-15 Andrew Pinski <pinskia@physics.uc.edu>
[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 --          Copyright (C) 1992-2003 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 -- GNAT was originally developed  by the GNAT team at  New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 --  Routines to build stream subprograms for composite types
28
29 with Exp_Tss; use Exp_Tss;
30 with Types;   use Types;
31
32 package Exp_Strm is
33
34    function Build_Elementary_Input_Call (N : Node_Id) return Node_Id;
35    --  Build call to Read attribute function for elementary type. Also used
36    --  for Input attributes for elementary types with an appropriate extra
37    --  assignment statement. N is the attribute reference node.
38
39    function Build_Elementary_Write_Call (N : Node_Id) return Node_Id;
40    --  Build call to Write attribute function for elementary type. Also used
41    --  for Output attributes for elementary types (since the effect of the
42    --  two attributes is identical for elementary types). N is the attribute
43    --  reference node.
44
45    function Build_Stream_Attr_Profile
46      (Loc : Source_Ptr;
47       Typ : Entity_Id;
48       Nam : TSS_Name_Type) return List_Id;
49    --  Builds the parameter profile for the stream attribute identified by
50    --  the given name. This is used for the tagged case to build the spec
51    --  for the primitive operation.
52
53    --  The following routines build procedures and functions for stream
54    --  attributes applied to composite types. For each of these routines,
55    --  Loc is used to provide the location for the constructed subprogram
56    --  declaration. Typ is the base type to which the subprogram applies
57    --  (i.e. the base type of the stream attribute prefix). The returned
58    --  results are the declaration and name (entity) of the subprogram.
59
60    procedure Build_Array_Input_Function
61      (Loc  : Source_Ptr;
62       Typ  : Entity_Id;
63       Decl : out Node_Id;
64       Fnam : out Entity_Id);
65    --  Build function for Input attribute for array type
66
67    procedure Build_Array_Output_Procedure
68      (Loc  : Source_Ptr;
69       Typ  : Entity_Id;
70       Decl : out Node_Id;
71       Pnam : out Entity_Id);
72    --  Build procedure for Output attribute for array type
73
74    procedure Build_Array_Read_Procedure
75      (Nod  : Node_Id;
76       Typ  : Entity_Id;
77       Decl : out Node_Id;
78       Pnam : out Entity_Id);
79    --  Build procedure for Read attribute for array type. Nod provides the
80    --  Sloc value for generated code.
81
82    procedure Build_Array_Write_Procedure
83      (Nod  : Node_Id;
84       Typ  : Entity_Id;
85       Decl : out Node_Id;
86       Pnam : out Entity_Id);
87    --  Build procedure for Write attribute for array type. Nod provides the
88    --  Sloc value for generated code.
89
90    procedure Build_Mutable_Record_Read_Procedure
91      (Loc  : Source_Ptr;
92       Typ  : Entity_Id;
93       Decl : out Node_Id;
94       Pnam : out Entity_Id);
95    --  Build procedure to Read a record with default discriminants.
96    --  Discriminants must be read explicitly (RM 13.13.2(9)) in the
97    --  same manner as is done for 'Input.
98
99    procedure Build_Mutable_Record_Write_Procedure
100      (Loc  : Source_Ptr;
101       Typ  : Entity_Id;
102       Decl : out Node_Id;
103       Pnam : out Entity_Id);
104    --  Build procedure to write a record with default discriminants.
105    --  Discriminants must be written explicitly (RM 13.13.2(9)) in
106    --  the same manner as is done for 'Output.
107
108    procedure Build_Record_Or_Elementary_Input_Function
109      (Loc  : Source_Ptr;
110       Typ  : Entity_Id;
111       Decl : out Node_Id;
112       Fnam : out Entity_Id);
113    --  Build function for Input attribute for record type or for an
114    --  elementary type (the latter is used only in the case where a
115    --  user defined Read routine is defined, since in other cases,
116    --  Input calls the appropriate runtime library routine directly.
117
118    procedure Build_Record_Or_Elementary_Output_Procedure
119      (Loc  : Source_Ptr;
120       Typ  : Entity_Id;
121       Decl : out Node_Id;
122       Pnam : out Entity_Id);
123    --  Build procedure for Output attribute for record type or for an
124    --  elementary type (the latter is used only in the case where a
125    --  user defined Write routine is defined, since in other cases,
126    --  Output calls the appropriate runtime library routine directly.
127
128    procedure Build_Record_Read_Procedure
129      (Loc  : Source_Ptr;
130       Typ  : Entity_Id;
131       Decl : out Node_Id;
132       Pnam : out Entity_Id);
133    --  Build procedure for Read attribute for record type
134
135    procedure Build_Record_Write_Procedure
136      (Loc  : Source_Ptr;
137       Typ  : Entity_Id;
138       Decl : out Node_Id;
139       Pnam : out Entity_Id);
140    --  Build procedure for Write attribute for record type
141
142    procedure Build_Stream_Procedure
143      (Loc  : Source_Ptr;
144       Typ  : Entity_Id;
145       Decl : out Node_Id;
146       Pnam : Entity_Id;
147       Stms : List_Id;
148       Outp : Boolean);
149    --  Called to build an array or record stream procedure. The first three
150    --  arguments are the same as Build_Record_Or_Elementary_Output_Procedure.
151    --  Stms is the list of statements for the body (the declaration list is
152    --  always null), and Pnam is the name of the constructed procedure.
153    --  Used by Exp_Dist to generate stream-oriented attributes for RACWs.
154
155 end Exp_Strm;