OSDN Git Service

Delete all lines containing "$Revision:".
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_res.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              S E M _ R E S                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --          Copyright (C) 1992-1999 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- GNAT was originally developed  by the GNAT team at  New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
25 --                                                                          --
26 ------------------------------------------------------------------------------
27
28 --  Resolution processing for all subexpression nodes. Note that the separate
29 --  package Sem_Aggr contains the actual resolution routines for aggregates,
30 --  which are separated off since aggregate processing is complex.
31
32 with Snames; use Snames;
33 with Types;  use Types;
34
35 package Sem_Res is
36
37    --  As described in Sem_Ch4, the type resolution proceeds in two phases.
38    --  The first phase is a bottom up pass that is achieved during the
39    --  recursive traversal performed by the Analyze procedures. This phase
40    --  determines unambiguous types, and collects sets of possible types
41    --  where the interpretation is potentially ambiguous.
42
43    --  On completing this bottom up pass, which corresponds to a call to
44    --  Analyze on a complete context, the Resolve routine is called which
45    --  performs a top down resolution with recursive calls to itself to
46    --  resolve operands.
47
48    --  Since in practice a lot of semantic analysis has to be postponed until
49    --  types are known (e.g. static folding, setting of suppress flags), the
50    --  Resolve routines also complete the semantic analyze, and also call the
51    --  expander for possibly expansion of the completely type resolved node.
52
53    procedure Resolve (N : Node_Id; Typ : Entity_Id);
54    procedure Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id);
55    --  Top level type-checking procedure, called in a complete context. The
56    --  construct N, which is a subexpression, has already been analyzed, and
57    --  is required to be of type Typ given the analysis of the context (which
58    --  uses the information gathered on the bottom up phase in Analyze). The
59    --  resolve routines do various other processing, e.g. static evaluation.
60    --  If a Suppress argument is present, then the resolution is done with the
61    --  specified check suppressed (can be All_Checks to suppress all checks).
62
63    procedure Resolve_Discrete_Subtype_Indication
64      (N   : Node_Id;
65       Typ : Entity_Id);
66    --  Resolve subtype indications in choices (case statements and
67    --  aggregates) and in index constraints. Note that the resulting Etype
68    --  of the subtype indication node is set to the Etype of the contained
69    --  range (i.e. an Itype is not constructed for the actual subtype).
70
71    procedure Resolve_Entry (Entry_Name : Node_Id);
72    --  Find name of entry being called, and resolve prefix of name with its
73    --  own type. For now we assume that the prefix cannot be overloaded and
74    --  the name of the entry plays no role in the resolution.
75
76    procedure Analyze_And_Resolve (N : Node_Id);
77    procedure Analyze_And_Resolve (N : Node_Id; Typ : Entity_Id);
78    procedure Analyze_And_Resolve
79      (N        : Node_Id;
80       Typ      : Entity_Id;
81       Suppress : Check_Id);
82    procedure Analyze_And_Resolve
83      (N        : Node_Id;
84       Suppress : Check_Id);
85    --  These routines combine the effect of Analyze and Resolve. If a Suppress
86    --  argument is present, then the analysis is done with the specified check
87    --  suppressed (can be All_Checks to suppress all checks). These checks are
88    --  suppressed for both the analysis and resolution. If the type argument
89    --  is not present, then the Etype of the expression after the Analyze
90    --  call is used for the Resolve.
91
92    procedure Check_Parameterless_Call (N : Node_Id);
93    --  Several forms of names can denote calls to entities without para-
94    --  meters. The context determines whether the name denotes the entity
95    --  or a call to it. When it is a call, the node must be rebuilt
96    --  accordingly (deprocedured, in A68 terms) and renalyzed to obtain
97    --  possible interpretations.
98    --
99    --  The name may be that of an overloadable construct, or it can be an
100    --  explicit dereference of a prefix that denotes an access to subprogram.
101    --  In that case, we want to convert the name into a call only if the
102    --  context requires the return type of the subprogram.  Finally, a
103    --  parameterless protected subprogram appears as a selected component.
104    --
105    --  The parameter T is the Typ for the corresponding resolve call.
106
107    procedure Pre_Analyze_And_Resolve (N : Node_Id; T : Entity_Id);
108    --  Performs a pre-analysis of expression node N. During pre-analysis
109    --  N is analyzed and then resolved against type T, but no expansion
110    --  is carried out for N or its children. For more info on pre-analysis
111    --  read the spec of Sem.
112
113    procedure Pre_Analyze_And_Resolve (N : Node_Id);
114    --  Same, but use type of node because context does not impose a single
115    --  type.
116
117 end Sem_Res;