OSDN Git Service

* config/pa/fptr.c: Update license header.
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_prag.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             S E M _ P R A G                              --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2005, 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,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, 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 --  Pragma handling is isolated in a separate package
28 --  (logically this processing belongs in chapter 4)
29
30 with Types; use Types;
31
32 package Sem_Prag is
33
34    procedure Analyze_Pragma (N : Node_Id);
35    --  Analyze procedure for pragma reference node N
36
37    function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean;
38    --  N is a pragma appearing in a configuration pragma file. Most such
39    --  pragmas are analyzed when the file is read, before parsing and analyzing
40    --  the main unit. However, the analysis of certain pragmas results in
41    --  adding information to the compiled main unit, and this cannot be done
42    --  till the main unit is processed. Such pragmas return True from this
43    --  function and in Frontend pragmas where Delay_Config_Pragma_Analyze is
44    --  True have their analysis delayed until after the main program is parsed
45    --  and analyzed.
46
47    function Is_Non_Significant_Pragma_Reference (N : Node_Id) return Boolean;
48    --  The node N is a node for an entity and the issue is whether the
49    --  occurrence is a reference for the purposes of giving warnings about
50    --  unreferenced variables. This function returns True if the reference is
51    --  not a reference from this point of view (e.g. the occurrence in a pragma
52    --  Pack) and False if it is a real reference (e.g. the occcurrence in a
53    --  pragma Export);
54
55    function Is_Pragma_String_Literal (Par : Node_Id) return Boolean;
56    --  Given an N_Pragma_Argument_Association node, Par, which has the form of
57    --  an operator symbol, determines whether or not it should be treated as an
58    --  string literal. This is called by Sem_Ch6.Analyze_Operator_Symbol. If
59    --  True is returned, the argument is converted to a string literal. If
60    --  False is returned, then the argument is treated as an entity reference
61    --  to the operator.
62
63    function Is_Config_Static_String (Arg : Node_Id) return Boolean;
64    --  This is called for a configuration pragma that requires either string
65    --  literal or a concatenation of string literals. We cannot use normal
66    --  static string processing because it is too early in the case of the
67    --  pragma appearing in a configuration pragmas file. If Arg is of an
68    --  appropriate form, then this call obtains the string (doing any necessary
69    --  concatenations) and places it in Name_Buffer, setting Name_Len to its
70    --  length, and then returns True. If it is not of the correct form, then an
71    --  appropriate error message is posted, and False is returned.
72
73    procedure Process_Compilation_Unit_Pragmas (N : Node_Id);
74    --  Called at the start of processing compilation unit N to deal with any
75    --  special issues regarding pragmas. In particular, we have to deal with
76    --  Suppress_All at this stage, since it appears after the unit instead of
77    --  before.
78
79    procedure Set_Encoded_Interface_Name (E : Entity_Id; S : Node_Id);
80    --  This routine is used to set an encoded interface name. The node S is an
81    --  N_String_Literal node for the external name to be set, and E is an
82    --  entity whose Interface_Name field is to be set. In the normal case where
83    --  S contains a name that is a valid C identifier, then S is simply set as
84    --  the value of the Interface_Name. Otherwise it is encoded. See the body
85    --  for details of the encoding. This encoding is only done on VMS systems,
86    --  since it seems pretty silly, but is needed to pass some dubious tests in
87    --  the test suite.
88
89 end Sem_Prag;