/[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 69888 - (hide annotations)
Sat Aug 4 01:44:59 2007 UTC (12 years, 5 months ago) by martins
File size: 5333 byte(s)
bug fixes, not yet everything is working
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 juliant 69650 is_monomorph,
31 alexk 56027 meta_type
32 manus 9658 end
33    
34     feature -- Properties
35    
36     actual_type: TYPE_A
37     -- Actual type of the anchored type in a given class
38 alexk 55790
39 alexk 56027 conformance_type: TYPE_A is
40     -- Type which is used to check conformance
41     do
42     -- `conformance_type' has to be called because
43     -- `actual_type' may yield yet another anchored type.
44     Result := actual_type.conformance_type
45     end
46    
47 martins 68030 has_associated_class: BOOLEAN is
48     -- Does Current have an associated class?
49     do
50     Result := actual_type /= Void and then
51     actual_type.has_associated_class
52     end
53 manus 9658
54     has_like: BOOLEAN is True
55     -- Does the type have anchored type in its definition ?
56    
57 martins 68030 is_like: BOOLEAN is True
58     -- Is the type anchored one ?
59    
60 alexk 48822 is_loose: BOOLEAN is True
61     -- Does type depend on formal generic parameters and/or anchors?
62    
63 manus 9658 is_basic: BOOLEAN is
64     -- Is the current actual type a basic one ?
65     do
66 manus 11302 Result := actual_type.is_basic
67 manus 9658 end
68 alexk 55790
69 manus 41738 is_external: BOOLEAN is
70     -- Is current type based on an external class?
71     do
72     Result := actual_type.is_external
73     end
74 alexk 55790
75 manus 42626 is_reference: BOOLEAN is
76     -- Is current actual type a reference one?
77     do
78     Result := actual_type.is_reference
79     end
80 manus 9658
81 manus 42626 is_expanded: BOOLEAN is
82     -- Is current actual type an expanded one?
83     do
84     Result := actual_type.is_expanded
85     end
86 alexk 55790
87 manus 50192 is_none: BOOLEAN is
88     -- Is current actual type NONE?
89     do
90     Result := actual_type.is_none
91     end
92 manus 42626
93 manus 57371 is_valid: BOOLEAN is
94     -- Is current type valid?
95     do
96     Result := actual_type /= Void
97     end
98    
99 juliant 69650 is_monomorph: BOOLEAN is
100     -- Is the current type monomorph?
101     do
102 martins 69888 -- if actual_type.is_like then
103     -- Result := conformance_type.is_monomorph
104     -- else
105 juliant 69650 Result := actual_type.is_monomorph
106 martins 69888 -- end
107 juliant 69650 end
108    
109 manus 9658 same_as (other: TYPE_A): BOOLEAN is
110     -- Is the current type the same as `other' ?
111     deferred
112     end
113    
114 martins 68030 feature -- Access
115 manus 9658
116 manus 11302 associated_class: CLASS_C is
117 manus 9658 -- Associated class
118     do
119 manus 11302 Result := actual_type.associated_class
120 manus 9658 end
121    
122     feature -- Primitives
123    
124     set_actual_type (a: TYPE_A) is
125     -- Assign `a' to `actual_type'.
126     do
127     actual_type := a
128     end
129    
130 alexk 55790 instantiation_in (type: TYPE_A written_id: INTEGER): TYPE_A is
131 manus 9658 -- Instantiation of Current in the context of `class_type',
132     -- assuming that Current is written in class of id `written_id'.
133     deferred
134     end
135    
136 alexk 55790 instantiated_in (class_type: TYPE_A): TYPE_A is
137 manus 9658 -- Instantiation of Current in the context of `class_type'
138     -- assuming that Current is written in the associated class
139     -- of `class_type'.
140 alexk 55790 local
141     t: like Current
142 manus 9658 do
143 alexk 55790 t := twin
144     t.set_actual_type (actual_type.instantiated_in (class_type))
145     Result := t
146 manus 9658 end
147    
148 juliant 69690 is_conforming_descendant (other: TYPE_A): BOOLEAN is
149 manus 41738 -- Does `actual_type' conform to `other'?
150 manus 9658 do
151 juliant 69690 Result := actual_type.is_conforming_descendant (other.conformance_type)
152 manus 9658 end
153    
154 manus 50374 convert_to (a_context_class: CLASS_C; a_target_type: TYPE_A): BOOLEAN is
155     -- Does current convert to `a_target_type' in `a_context_class'?
156     -- Update `last_conversion_info' of AST_CONTEXT.
157     do
158 alexk 55790 Result := actual_type.convert_to (a_context_class, a_target_type)
159 manus 50374 end
160    
161 manus 9658 type_i: TYPE_I is
162     -- Reduced type of `actual_type'
163 manus 10886 local
164     cl_type : CL_TYPE_I
165 manus 9658 do
166     Result := actual_type.type_i
167 manus 10886 cl_type ?= Result
168    
169 manus 41738 if cl_type /= Void and then not cl_type.is_expanded then
170     -- Remember that it's an anchored type, not needed
171     -- when handling expanded types.
172 manus 10886 cl_type.set_cr_info (create_info)
173     end
174 manus 9658 end
175    
176     meta_type: TYPE_I is
177     -- C type for `actual_type'
178     do
179     Result := actual_type.meta_type
180     end
181    
182 manus 56535 indexing
183     copyright: "Copyright (c) 1984-2006, Eiffel Software"
184 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
185 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
186     copying: "[
187     This file is part of Eiffel Software's Eiffel Development Environment.
188 manus 58027
189 manus 56535 Eiffel Software's Eiffel Development Environment is free
190     software; you can redistribute it and/or modify it under
191     the terms of the GNU General Public License as published
192     by the Free Software Foundation, version 2 of the License
193     (available at the URL listed under "license" above).
194 manus 58027
195 manus 56535 Eiffel Software's Eiffel Development Environment is
196     distributed in the hope that it will be useful, but
197     WITHOUT ANY WARRANTY; without even the implied warranty
198     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
199     See the GNU General Public License for more details.
200 manus 58027
201 manus 56535 You should have received a copy of the GNU General Public
202     License along with Eiffel Software's Eiffel Development
203     Environment; if not, write to the Free Software Foundation,
204     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
205     ]"
206     source: "[
207     Eiffel Software
208     356 Storke Road, Goleta, CA 93117 USA
209     Telephone 805-685-1006, Fax 805-685-6869
210     Website http://www.eiffel.com
211     Customer support http://support.eiffel.com
212     ]"
213    
214 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