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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [ada/] [sem_ch2.adb] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 281 jeremybenn
------------------------------------------------------------------------------
2
--                                                                          --
3
--                         GNAT COMPILER COMPONENTS                         --
4
--                                                                          --
5
--                              S E M _ C H 2                               --
6
--                                                                          --
7
--                                 B o d y                                  --
8
--                                                                          --
9
--          Copyright (C) 1992-2007, 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
with Atree;    use Atree;
27
with Errout;   use Errout;
28
with Namet;    use Namet;
29
with Opt;      use Opt;
30
with Restrict; use Restrict;
31
with Rident;   use Rident;
32
with Sem_Ch8;  use Sem_Ch8;
33
with Sinfo;    use Sinfo;
34
with Stand;    use Stand;
35
with Uintp;    use Uintp;
36
 
37
package body Sem_Ch2 is
38
 
39
   -------------------------------
40
   -- Analyze_Character_Literal --
41
   -------------------------------
42
 
43
   procedure Analyze_Character_Literal (N : Node_Id) is
44
   begin
45
      --  The type is eventually inherited from the context. If expansion
46
      --  has already established the proper type, do not modify it.
47
 
48
      if No (Etype (N)) then
49
         Set_Etype (N, Any_Character);
50
      end if;
51
 
52
      Set_Is_Static_Expression (N);
53
 
54
      if Comes_From_Source (N)
55
        and then not In_Character_Range (UI_To_CC (Char_Literal_Value (N)))
56
      then
57
         Check_Restriction (No_Wide_Characters, N);
58
      end if;
59
   end Analyze_Character_Literal;
60
 
61
   ------------------------
62
   -- Analyze_Identifier --
63
   ------------------------
64
 
65
   procedure Analyze_Identifier (N : Node_Id) is
66
   begin
67
      --  Ignore call if prior errors, and identifier has no name, since
68
      --  this is the result of some kind of previous error generating a
69
      --  junk identifier.
70
 
71
      if Chars (N) in Error_Name_Or_No_Name
72
        and then Total_Errors_Detected /= 0
73
      then
74
         return;
75
      else
76
         Find_Direct_Name (N);
77
      end if;
78
   end Analyze_Identifier;
79
 
80
   -----------------------------
81
   -- Analyze_Integer_Literal --
82
   -----------------------------
83
 
84
   procedure Analyze_Integer_Literal (N : Node_Id) is
85
   begin
86
      Set_Etype (N, Universal_Integer);
87
      Set_Is_Static_Expression (N);
88
   end Analyze_Integer_Literal;
89
 
90
   --------------------------
91
   -- Analyze_Real_Literal --
92
   --------------------------
93
 
94
   procedure Analyze_Real_Literal (N : Node_Id) is
95
   begin
96
      Set_Etype (N, Universal_Real);
97
      Set_Is_Static_Expression (N);
98
   end Analyze_Real_Literal;
99
 
100
   ----------------------------
101
   -- Analyze_String_Literal --
102
   ----------------------------
103
 
104
   procedure Analyze_String_Literal (N : Node_Id) is
105
   begin
106
      --  The type is eventually inherited from the context. If expansion
107
      --  has already established the proper type, do not modify it.
108
 
109
      if No (Etype (N)) then
110
         Set_Etype (N, Any_String);
111
      end if;
112
 
113
      --  String literals are static in Ada 95. Note that if the subtype
114
      --  turns out to be non-static, then the Is_Static_Expression flag
115
      --  will be reset in Eval_String_Literal.
116
 
117
      if Ada_Version >= Ada_95 then
118
         Set_Is_Static_Expression (N);
119
      end if;
120
 
121
      if Comes_From_Source (N) and then Has_Wide_Character (N) then
122
         Check_Restriction (No_Wide_Characters, N);
123
      end if;
124
   end Analyze_String_Literal;
125
 
126
end Sem_Ch2;

powered by: WebSVN 2.1.0

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