OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [ada/] [sem_res.ads] - Blame information for rev 297

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 281 jeremybenn
------------------------------------------------------------------------------
2
--                                                                          --
3
--                         GNAT COMPILER COMPONENTS                         --
4
--                                                                          --
5
--                              S E M _ R E S                               --
6
--                                                                          --
7
--                                 S p e c                                  --
8
--                                                                          --
9
--          Copyright (C) 1992-2008, 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 3,  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 COPYING3.  If not, go to --
19
-- http://www.gnu.org/licenses for a complete copy of the license.          --
20
--                                                                          --
21
-- GNAT was originally developed  by the GNAT team at  New York University. --
22
-- Extensive contributions were provided by Ada Core Technologies Inc.      --
23
--                                                                          --
24
------------------------------------------------------------------------------
25
 
26
--  Resolution processing for all subexpression nodes. Note that the separate
27
--  package Sem_Aggr contains the actual resolution routines for aggregates,
28
--  which are separated off since aggregate processing is complex.
29
 
30
with Types; use Types;
31
 
32
package Sem_Res is
33
 
34
   --  As described in Sem_Ch4, the type resolution proceeds in two phases.
35
   --  The first phase is a bottom up pass that is achieved during the
36
   --  recursive traversal performed by the Analyze procedures. This phase
37
   --  determines unambiguous types, and collects sets of possible types
38
   --  where the interpretation is potentially ambiguous.
39
 
40
   --  On completing this bottom up pass, which corresponds to a call to
41
   --  Analyze on a complete context, the Resolve routine is called which
42
   --  performs a top down resolution with recursive calls to itself to
43
   --  resolve operands.
44
 
45
   --  Since in practice a lot of semantic analysis has to be postponed until
46
   --  types are known (e.g. static folding, setting of suppress flags), the
47
   --  Resolve routines also complete the semantic analysis, and call the
48
   --  expander for possibly expansion of the completely type resolved node.
49
 
50
   procedure Resolve (N : Node_Id; Typ : Entity_Id);
51
   procedure Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id);
52
   --  Top level type-checking procedure, called in a complete context. The
53
   --  construct N, which is a subexpression, has already been analyzed, and
54
   --  is required to be of type Typ given the analysis of the context (which
55
   --  uses the information gathered on the bottom up phase in Analyze). The
56
   --  resolve routines do various other processing, e.g. static evaluation.
57
   --  If a Suppress argument is present, then the resolution is done with the
58
   --  specified check suppressed (can be All_Checks to suppress all checks).
59
 
60
   procedure Resolve (N : Node_Id);
61
   --  A version of Resolve where the type to be used for resolution is
62
   --  taken from the Etype (N). This is commonly used in cases where the
63
   --  context does not add anything and the first pass of analysis found
64
   --  the correct expected type.
65
 
66
   procedure Resolve_Discrete_Subtype_Indication
67
     (N   : Node_Id;
68
      Typ : Entity_Id);
69
   --  Resolve subtype indications in choices (case statements and
70
   --  aggregates) and in index constraints. Note that the resulting Etype
71
   --  of the subtype indication node is set to the Etype of the contained
72
   --  range (i.e. an Itype is not constructed for the actual subtype).
73
 
74
   procedure Resolve_Entry (Entry_Name : Node_Id);
75
   --  Find name of entry being called, and resolve prefix of name with its
76
   --  own type. For now we assume that the prefix cannot be overloaded and
77
   --  the name of the entry plays no role in the resolution.
78
 
79
   procedure Analyze_And_Resolve (N : Node_Id);
80
   procedure Analyze_And_Resolve (N : Node_Id; Typ : Entity_Id);
81
   procedure Analyze_And_Resolve
82
     (N        : Node_Id;
83
      Typ      : Entity_Id;
84
      Suppress : Check_Id);
85
   procedure Analyze_And_Resolve
86
     (N        : Node_Id;
87
      Suppress : Check_Id);
88
   --  These routines combine the effect of Analyze and Resolve. If a Suppress
89
   --  argument is present, then the analysis is done with the specified check
90
   --  suppressed (can be All_Checks to suppress all checks). These checks are
91
   --  suppressed for both the analysis and resolution. If the type argument
92
   --  is not present, then the Etype of the expression after the Analyze
93
   --  call is used for the Resolve.
94
 
95
   procedure Ambiguous_Character (C : Node_Id);
96
   --  Give list of candidate interpretations when a character literal cannot
97
   --  be resolved, for example in a (useless) comparison such as 'A' = 'B'.
98
   --  In Ada95 the literals in question can be of type Character or Wide_
99
   --  Character. In Ada2005 Wide_Wide_Character is also a candidate. The
100
   --  node may also be overloaded with user-defined character types.
101
 
102
   procedure Check_Parameterless_Call (N : Node_Id);
103
   --  Several forms of names can denote calls to entities without para-
104
   --  meters. The context determines whether the name denotes the entity
105
   --  or a call to it. When it is a call, the node must be rebuilt
106
   --  accordingly and reanalyzed to obtain possible interpretations.
107
   --
108
   --  The name may be that of an overloadable construct, or it can be an
109
   --  explicit dereference of a prefix that denotes an access to subprogram.
110
   --  In that case, we want to convert the name into a call only if the
111
   --  context requires the return type of the subprogram.  Finally, a
112
   --  parameterless protected subprogram appears as a selected component.
113
   --
114
   --  The parameter T is the Typ for the corresponding resolve call.
115
 
116
   procedure Preanalyze_And_Resolve (N : Node_Id; T : Entity_Id);
117
   --  Performs a pre-analysis of expression node N. During pre-analysis,
118
   --  N is analyzed and then resolved against type T, but no expansion
119
   --  is carried out for N or its children. For more info on pre-analysis
120
   --  read the spec of Sem.
121
 
122
   procedure Preanalyze_And_Resolve (N : Node_Id);
123
   --  Same, but use type of node because context does not impose a single type
124
 
125
private
126
   procedure Resolve_Implicit_Type (N : Node_Id) renames Resolve;
127
   pragma Inline (Resolve_Implicit_Type);
128
   --  We use this renaming to make the application of Inline very explicit
129
   --  to this version, since other versions of Resolve are not inlined.
130
 
131
end Sem_Res;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.