/[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 56535 - (show annotations)
Tue Jan 17 01:37:10 2006 UTC (14 years ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 5212 byte(s)
Added text of the GPL license to all classes of the compiler.

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