/[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 58027 - (show annotations)
Wed Apr 5 07:08:57 2006 UTC (13 years, 9 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 5076 byte(s)
Fixed mixing paranthesis in indexing clause for the licensing.
Added missing license reference in newly created Eiffel classes.

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 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 is_loose: BOOLEAN is True
53 -- Does type depend on formal generic parameters and/or anchors?
54
55 is_basic: BOOLEAN is
56 -- Is the current actual type a basic one ?
57 do
58 Result := actual_type.is_basic
59 end
60
61 is_external: BOOLEAN is
62 -- Is current type based on an external class?
63 do
64 Result := actual_type.is_external
65 end
66
67 is_reference: BOOLEAN is
68 -- Is current actual type a reference one?
69 do
70 Result := actual_type.is_reference
71 end
72
73 is_expanded: BOOLEAN is
74 -- Is current actual type an expanded one?
75 do
76 Result := actual_type.is_expanded
77 end
78
79 is_none: BOOLEAN is
80 -- Is current actual type NONE?
81 do
82 Result := actual_type.is_none
83 end
84
85 is_valid: BOOLEAN is
86 -- Is current type valid?
87 do
88 Result := actual_type /= Void
89 end
90
91 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 Result := actual_type /= Void and then
102 actual_type.has_associated_class
103 end
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