/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e
ViewVC logotype

Annotation of /branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 68030 - (hide annotations)
Mon Apr 30 18:38:45 2007 UTC (12 years, 9 months ago) by martins
Original Path: trunk/Src/Eiffel/API/evaluated_type/like_type_a.e
File size: 5076 byte(s)
Main change: I merged many occurences of "constrained_type" like features into `FORMAL_A'
Renamed `is_multi_constrained_formal' into `is_multi_constrained'
type_a.e: I moved some features into FORMAL_A because the usage pattern suggests that they are not needed in TYPE_A (to improve speed).
renamed_type_a.e: added implementation for `conformance_type', this was a bug (not reported)
formal_dec_as.e: fixed a bug in `is_multi_constrained' (not reported)
1 manus 9658 indexing
2     description: "Representation of an anchored type"
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 9658 date: "$Date$"
6     revision: "$Revision$"
7    
8     deferred class
9     LIKE_TYPE_A
10    
11     inherit
12     TYPE_A
13     undefine
14 manus 57371 instantiation_in, same_as
15 manus 9658 redefine
16 alexk 56027 actual_type,
17     conformance_type,
18     convert_to,
19 manus 44434 has_associated_class,
20 alexk 56027 has_like,
21     instantiated_in,
22     is_basic,
23     is_expanded,
24     is_external,
25     is_like,
26     is_loose,
27     is_none,
28     is_reference,
29 manus 57371 is_valid,
30 alexk 56027 meta_type
31 manus 9658 end
32    
33     feature -- Properties
34    
35     actual_type: TYPE_A
36     -- Actual type of the anchored type in a given class
37 alexk 55790
38 alexk 56027 conformance_type: TYPE_A is
39     -- Type which is used to check conformance
40     do
41     -- `conformance_type' has to be called because
42     -- `actual_type' may yield yet another anchored type.
43     Result := actual_type.conformance_type
44     end
45    
46 martins 68030 has_associated_class: BOOLEAN is
47     -- Does Current have an associated class?
48     do
49     Result := actual_type /= Void and then
50     actual_type.has_associated_class
51     end
52 manus 9658
53     has_like: BOOLEAN is True
54     -- Does the type have anchored type in its definition ?
55    
56 martins 68030 is_like: BOOLEAN is True
57     -- Is the type anchored one ?
58    
59 alexk 48822 is_loose: BOOLEAN is True
60     -- Does type depend on formal generic parameters and/or anchors?
61    
62 manus 9658 is_basic: BOOLEAN is
63     -- Is the current actual type a basic one ?
64     do
65 manus 11302 Result := actual_type.is_basic
66 manus 9658 end
67 alexk 55790
68 manus 41738 is_external: BOOLEAN is
69     -- Is current type based on an external class?
70     do
71     Result := actual_type.is_external
72     end
73 alexk 55790
74 manus 42626 is_reference: BOOLEAN is
75     -- Is current actual type a reference one?
76     do
77     Result := actual_type.is_reference
78     end
79 manus 9658
80 manus 42626 is_expanded: BOOLEAN is
81     -- Is current actual type an expanded one?
82     do
83     Result := actual_type.is_expanded
84     end
85 alexk 55790
86 manus 50192 is_none: BOOLEAN is
87     -- Is current actual type NONE?
88     do
89     Result := actual_type.is_none
90     end
91 manus 42626
92 manus 57371 is_valid: BOOLEAN is
93     -- Is current type valid?
94     do
95     Result := actual_type /= Void
96     end
97    
98 manus 9658 same_as (other: TYPE_A): BOOLEAN is
99     -- Is the current type the same as `other' ?
100     deferred
101     end
102    
103 martins 68030 feature -- Access
104 manus 9658
105 manus 11302 associated_class: CLASS_C is
106 manus 9658 -- Associated class
107     do
108 manus 11302 Result := actual_type.associated_class
109 manus 9658 end
110    
111     feature -- Primitives
112    
113     set_actual_type (a: TYPE_A) is
114     -- Assign `a' to `actual_type'.
115     do
116     actual_type := a
117     end
118    
119 alexk 55790 instantiation_in (type: TYPE_A written_id: INTEGER): TYPE_A is
120 manus 9658 -- Instantiation of Current in the context of `class_type',
121     -- assuming that Current is written in class of id `written_id'.
122     deferred
123     end
124    
125 alexk 55790 instantiated_in (class_type: TYPE_A): TYPE_A is
126 manus 9658 -- Instantiation of Current in the context of `class_type'
127     -- assuming that Current is written in the associated class
128     -- of `class_type'.
129 alexk 55790 local
130     t: like Current
131 manus 9658 do
132 alexk 55790 t := twin
133     t.set_actual_type (actual_type.instantiated_in (class_type))
134     Result := t
135 manus 9658 end
136    
137 manus 41738 conform_to (other: TYPE_A): BOOLEAN is
138     -- Does `actual_type' conform to `other'?
139 manus 9658 do
140 alexk 55790 Result := actual_type.conform_to (other.conformance_type)
141 manus 9658 end
142    
143 manus 50374 convert_to (a_context_class: CLASS_C; a_target_type: TYPE_A): BOOLEAN is
144     -- Does current convert to `a_target_type' in `a_context_class'?
145     -- Update `last_conversion_info' of AST_CONTEXT.
146     do
147 alexk 55790 Result := actual_type.convert_to (a_context_class, a_target_type)
148 manus 50374 end
149    
150 manus 9658 type_i: TYPE_I is
151     -- Reduced type of `actual_type'
152 manus 10886 local
153     cl_type : CL_TYPE_I
154 manus 9658 do
155     Result := actual_type.type_i
156 manus 10886 cl_type ?= Result
157    
158 manus 41738 if cl_type /= Void and then not cl_type.is_expanded then
159     -- Remember that it's an anchored type, not needed
160     -- when handling expanded types.
161 manus 10886 cl_type.set_cr_info (create_info)
162     end
163 manus 9658 end
164    
165     meta_type: TYPE_I is
166     -- C type for `actual_type'
167     do
168     Result := actual_type.meta_type
169     end
170    
171 manus 56535 indexing
172     copyright: "Copyright (c) 1984-2006, Eiffel Software"
173 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
174 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
175     copying: "[
176     This file is part of Eiffel Software's Eiffel Development Environment.
177 manus 58027
178 manus 56535 Eiffel Software's Eiffel Development Environment is free
179     software; you can redistribute it and/or modify it under
180     the terms of the GNU General Public License as published
181     by the Free Software Foundation, version 2 of the License
182     (available at the URL listed under "license" above).
183 manus 58027
184 manus 56535 Eiffel Software's Eiffel Development Environment is
185     distributed in the hope that it will be useful, but
186     WITHOUT ANY WARRANTY; without even the implied warranty
187     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
188     See the GNU General Public License for more details.
189 manus 58027
190 manus 56535 You should have received a copy of the GNU General Public
191     License along with Eiffel Software's Eiffel Development
192     Environment; if not, write to the Free Software Foundation,
193     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
194     ]"
195     source: "[
196     Eiffel Software
197     356 Storke Road, Goleta, CA 93117 USA
198     Telephone 805-685-1006, Fax 805-685-6869
199     Website http://www.eiffel.com
200     Customer support http://support.eiffel.com
201     ]"
202    
203 manus 9658 end -- class LIKE_TYPE_A

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23