/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/API/error/eiffel/feature/pcat.e
ViewVC logotype

Contents of /branches/CAT_mono/Src/Eiffel/API/error/eiffel/feature/pcat.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69700 - (show annotations)
Thu Jul 26 20:01:12 2007 UTC (12 years, 4 months ago) by martins
File size: 3618 byte(s)
added warning: error PCAT (potential CAT issue)
protected conform to from a Void system.current_class for now
(crash occured during the checking of root type properties)
1 indexing
2 description: "Error for conformance missmatch which leads to potential CAT issue."
3 legal: "See notice at end of class."
4 status: "See notice at end of class.";
5 date: "$Date$";
6 revision: "$Revision $"
7
8 class PCAT
9
10 inherit
11 FEATURE_ERROR
12 redefine
13 build_explain
14 end
15
16 feature -- Properties
17
18 target_name: STRING;
19
20 target_type: TYPE_A;
21 -- Target type of the assignment (left part)
22
23 source_type: TYPE_A;
24 -- Source type of the assignment (right part)
25
26 code: STRING is
27 do
28 Result := "PCAT";
29 end;
30
31 feature -- Output
32
33 build_explain (a_text_formatter: TEXT_FORMATTER) is
34 -- Build specific explanation image for current error
35 -- in `a_text_formatter'.
36 local
37 l_target_type: CL_TYPE_A
38 l_source_type: CL_TYPE_A
39 l_same_class_name: BOOLEAN
40 do
41 -- Find out if we should also show the group corresponding to the type
42 -- involved when they have the same name (which would be confusion to the user).
43 --| Note: The same code is present in VUAR2.
44 l_target_type ?= target_type
45 l_source_type ?= source_type
46 if l_target_type /= Void and then l_source_type /= Void then
47 l_same_class_name := l_target_type.associated_class.name.is_equal (l_source_type.associated_class.name)
48 end
49
50 a_text_formatter.add ("Target type: ");
51 target_type.append_to (a_text_formatter);
52 if l_same_class_name then
53 a_text_formatter.add (" (from ")
54 a_text_formatter.add_group (l_target_type.associated_class.lace_class.group,
55 l_target_type.associated_class.lace_class.target.name)
56 a_text_formatter.add (")")
57 end
58 a_text_formatter.add_new_line;
59 a_text_formatter.add ("Source type: ");
60 source_type.append_to (a_text_formatter);
61 if l_same_class_name then
62 a_text_formatter.add (" (from ")
63 a_text_formatter.add_group (l_source_type.associated_class.lace_class.group,
64 l_source_type.associated_class.lace_class.target.name)
65 a_text_formatter.add (")")
66 end
67 a_text_formatter.add_new_line
68 end
69
70 feature {COMPILER_EXPORTER}
71
72 set_source_type (s: TYPE_A) is
73 -- Assign `s' to `source_type'.
74 do
75 source_type := s;
76 end;
77
78 set_target_type (t: TYPE_A) is
79 -- Assign `t' to `target_type'.
80 do
81 target_type := t;
82 end;
83
84 set_target_name (s: STRING) is
85 do
86 target_name := s;
87 end;
88
89 indexing
90 copyright: "Copyright (c) 1984-2006, Eiffel Software"
91 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
92 licensing_options: "http://www.eiffel.com/licensing"
93 copying: "[
94 This file is part of Eiffel Software's Eiffel Development Environment.
95
96 Eiffel Software's Eiffel Development Environment is free
97 software; you can redistribute it and/or modify it under
98 the terms of the GNU General Public License as published
99 by the Free Software Foundation, version 2 of the License
100 (available at the URL listed under "license" above).
101
102 Eiffel Software's Eiffel Development Environment is
103 distributed in the hope that it will be useful, but
104 WITHOUT ANY WARRANTY; without even the implied warranty
105 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
106 See the GNU General Public License for more details.
107
108 You should have received a copy of the GNU General Public
109 License along with Eiffel Software's Eiffel Development
110 Environment; if not, write to the Free Software Foundation,
111 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
112 ]"
113 source: "[
114 Eiffel Software
115 356 Storke Road, Goleta, CA 93117 USA
116 Telephone 805-685-1006, Fax 805-685-6869
117 Website http://www.eiffel.com
118 Customer support http://support.eiffel.com
119 ]"
120
121 end -- class VJAR

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23