/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/eiffel/interface/class_b.e
ViewVC logotype

Contents of /branches/CAT_mono/Src/Eiffel/eiffel/interface/class_b.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69650 - (show annotations)
Tue Jul 24 17:18:14 2007 UTC (12 years, 4 months ago) by juliant
File size: 3926 byte(s)
Added monomorph mark for class types, either "frozen" or "invariant".
First (simple) conformance check for monomorphic types.
1 indexing
2 description: "Internal description of a basic class such as INTEGER, BOOLEAN etc.."
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 CLASS_B
9
10 inherit
11 EIFFEL_CLASS_C
12 redefine
13 is_basic, partial_actual_type, check_validity
14 end
15
16 SPECIAL_CONST
17 export
18 {NONE} all
19 end
20
21 create
22 make
23
24 feature
25
26 is_basic: BOOLEAN is True
27 -- Is the current class a basic class ?
28
29 feature {CLASS_TYPE_AS} -- Actual class type
30
31 partial_actual_type (gen: ARRAY [TYPE_A]; is_exp, is_sep, is_mono: BOOLEAN): CL_TYPE_A is
32 -- Actual type of `current depending on the context in which it is declared
33 -- in CLASS_TYPE_AS. That is to say, it could have generics `gen' but not
34 -- be a generic class. It simplifies creation of `CL_TYPE_A' instances in
35 -- CLASS_TYPE_AS when trying to resolve types, by using dynamic binding
36 -- rather than if statements.
37 do
38 if gen /= Void then
39 create {GEN_TYPE_A} Result.make (class_id, gen)
40 else
41 Result := actual_type
42 end
43 end
44
45 feature -- Validity
46
47 check_validity is
48 -- Check validity of a simple type reference class.
49 local
50 skelet: SKELETON
51 special_error: SPECIAL_ERROR
52 l_proc: PROCEDURE_I
53 l_feat: FEATURE_I
54 l_attr: ATTRIBUTE_I
55 do
56 -- First, no generics
57 if generics /= Void then
58 create special_error.make (basic_case_1, Current)
59 Error_handler.insert_error (special_error)
60 end
61
62 -- Check for `item' query.
63 l_feat := feature_table.item_id ({PREDEFINED_NAMES}.item_name_id)
64 if l_feat = Void or else not l_feat.has_return_value then
65 create special_error.make (basic_case_3, Current)
66 Error_handler.insert_error (special_error)
67 else
68 l_attr ?= l_feat
69 if l_attr /= Void then
70 -- We are compiling for Eiffel Software implementation
71 skelet := types.first.skeleton
72 if
73 skelet.count /= 1 or else
74 not skelet.first.type_i.same_as (actual_type.type_i)
75 then
76 create special_error.make (basic_case_2, Current)
77 Error_handler.insert_error (special_error)
78 else
79 end
80 else
81 create special_error.make (basic_case_3, Current)
82 Error_handler.insert_error (special_error)
83 end
84 end
85
86 -- Check for a procedure `set_item'.
87 l_proc ?= feature_table.item_id ({PREDEFINED_NAMES}.set_item_name_id)
88 if
89 l_proc = Void or else
90 l_proc.argument_count /= 1 or else
91 not l_proc.arguments.i_th (1).same_as (actual_type)
92 then
93 create special_error.make (basic_case_4, Current)
94 Error_handler.insert_error (special_error)
95 end
96 end
97
98 indexing
99 copyright: "Copyright (c) 1984-2006, Eiffel Software"
100 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
101 licensing_options: "http://www.eiffel.com/licensing"
102 copying: "[
103 This file is part of Eiffel Software's Eiffel Development Environment.
104
105 Eiffel Software's Eiffel Development Environment is free
106 software; you can redistribute it and/or modify it under
107 the terms of the GNU General Public License as published
108 by the Free Software Foundation, version 2 of the License
109 (available at the URL listed under "license" above).
110
111 Eiffel Software's Eiffel Development Environment is
112 distributed in the hope that it will be useful, but
113 WITHOUT ANY WARRANTY; without even the implied warranty
114 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
115 See the GNU General Public License for more details.
116
117 You should have received a copy of the GNU General Public
118 License along with Eiffel Software's Eiffel Development
119 Environment; if not, write to the Free Software Foundation,
120 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
121 ]"
122 source: "[
123 Eiffel Software
124 356 Storke Road, Goleta, CA 93117 USA
125 Telephone 805-685-1006, Fax 805-685-6869
126 Website http://www.eiffel.com
127 Customer support http://support.eiffel.com
128 ]"
129
130 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23