/[eiffelstudio]/branches/eth/eve/Src/Eiffel/API/error/common/default_error_displayer.e
ViewVC logotype

Contents of /branches/eth/eve/Src/Eiffel/API/error/common/default_error_displayer.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 94983 - (show annotations)
Fri May 2 11:05:28 2014 UTC (5 years, 5 months ago) by jasonw
File size: 4966 byte(s)
<<Merged from trunk#94978.>>
1 note
2
3 description:
4 "Displays warnings and errors of compilation."
5 legal: "See notice at end of class."
6 status: "See notice at end of class.";
7 date: "$Date$";
8 revision: "$Revision $"
9
10 class DEFAULT_ERROR_DISPLAYER
11
12 inherit
13 ERROR_DISPLAYER
14
15 SHARED_CONFIGURE_RESOURCES
16
17 SHARED_ERROR_TRACER
18 export
19 {NONE} all
20 end
21
22 create
23 make
24
25 feature -- Initialization
26
27 make (ow: like output_window)
28 -- Initialize current with `output_window' to `ow'
29 do
30 output_window := ow
31 ensure
32 set: ow = output_window
33 end
34
35 feature -- Property
36
37 output_window: OUTPUT_WINDOW
38
39 feature -- Output
40
41 force_display
42 -- Make sure the user can see the messages we send.
43 do
44 end
45
46 trace (handler: ERROR_HANDLER)
47 -- <Precursor>
48 do
49 -- For batch compilers etc, we report the errors last to ensure they are shown on the terminal
50 -- closes to the next operation.
51 if handler.has_warning then
52 trace_warnings (handler)
53 end
54 if handler.has_error then
55 trace_errors (handler)
56 end
57 end
58
59 trace_warnings (handler: ERROR_HANDLER)
60 -- Display warnings messages from `handler'.
61 local
62 warning_list: LIST [ERROR];
63 a_text_formatter: TEXT_FORMATTER
64 l_cursor: CURSOR
65 retried: INTEGER
66 do
67 a_text_formatter := output_window
68 if retried = 0 then
69 from
70 warning_list := handler.warning_list
71 l_cursor := warning_list.cursor
72 warning_list.start
73 until
74 warning_list.after
75 loop
76 display_separation_line (a_text_formatter);
77 a_text_formatter.add_new_line;
78 tracer.trace (a_text_formatter, warning_list.item)
79 a_text_formatter.add_new_line;
80 warning_list.forth;
81 end;
82 warning_list.go_to (l_cursor)
83 if handler.error_list.is_empty then
84 -- There is no error in the list
85 -- put a separation before the next message
86 display_separation_line (a_text_formatter)
87 end;
88 elseif retried = 1 then
89 display_error_error (a_text_formatter)
90 end
91 rescue
92 if not fail_on_rescue then
93 retried := retried + 1;
94 retry;
95 end;
96 end;
97
98 trace_errors (handler: ERROR_HANDLER)
99 -- Display error messages from `handler'.
100 local
101 error_list: LIST [ERROR]
102 a_text_formatter: TEXT_FORMATTER
103 l_cursor: CURSOR
104 retried: INTEGER
105 do
106 a_text_formatter := output_window
107 if retried = 0 then
108 from
109 error_list := handler.error_list
110 l_cursor := error_list.cursor
111 error_list.start
112 until
113 error_list.after
114 loop
115 display_separation_line (a_text_formatter)
116 a_text_formatter.add_new_line
117 tracer.trace (a_text_formatter, error_list.item)
118 a_text_formatter.add_new_line
119 error_list.forth
120 end
121 error_list.go_to (l_cursor)
122 display_separation_line (a_text_formatter)
123 display_additional_info (a_text_formatter)
124 elseif retried = 1 then
125 display_error_error (a_text_formatter)
126 end
127 rescue
128 if not fail_on_rescue then
129 retried := retried + 1
130 retry
131 end
132 end
133
134 feature {NONE} -- Implementation
135
136 display_error_error (a_text_formatter: TEXT_FORMATTER)
137 do
138 a_text_formatter.add ("Exception occurred while displaying error message.");
139 a_text_formatter.add_new_line;
140 a_text_formatter.add ("Please contact ISE to report this bug.");
141 a_text_formatter.add_new_line
142 end;
143
144 display_separation_line (a_text_formatter: TEXT_FORMATTER)
145 do
146 a_text_formatter.add ("--------------------------------------------%
147 %-----------------------------------");
148 a_text_formatter.add_new_line
149 end
150
151 display_additional_info (a_text_formatter: TEXT_FORMATTER)
152 do
153 end
154
155 invariant
156
157 non_void_output_window: output_window /= Void
158
159 note
160 copyright: "Copyright (c) 1984-2014, Eiffel Software"
161 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
162 licensing_options: "http://www.eiffel.com/licensing"
163 copying: "[
164 This file is part of Eiffel Software's Eiffel Development Environment.
165
166 Eiffel Software's Eiffel Development Environment is free
167 software; you can redistribute it and/or modify it under
168 the terms of the GNU General Public License as published
169 by the Free Software Foundation, version 2 of the License
170 (available at the URL listed under "license" above).
171
172 Eiffel Software's Eiffel Development Environment is
173 distributed in the hope that it will be useful, but
174 WITHOUT ANY WARRANTY; without even the implied warranty
175 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
176 See the GNU General Public License for more details.
177
178 You should have received a copy of the GNU General Public
179 License along with Eiffel Software's Eiffel Development
180 Environment; if not, write to the Free Software Foundation,
181 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
182 ]"
183 source: "[
184 Eiffel Software
185 5949 Hollister Ave., Goleta, CA 93117 USA
186 Telephone 805-685-1006, Fax 805-685-6869
187 Website http://www.eiffel.com
188 Customer support http://support.eiffel.com
189 ]"
190
191 end -- class DEFAULT_ERROR_DISPLAYER

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23