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

Contents of /branches/eth/eve/Src/Eiffel/API/evaluated_type/unevaluated_like_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: 4808 byte(s)
<<Merged from trunk#92722.>>
1 note
2 description: "Like 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_LIKE_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 (a_string: like dump)
37 -- Initialize `anchor' to `a_string'
38 require
39 non_void_string: a_string /= Void
40 do
41 names_heap.put (a_string)
42 anchor_name_id := names_heap.found_item
43 ensure
44 set: anchor.is_equal (a_string)
45 end
46
47 feature -- Visitor
48
49 process (v: TYPE_A_VISITOR)
50 -- Process current element.
51 do
52 v.process_unevaluated_like_type (Current)
53 end
54
55 feature -- Access
56
57 anchor_name_id: INTEGER
58 -- Id of `anchor' in `names_heap'.
59
60 anchor: STRING
61 -- Anchor name
62 do
63 Result := names_heap.item (anchor_name_id)
64 end
65
66 feature -- Status report
67
68 has_associated_class: BOOLEAN = False
69 -- Does Current have associated class?
70
71 feature -- Access
72
73 base_class: CLASS_C
74 -- Class associated to the current type
75 do
76 end
77
78 feature -- Comparison
79
80 is_equivalent (other: like Current): BOOLEAN
81 -- Is `other' equivalent to the current object ?
82 do
83 Result := anchor_name_id = other.anchor_name_id and then
84 has_same_marks (other)
85 end
86
87 is_syntactically_equal (other: TYPE_A): BOOLEAN
88 -- <Precursor>
89 do
90 if attached {like Current} other then
91 Result := same_as (other)
92 elseif attached {LIKE_FEATURE} other as o then
93 Result := anchor_name_id = o.feature_name_id and then has_same_marks (o)
94 end
95 end
96
97 feature -- Output
98
99 ext_append_to (a_text_formatter: TEXT_FORMATTER; a_context_class: CLASS_C)
100 -- <Precursor>
101 -- Append Current type to `st'.
102 do
103 ext_append_marks (a_text_formatter)
104 a_text_formatter.process_keyword_text ({SHARED_TEXT_ITEMS}.ti_Like_keyword, Void)
105 a_text_formatter.add_space
106 a_text_formatter.add (anchor)
107 end
108
109 dump: STRING
110 do
111 create Result.make_empty
112 dump_marks (Result)
113 Result.append ("like ")
114 Result.append (anchor)
115 end
116
117 feature {TYPE_A} -- Helpers
118
119 internal_conform_to (a_context_class: CLASS_C; other: TYPE_A; a_in_generic: BOOLEAN): BOOLEAN
120 -- <Precursor>
121 do
122 end
123
124 internal_is_valid_for_class (a_class: CLASS_C): BOOLEAN
125 -- An unevaluated type is never valid.
126 do
127 end
128
129 feature {NONE} -- Implementation
130
131 same_as (other: TYPE_A): BOOLEAN
132 -- Is the current type the same as `other' ?
133 local
134 o: UNEVALUATED_LIKE_TYPE
135 do
136 o ?= other
137 Result := o /= Void and then
138 anchor_name_id = o.anchor_name_id and then
139 has_same_marks (o)
140 end
141
142 shared_create_info, create_info: CREATE_INFO
143 -- Byte code information for entity type creation
144 do
145 end
146
147 instantiation_in (type: TYPE_A; written_id: INTEGER): like Current
148 do
149 end
150
151 formal_instantiation_in (type, constraint: TYPE_A; written_id: INTEGER_32): like Current
152 do
153 end
154
155 formal_instantiated_in, instantiated_in (class_type: TYPE_A): like Current
156 do
157 end
158
159 evaluated_type_in_descendant (a_ancestor, a_descendant: CLASS_C; a_feature: FEATURE_I): like Current
160 do
161 end
162
163 invariant
164 non_void_anchor: anchor /= Void
165
166 note
167 copyright: "Copyright (c) 1984-2013, Eiffel Software"
168 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
169 licensing_options: "http://www.eiffel.com/licensing"
170 copying: "[
171 This file is part of Eiffel Software's Eiffel Development Environment.
172
173 Eiffel Software's Eiffel Development Environment is free
174 software; you can redistribute it and/or modify it under
175 the terms of the GNU General Public License as published
176 by the Free Software Foundation, version 2 of the License
177 (available at the URL listed under "license" above).
178
179 Eiffel Software's Eiffel Development Environment is
180 distributed in the hope that it will be useful, but
181 WITHOUT ANY WARRANTY; without even the implied warranty
182 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
183 See the GNU General Public License for more details.
184
185 You should have received a copy of the GNU General Public
186 License along with Eiffel Software's Eiffel Development
187 Environment; if not, write to the Free Software Foundation,
188 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
189 ]"
190 source: "[
191 Eiffel Software
192 5949 Hollister Ave., Goleta, CA 93117 USA
193 Telephone 805-685-1006, Fax 805-685-6869
194 Website http://www.eiffel.com
195 Customer support http://support.eiffel.com
196 ]"
197
198 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