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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69650 - (hide annotations)
Tue Jul 24 17:18:14 2007 UTC (12 years, 6 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 manus 43159 indexing
2     description: "Internal description of a basic class such as INTEGER, BOOLEAN etc.."
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 43159 date: "$Date$"
6     revision: "$Revision$"
7 grator 18
8 alexk 56011 class CLASS_B
9 grator 18
10     inherit
11 patrickr 57781 EIFFEL_CLASS_C
12 grator 18 redefine
13 manus 41838 is_basic, partial_actual_type, check_validity
14 grator 18 end
15 alexk 56011
16 manus 41838 SPECIAL_CONST
17     export
18     {NONE} all
19     end
20 manus 9653
21 julieng 37693 create
22 grator 18 make
23    
24 alexk 56011 feature
25    
26 manus 9816 is_basic: BOOLEAN is True
27 grator 18 -- Is the current class a basic class ?
28    
29 manus 41838 feature {CLASS_TYPE_AS} -- Actual class type
30    
31 juliant 69650 partial_actual_type (gen: ARRAY [TYPE_A]; is_exp, is_sep, is_mono: BOOLEAN): CL_TYPE_A is
32 manus 41838 -- 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 manus 44449 -- be a generic class. It simplifies creation of `CL_TYPE_A' instances in
35 manus 41838 -- 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 manus 44449 Result := actual_type
42 manus 41838 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 manus 66254 l_proc: PROCEDURE_I
53     l_feat: FEATURE_I
54 manus 41838 l_attr: ATTRIBUTE_I
55     do
56     -- First, no generics
57     if generics /= Void then
58 manus 43159 create special_error.make (basic_case_1, Current)
59 manus 41838 Error_handler.insert_error (special_error)
60     end
61 alexk 56011
62 manus 66254 -- 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 manus 41838 Error_handler.insert_error (special_error)
67     else
68 manus 66254 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 manus 66895 create special_error.make (basic_case_3, Current)
82     Error_handler.insert_error (special_error)
83 manus 41838 end
84     end
85 alexk 56011
86 manus 41838 -- Check for a procedure `set_item'.
87 manus 66254 l_proc ?= feature_table.item_id ({PREDEFINED_NAMES}.set_item_name_id)
88 manus 41838 if
89 manus 66254 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 manus 41838 then
93 manus 43159 create special_error.make (basic_case_4, Current)
94 manus 41838 Error_handler.insert_error (special_error)
95     end
96     end
97    
98 manus 56535 indexing
99     copyright: "Copyright (c) 1984-2006, Eiffel Software"
100 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
101 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
102     copying: "[
103     This file is part of Eiffel Software's Eiffel Development Environment.
104 manus 58027
105 manus 56535 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 manus 58027
111 manus 56535 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 manus 58027
117 manus 56535 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 grator 18 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23