/[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 58325 - (hide annotations)
Thu Apr 20 16:05:16 2006 UTC (13 years, 9 months ago) by manus
Original Path: trunk/Src/Eiffel/API/evaluated_type/like_type_a.e
File size: 5076 byte(s)
Moved trunk/Src/bench/Eiffel to trunk/Src/Eiffel.
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 manus 9658 is_like: BOOLEAN is True
47     -- Is the type anchored one ?
48    
49     has_like: BOOLEAN is True
50     -- Does the type have anchored type in its definition ?
51    
52 alexk 48822 is_loose: BOOLEAN is True
53     -- Does type depend on formal generic parameters and/or anchors?
54    
55 manus 9658 is_basic: BOOLEAN is
56     -- Is the current actual type a basic one ?
57     do
58 manus 11302 Result := actual_type.is_basic
59 manus 9658 end
60 alexk 55790
61 manus 41738 is_external: BOOLEAN is
62     -- Is current type based on an external class?
63     do
64     Result := actual_type.is_external
65     end
66 alexk 55790
67 manus 42626 is_reference: BOOLEAN is
68     -- Is current actual type a reference one?
69     do
70     Result := actual_type.is_reference
71     end
72 manus 9658
73 manus 42626 is_expanded: BOOLEAN is
74     -- Is current actual type an expanded one?
75     do
76     Result := actual_type.is_expanded
77     end
78 alexk 55790
79 manus 50192 is_none: BOOLEAN is
80     -- Is current actual type NONE?
81     do
82     Result := actual_type.is_none
83     end
84 manus 42626
85 manus 57371 is_valid: BOOLEAN is
86     -- Is current type valid?
87     do
88     Result := actual_type /= Void
89     end
90    
91 manus 9658 feature -- Access
92    
93     same_as (other: TYPE_A): BOOLEAN is
94     -- Is the current type the same as `other' ?
95     deferred
96     end
97    
98     has_associated_class: BOOLEAN is
99     -- Does Current have an associated class?
100     do
101 manus 11302 Result := actual_type /= Void and then
102     actual_type.has_associated_class
103 manus 9658 end
104    
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