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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 88881 - (show annotations)
Fri Jun 15 12:21:45 2012 UTC (7 years, 7 months ago) by jasonw
File size: 4545 byte(s)
<<Merged from trunk#88880.>>
1 note
2 description: "Actual type for NONE."
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 NONE_A
10
11 inherit
12 ATTACHABLE_TYPE_A
13 redefine
14 is_none, dump, c_type, same_as, is_full_named_type, generated_id,
15 generate_gen_type_il
16 end
17
18 feature -- Visitor
19
20 process (v: TYPE_A_VISITOR)
21 -- Process current element.
22 do
23 v.process_none_a (Current)
24 end
25
26 feature -- Comparison
27
28 is_equivalent (other: like Current): BOOLEAN
29 -- Is `other' equivalent to the current object ?
30 do
31 Result := True
32 end
33
34 feature -- Properties
35
36 is_none: BOOLEAN = True
37 -- Is the current type a none type ?
38
39 is_full_named_type: BOOLEAN = True
40 -- Current is a full named type.
41
42 feature -- Access
43
44 hash_code: INTEGER
45 -- Hash code for current type
46 do
47 Result := {SHARED_HASH_CODE}.none_code
48 end
49
50 same_as (other: TYPE_A): BOOLEAN
51 -- Is the current type the same as `other' ?
52 do
53 if other.is_valid then
54 Result := other.is_none
55 end
56 end
57
58 associated_class: CLASS_C
59 do
60 -- No associated class
61 end
62
63 feature -- Output
64
65 dump: STRING = "NONE"
66 -- Dumped trace
67
68 ext_append_to (st: TEXT_FORMATTER; c: CLASS_C)
69 do
70 if
71 not has_attached_mark and then not has_detachable_mark and then
72 not is_attached and then not is_implicitly_attached
73 then
74 -- There is no explicit attachment mark, let's put an assumed one.
75 st.process_symbol_text ({SHARED_TEXT_ITEMS}.ti_l_bracket)
76 st.process_keyword_text ({SHARED_TEXT_ITEMS}.ti_detachable_keyword, Void)
77 st.process_symbol_text ({SHARED_TEXT_ITEMS}.ti_r_bracket)
78 st.add_space
79 end
80 ext_append_marks (st)
81 st.add ({SHARED_TEXT_ITEMS}.ti_none_class)
82 end
83
84 feature -- Generic conformance
85
86 generated_id (final_mode: BOOLEAN; a_context_type: TYPE_A): NATURAL_16
87 -- Id of a `like xxx'.
88 do
89 Result := {SHARED_GEN_CONF_LEVEL}.detachable_none_type
90 end
91
92 feature -- IL code generation
93
94 generate_gen_type_il (il_generator: IL_CODE_GENERATOR; use_info: BOOLEAN)
95 -- `use_info' is true iff we generate code for a
96 -- creation instruction.
97 do
98 il_generator.generate_none_type_instance
99 end
100
101 feature {COMPILER_EXPORTER}
102
103 create_info: CREATE_TYPE
104 -- Byte code information for entity type creation
105 do
106 create Result.make (as_attachment_mark_free)
107 end
108
109 c_type: REFERENCE_I
110 -- Void C type
111 do
112 Result := reference_c_type
113 end
114
115 conform_to (a_context_class: CLASS_C; other: TYPE_A): BOOLEAN
116 -- Does Current conform to `other'?
117 do
118 -- Apply the same conformance rules as for a class type.
119 if
120 attached {ATTACHABLE_TYPE_A} other.conformance_type as other_attachable_type and then
121 not other_attachable_type.is_expanded and then
122 (other_attachable_type.is_formal implies other_attachable_type.is_reference)
123 then
124 Result := True
125 if a_context_class.lace_class.is_void_safe_conformance then
126 Result :=
127 is_attachable_to (other_attachable_type) and then
128 (other_attachable_type.is_formal implies
129 (other_attachable_type.has_detachable_mark or else is_implicitly_attached))
130 end
131 if Result then
132 Result := is_processor_attachable_to (other)
133 end
134 end
135 end
136
137 note
138 copyright: "Copyright (c) 1984-2012, Eiffel Software"
139 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
140 licensing_options: "http://www.eiffel.com/licensing"
141 copying: "[
142 This file is part of Eiffel Software's Eiffel Development Environment.
143
144 Eiffel Software's Eiffel Development Environment is free
145 software; you can redistribute it and/or modify it under
146 the terms of the GNU General Public License as published
147 by the Free Software Foundation, version 2 of the License
148 (available at the URL listed under "license" above).
149
150 Eiffel Software's Eiffel Development Environment is
151 distributed in the hope that it will be useful, but
152 WITHOUT ANY WARRANTY; without even the implied warranty
153 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
154 See the GNU General Public License for more details.
155
156 You should have received a copy of the GNU General Public
157 License along with Eiffel Software's Eiffel Development
158 Environment; if not, write to the Free Software Foundation,
159 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
160 ]"
161 source: "[
162 Eiffel Software
163 5949 Hollister Ave., Goleta, CA 93117 USA
164 Telephone 805-685-1006, Fax 805-685-6869
165 Website http://www.eiffel.com
166 Customer support http://support.eiffel.com
167 ]"
168
169 end -- class NONE_A

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23