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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69629 - (show annotations)
Mon Jul 23 21:36:18 2007 UTC (12 years, 6 months ago) by manus
File size: 5076 byte(s)
Creation of CAT_mono branch to implement variant/invariant proposal
1 indexing
2 description: "Representation of an anchored type"
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision$"
7
8 deferred class
9 LIKE_TYPE_A
10
11 inherit
12 TYPE_A
13 undefine
14 instantiation_in, same_as
15 redefine
16 actual_type,
17 conformance_type,
18 convert_to,
19 has_associated_class,
20 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 is_valid,
30 meta_type
31 end
32
33 feature -- Properties
34
35 actual_type: TYPE_A
36 -- Actual type of the anchored type in a given class
37
38 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 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
53 has_like: BOOLEAN is True
54 -- Does the type have anchored type in its definition ?
55
56 is_like: BOOLEAN is True
57 -- Is the type anchored one ?
58
59 is_loose: BOOLEAN is True
60 -- Does type depend on formal generic parameters and/or anchors?
61
62 is_basic: BOOLEAN is
63 -- Is the current actual type a basic one ?
64 do
65 Result := actual_type.is_basic
66 end
67
68 is_external: BOOLEAN is
69 -- Is current type based on an external class?
70 do
71 Result := actual_type.is_external
72 end
73
74 is_reference: BOOLEAN is
75 -- Is current actual type a reference one?
76 do
77 Result := actual_type.is_reference
78 end
79
80 is_expanded: BOOLEAN is
81 -- Is current actual type an expanded one?
82 do
83 Result := actual_type.is_expanded
84 end
85
86 is_none: BOOLEAN is
87 -- Is current actual type NONE?
88 do
89 Result := actual_type.is_none
90 end
91
92 is_valid: BOOLEAN is
93 -- Is current type valid?
94 do
95 Result := actual_type /= Void
96 end
97
98 same_as (other: TYPE_A): BOOLEAN is
99 -- Is the current type the same as `other' ?
100 deferred
101 end
102
103 feature -- Access
104
105 associated_class: CLASS_C is
106 -- Associated class
107 do
108 Result := actual_type.associated_class
109 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 instantiation_in (type: TYPE_A written_id: INTEGER): TYPE_A is
120 -- 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 instantiated_in (class_type: TYPE_A): TYPE_A is
126 -- Instantiation of Current in the context of `class_type'
127 -- assuming that Current is written in the associated class
128 -- of `class_type'.
129 local
130 t: like Current
131 do
132 t := twin
133 t.set_actual_type (actual_type.instantiated_in (class_type))
134 Result := t
135 end
136
137 conform_to (other: TYPE_A): BOOLEAN is
138 -- Does `actual_type' conform to `other'?
139 do
140 Result := actual_type.conform_to (other.conformance_type)
141 end
142
143 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 Result := actual_type.convert_to (a_context_class, a_target_type)
148 end
149
150 type_i: TYPE_I is
151 -- Reduced type of `actual_type'
152 local
153 cl_type : CL_TYPE_I
154 do
155 Result := actual_type.type_i
156 cl_type ?= Result
157
158 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 cl_type.set_cr_info (create_info)
162 end
163 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 indexing
172 copyright: "Copyright (c) 1984-2006, Eiffel Software"
173 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
174 licensing_options: "http://www.eiffel.com/licensing"
175 copying: "[
176 This file is part of Eiffel Software's Eiffel Development Environment.
177
178 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
184 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
190 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 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