OSDN Git Service

New Language: Ada
[pf3gnuchains/gcc-fork.git] / gcc / ada / binderr.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              B I N D E R R                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                            $Revision: 1.13 $
10 --                                                                          --
11 --          Copyright (C) 1992-2000 Free Software Foundation, Inc.          --
12 --                                                                          --
13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- GNAT was originally developed  by the GNAT team at  New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28
29 --  This package contains the routines to output error messages for the binder
30 --  and also the routines for handling fatal error conditions in the binder.
31
32 with Types; use Types;
33
34 package Binderr is
35
36    Errors_Detected : Int;
37    --  Number of errors detected so far
38
39    Warnings_Detected : Int;
40    --  Number of warnings detected
41
42    Info_Prefix_Suppress : Boolean := False;
43    --  If set to True, the normal "info: " header before messages generated
44    --  by Error_Msg_Info will be omitted.
45
46    ---------------------------------------------------------
47    -- Error Message Text and Message Insertion Characters --
48    ---------------------------------------------------------
49
50    --  Error message text strings are composed of letters, digits and the
51    --  special characters space, comma, period, colon and semicolon,
52    --  apostrophe and parentheses. Special insertion characters can also
53    --  appear which cause the error message circuit to modify the given
54    --  string as follows:
55
56    --    Insertion character % (Percent: insert file name from Names table)
57    --      The character % is replaced by the text for the file name specified
58    --      by the Name_Id value stored in Error_Msg_Name_1. The name is always
59    --      enclosed in quotes. A second % may appear in a single message in
60    --      which case it is similarly replaced by the name which is specified
61    --      by the Name_Id value stored in Error_Msg_Name_2.
62
63    --    Insertion character & (Ampersand: insert unit name from Names table)
64    --      The character & is replaced by the text for the unit name specified
65    --      by the Name_Id value stored in Error_Msg_Name_1. The name is always
66    --      enclosed in quotes. A second & may appear in a single message in
67    --      which case it is similarly replaced by the name which is specified
68    --      by the Name_Id value stored in Error_Msg_Name_2.
69
70    --    Insertion character ? (Question mark: warning message)
71    --      The character ?, which must be the first character in the message
72    --      string, signals a warning message instead of an error message.
73
74    -----------------------------------------------------
75    -- Global Values Used for Error Message Insertions --
76    -----------------------------------------------------
77
78    --  The following global variables are essentially additional parameters
79    --  passed to the error message routine for insertion sequences described
80    --  above. The reason these are passed globally is that the insertion
81    --  mechanism is essentially an untyped one in which the appropriate
82    --  variables are set dependingon the specific insertion characters used.
83
84    Error_Msg_Name_1 : Name_Id;
85    Error_Msg_Name_2 : Name_Id;
86    --  Name_Id values for % insertion characters in message
87
88    ------------------------------
89    -- Error Output Subprograms --
90    ------------------------------
91
92    procedure Error_Msg (Msg : String);
93    --  Output specified error message to standard error or standard output
94    --  as governed by the brief and verbose switches, and update error
95    --  counts appropriately
96
97    procedure Error_Msg_Info (Msg : String);
98    --  Output information line. Indentical in effect to Error_Msg, except
99    --  that the prefix is info: instead of error: and the error count is
100    --  not incremented. The prefix may be suppressed by setting the global
101    --  variable Info_Prefix_Suppress to True.
102
103    procedure Error_Msg_Output (Msg : String; Info : Boolean);
104    --  Output given message, with insertions, to current message output file.
105    --  The second argument is True for an info message, false for a normal
106    --  warning or error message. Normally this is not called directly, but
107    --  rather only by Error_Msg or Error_Msg_Info. It is called directly
108    --  when the caller must control whether the output goes to stderr or
109    --  stdout (Error_Msg_Output always goes to the current output file).
110
111    procedure Finalize_Binderr;
112    --  Finalize error output for one file
113
114    procedure Initialize_Binderr;
115    --  Initialize error output for one file
116
117 end Binderr;