/[eiffelstudio]/branches/eth/eve/Src/Eiffel/API/evaluated_type/unevaluated_qualified_anchored_type.e
ViewVC logotype

Contents of /branches/eth/eve/Src/Eiffel/API/evaluated_type/unevaluated_qualified_anchored_type.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92723 - (show annotations)
Fri Jun 21 07:47:04 2013 UTC (6 years, 5 months ago) by jasonw
File size: 5897 byte(s)
<<Merged from trunk#92722.>>
1 note
2 description: "Qualified anchored types that have not been evaluated (has not gone past Degree 4)."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision$"
7
8 class
9 UNEVALUATED_QUALIFIED_ANCHORED_TYPE
10
11 inherit
12 LIKE_TYPE_A
13 redefine
14 base_class,
15 internal_conform_to,
16 evaluated_type_in_descendant,
17 has_associated_class,
18 formal_instantiated_in,
19 formal_instantiation_in,
20 instantiated_in,
21 instantiation_in,
22 internal_is_valid_for_class,
23 is_syntactically_equal
24 end
25
26 SHARED_NAMES_HEAP
27 export
28 {NONE} all
29 end
30
31 create
32 make
33
34 feature {NONE} -- Initialization
35
36 make (q: like qualifier; c: like chain)
37 -- Create an object with qualifier `q' and chain `c'.
38 require
39 q_attached: attached q
40 c_attached: attached c
41 do
42 qualifier := q
43 chain := c
44 ensure
45 qualifier_set: qualifier = q
46 chain_set: chain = c
47 end
48
49 feature -- Visitor
50
51 process (v: TYPE_A_VISITOR)
52 -- Process current element.
53 do
54 v.process_unevaluated_qualified_anchored_type (Current)
55 end
56
57 feature -- Access
58
59 qualifier: TYPE_A
60 -- First part of the type:
61 -- A - for "like {A}.b.c"
62 -- like a - for "like a.b.c"
63 -- like Current - for "like Current.b.c"
64
65 chain: SPECIAL [INTEGER]
66 -- Second part of the type:
67 -- ["b", "c"] for "like {A}.b.c", "like a.b.c", "like Current.b.c"
68 -- IDs are from NAMES_HEAP.
69
70 feature -- Status report
71
72 has_associated_class: BOOLEAN = False
73 -- Does Current have associated class?
74
75 feature -- Access
76
77 base_class: CLASS_C
78 -- Class associated to the current type
79 do
80 end
81
82 feature -- Comparison
83
84 is_equivalent (other: like Current): BOOLEAN
85 -- Is `other' equivalent to the current object ?
86 do
87 Result :=
88 equivalent (qualifier, other.qualifier) and then
89 chain ~ other.chain and then
90 has_same_marks (other)
91 end
92
93 is_syntactically_equal (other: TYPE_A): BOOLEAN
94 -- <Precursor>
95 do
96 if attached {like Current} other then
97 Result := same_as (other)
98 elseif attached {QUALIFIED_ANCHORED_TYPE_A} other as o then
99 Result :=
100 qualifier.is_syntactically_equal (o.qualifier) and then
101 chain ~ o.chain and then
102 has_same_marks (o)
103 end
104 end
105
106 feature -- Output
107
108 ext_append_to (a_text_formatter: TEXT_FORMATTER; a_context_class: CLASS_C)
109 -- <Precursor>
110 -- Append Current type to `st'.
111 local
112 i: INTEGER
113 do
114 ext_append_marks (a_text_formatter)
115 if qualifier.is_like then
116 qualifier.ext_append_to (a_text_formatter, a_context_class)
117 else
118 a_text_formatter.process_keyword_text ({SHARED_TEXT_ITEMS}.ti_Like_keyword, Void)
119 a_text_formatter.add_space
120 a_text_formatter.process_symbol_text ({SHARED_TEXT_ITEMS}.ti_l_curly)
121 qualifier.ext_append_to (a_text_formatter, a_context_class)
122 a_text_formatter.process_symbol_text ({SHARED_TEXT_ITEMS}.ti_r_curly)
123 end
124 from
125 until
126 i >= chain.count
127 loop
128 a_text_formatter.process_symbol_text ({SHARED_TEXT_ITEMS}.ti_dot)
129 a_text_formatter.add (names_heap.item (chain [i]))
130 i := i + 1
131 end
132 end
133
134 dump: STRING
135 local
136 i: INTEGER
137 do
138 create Result.make_empty
139 dump_marks (Result)
140 Result.append ("like {")
141 Result.append_string (qualifier.dump)
142 Result.append_character ('}')
143 from
144 until
145 i >= chain.count
146 loop
147 Result.append_character ('.')
148 Result.append_string (names_heap.item (chain [i]))
149 i := i + 1
150 end
151 end
152
153 feature {TYPE_A} -- Helpers
154
155 internal_conform_to (a_context_class: CLASS_C; other: TYPE_A; a_in_generic: BOOLEAN): BOOLEAN
156 -- <Precursor>
157 do
158 end
159
160 internal_is_valid_for_class (a_class: CLASS_C): BOOLEAN
161 -- An unevaluated type is never valid.
162 do
163 end
164
165 feature {NONE} -- Implementation
166
167 same_as (other: TYPE_A): BOOLEAN
168 -- <Precursor>
169 do
170 -- The precondition of `is_equivalent' specifies that both types should be valid.
171 -- Since this is not a valid type, the result is false.
172 end
173
174 shared_create_info, create_info: CREATE_INFO
175 -- Byte code information for entity type creation
176 do
177 end
178
179 instantiation_in (type: TYPE_A; written_id: INTEGER): like Current
180 do
181 end
182
183 formal_instantiated_in, instantiated_in (class_type: TYPE_A): like Current
184 do
185 end
186
187 formal_instantiation_in (type, constraint: TYPE_A; written_id: INTEGER_32): like Current
188 do
189
190 end
191
192 evaluated_type_in_descendant (a_ancestor, a_descendant: CLASS_C; a_feature: FEATURE_I): like Current
193 do
194 end
195
196 invariant
197 qualifier_attached: qualifier /= Void
198 chain_attached: chain /= Void
199
200 note
201 copyright: "Copyright (c) 1984-2013, Eiffel Software"
202 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
203 licensing_options: "http://www.eiffel.com/licensing"
204 copying: "[
205 This file is part of Eiffel Software's Eiffel Development Environment.
206
207 Eiffel Software's Eiffel Development Environment is free
208 software; you can redistribute it and/or modify it under
209 the terms of the GNU General Public License as published
210 by the Free Software Foundation, version 2 of the License
211 (available at the URL listed under "license" above).
212
213 Eiffel Software's Eiffel Development Environment is
214 distributed in the hope that it will be useful, but
215 WITHOUT ANY WARRANTY; without even the implied warranty
216 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
217 See the GNU General Public License for more details.
218
219 You should have received a copy of the GNU General Public
220 License along with Eiffel Software's Eiffel Development
221 Environment; if not, write to the Free Software Foundation,
222 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
223 ]"
224 source: "[
225 Eiffel Software
226 5949 Hollister Ave., Goleta, CA 93117 USA
227 Telephone 805-685-1006, Fax 805-685-6869
228 Website http://www.eiffel.com
229 Customer support http://support.eiffel.com
230 ]"
231
232 end -- class UNEVALUATED_LIKE_TYPE

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23