1------------------------------------------------------------------------------
2--                                                                          --
3--                         GNAT COMPILER COMPONENTS                         --
4--                                                                          --
5--                             E R R _ V A R S                              --
6--                                                                          --
7--                                 S p e c                                  --
8--                                                                          --
9--          Copyright (C) 1992-2002 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,  59 Temple Place - Suite 330,  Boston, --
20-- MA 02111-1307, 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--  This package contains variables common to error reporting packages
28--  including Errout and Prj.Err.
29
30with Types; use Types;
31with Uintp; use Uintp;
32
33package Err_Vars is
34
35   Serious_Errors_Detected : Nat;
36   --  This is a count of errors that are serious enough to stop expansion,
37   --  and hence to prevent generation of an object file even if the
38   --  switch -gnatQ is set.
39
40   Total_Errors_Detected : Nat;
41   --  Number of errors detected so far. Includes count of serious errors
42   --  and non-serious errors, so this value is always greater than or
43   --  equal to the Serious_Errors_Detected value.
44
45   Warnings_Detected : Nat;
46   --  Number of warnings detected
47
48   Current_Error_Source_File : Source_File_Index;
49   --  Id of current messages. Used to post file name when unit changes. This
50   --  is initialized to Main_Source_File at the start of a compilation, which
51   --  means that no file names will be output unless there are errors in units
52   --  other than the main unit. However, if the main unit has a pragma
53   --  Source_Reference line, then this is initialized to No_Source_File,
54   --  to force an initial reference to the real source file name.
55
56   Raise_Exception_On_Error : Nat := 0;
57   --  If this value is non-zero, then any attempt to generate an error
58   --  message raises the exception Error_Msg_Exception, and the error
59   --  message is not output. This is used for defending against junk
60   --  resulting from illegalities, and also for substitution of more
61   --  appropriate error messages from higher semantic levels. It is
62   --  a counter so that the increment/decrement protocol nests neatly.
63
64   Error_Msg_Exception : exception;
65   --  Exception raised if Raise_Exception_On_Error is true
66
67   -----------------------------------------------------
68   -- Global Values Used for Error Message Insertions --
69   -----------------------------------------------------
70
71   --  The following global variables are essentially additional parameters
72   --  passed to the error message routine for insertion sequences described
73   --  above. The reason these are passed globally is that the insertion
74   --  mechanism is essentially an untyped one in which the appropriate
75   --  variables are set dependingon the specific insertion characters used.
76
77   Error_Msg_Col : Column_Number;
78   --  Column for @ insertion character in message
79
80   Error_Msg_Uint_1 : Uint;
81   Error_Msg_Uint_2 : Uint;
82   --  Uint values for ^ insertion characters in message
83
84   Error_Msg_Sloc : Source_Ptr;
85   --  Source location for # insertion character in message
86
87   Error_Msg_Name_1 : Name_Id;
88   Error_Msg_Name_2 : Name_Id;
89   Error_Msg_Name_3 : Name_Id;
90   --  Name_Id values for % insertion characters in message
91
92   Error_Msg_Unit_1 : Name_Id;
93   Error_Msg_Unit_2 : Name_Id;
94   --  Name_Id values for $ insertion characters in message
95
96   Error_Msg_Node_1 : Node_Id;
97   Error_Msg_Node_2 : Node_Id;
98   --  Node_Id values for & insertion characters in message
99
100   Error_Msg_Qual_Level : Int := 0;
101   --  Number of levels of qualification required for type name (see the
102   --  description of the } insertion character. Note that this value does
103   --  note get reset by any Error_Msg call, so the caller is responsible
104   --  for resetting it.
105
106   Warn_On_Instance : Boolean := False;
107   --  Normally if a warning is generated in a generic template from the
108   --  analysis of the template, then the warning really belongs in the
109   --  template, and the default value of False for this Boolean achieves
110   --  that effect. If Warn_On_Instance is set True, then the warnings are
111   --  generated on the instantiation (referring to the template) rather
112   --  than on the template itself.
113
114end Err_Vars;
115