annotate gcc/ada/binderr.ads @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- B I N D E R R --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- This package contains the routines to output error messages for the binder
kono
parents:
diff changeset
27 -- and also the routines for handling fatal error conditions in the binder.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 with Namet; use Namet;
kono
parents:
diff changeset
30 with Types; use Types;
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 package Binderr is
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 Errors_Detected : Nat;
kono
parents:
diff changeset
35 -- Number of errors detected so far
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 Warnings_Detected : Nat;
kono
parents:
diff changeset
38 -- Number of warnings detected
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 Info_Prefix_Suppress : Boolean := False;
kono
parents:
diff changeset
41 -- If set to True, the normal "info: " header before messages generated
kono
parents:
diff changeset
42 -- by Error_Msg_Info will be omitted.
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 ---------------------------------------------------------
kono
parents:
diff changeset
45 -- Error Message Text and Message Insertion Characters --
kono
parents:
diff changeset
46 ---------------------------------------------------------
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 -- Error message text strings are composed of letters, digits and the
kono
parents:
diff changeset
49 -- special characters space, comma, period, colon and semicolon,
kono
parents:
diff changeset
50 -- apostrophe and parentheses. Special insertion characters can also
kono
parents:
diff changeset
51 -- appear which cause the error message circuit to modify the given
kono
parents:
diff changeset
52 -- string as follows:
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 -- Insertion character { (Left brace: insert file name from Names table)
kono
parents:
diff changeset
55 -- The character { is replaced by the text for the file name specified
kono
parents:
diff changeset
56 -- by the File_Name_Type value stored in Error_Msg_File_1. The name is
kono
parents:
diff changeset
57 -- always enclosed in quotes. A second { may appear in a single message
kono
parents:
diff changeset
58 -- in which case it is similarly replaced by the name which is
kono
parents:
diff changeset
59 -- specified by the File_Name_Type value stored in Error_Msg_File_2.
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 -- Insertion character $ (Dollar: insert unit name from Names table)
kono
parents:
diff changeset
62 -- The character $ is replaced by the text for the unit name specified
kono
parents:
diff changeset
63 -- by the Name_Id value stored in Error_Msg_Unit_1. The name is always
kono
parents:
diff changeset
64 -- enclosed in quotes. A second $ may appear in a single message in
kono
parents:
diff changeset
65 -- which case it is similarly replaced by the name which is specified
kono
parents:
diff changeset
66 -- by the Name_Id value stored in Error_Msg_Unit_2.
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 -- Insertion character # (Pound: insert non-negative number in decimal)
kono
parents:
diff changeset
69 -- The character # is replaced by the contents of Error_Msg_Nat_1
kono
parents:
diff changeset
70 -- converted into an unsigned decimal string. A second # may appear
kono
parents:
diff changeset
71 -- in a single message, in which case it is similarly replaced by
kono
parents:
diff changeset
72 -- the value stored in Error_Msg_Nat_2.
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 -- Insertion character ? (Question mark: warning message)
kono
parents:
diff changeset
75 -- The character ?, which must be the first character in the message
kono
parents:
diff changeset
76 -- string, signals a warning message instead of an error message.
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 -----------------------------------------------------
kono
parents:
diff changeset
79 -- Global Values Used for Error Message Insertions --
kono
parents:
diff changeset
80 -----------------------------------------------------
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 -- The following global variables are essentially additional parameters
kono
parents:
diff changeset
83 -- passed to the error message routine for insertion sequences described
kono
parents:
diff changeset
84 -- above. The reason these are passed globally is that the insertion
kono
parents:
diff changeset
85 -- mechanism is essentially an untyped one in which the appropriate
kono
parents:
diff changeset
86 -- variables are set depending on the specific insertion characters used.
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 Error_Msg_Name_1 : Name_Id;
kono
parents:
diff changeset
89 -- Name_Id value for % insertion characters in message
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 Error_Msg_File_1 : File_Name_Type;
kono
parents:
diff changeset
92 Error_Msg_File_2 : File_Name_Type;
kono
parents:
diff changeset
93 -- Name_Id values for { insertion characters in message
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 Error_Msg_Unit_1 : Unit_Name_Type;
kono
parents:
diff changeset
96 Error_Msg_Unit_2 : Unit_Name_Type;
kono
parents:
diff changeset
97 -- Name_Id values for $ insertion characters in message
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 Error_Msg_Nat_1 : Nat;
kono
parents:
diff changeset
100 Error_Msg_Nat_2 : Nat;
kono
parents:
diff changeset
101 -- Integer values for # insertion characters in message
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 ------------------------------
kono
parents:
diff changeset
104 -- Error Output Subprograms --
kono
parents:
diff changeset
105 ------------------------------
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 procedure Error_Msg (Msg : String);
kono
parents:
diff changeset
108 -- Output specified error message to standard error or standard output
kono
parents:
diff changeset
109 -- as governed by the brief and verbose switches, and update error
kono
parents:
diff changeset
110 -- counts appropriately
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 procedure Error_Msg_Info (Msg : String);
kono
parents:
diff changeset
113 -- Output information line. Indentical in effect to Error_Msg, except
kono
parents:
diff changeset
114 -- that the prefix is info: instead of error: and the error count is
kono
parents:
diff changeset
115 -- not incremented. The prefix may be suppressed by setting the global
kono
parents:
diff changeset
116 -- variable Info_Prefix_Suppress to True.
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 procedure Error_Msg_Output (Msg : String; Info : Boolean);
kono
parents:
diff changeset
119 -- Output given message, with insertions, to current message output file.
kono
parents:
diff changeset
120 -- The second argument is True for an info message, false for a normal
kono
parents:
diff changeset
121 -- warning or error message. Normally this is not called directly, but
kono
parents:
diff changeset
122 -- rather only by Error_Msg or Error_Msg_Info. It is called directly
kono
parents:
diff changeset
123 -- when the caller must control whether the output goes to stderr or
kono
parents:
diff changeset
124 -- stdout (Error_Msg_Output always goes to the current output file).
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 procedure Finalize_Binderr;
kono
parents:
diff changeset
127 -- Finalize error output for one file
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 procedure Initialize_Binderr;
kono
parents:
diff changeset
130 -- Initialize error output for one file
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 end Binderr;