/[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 94983 - (show annotations)
Fri May 2 11:05:28 2014 UTC (5 years, 8 months ago) by jasonw
File size: 4310 byte(s)
<<Merged from trunk#94978.>>
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 DEANCHORED_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 base_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 (a_text_formatter: TEXT_FORMATTER; a_context_class: CLASS_C)
69 -- <Precursor>
70 do
71 ext_append_marks (a_text_formatter)
72 a_text_formatter.add ({SHARED_TEXT_ITEMS}.ti_none_class)
73 end
74
75 feature -- Generic conformance
76
77 generated_id (final_mode: BOOLEAN; a_context_type: TYPE_A): NATURAL_16
78 -- Id of a `like xxx'.
79 do
80 Result := {SHARED_GEN_CONF_LEVEL}.detachable_none_type
81 end
82
83 feature -- IL code generation
84
85 generate_gen_type_il (il_generator: IL_CODE_GENERATOR; use_info: BOOLEAN)
86 -- `use_info' is true iff we generate code for a
87 -- creation instruction.
88 do
89 il_generator.generate_none_type_instance
90 end
91
92 feature {COMPILER_EXPORTER}
93
94 create_info: CREATE_TYPE
95 -- Byte code information for entity type creation
96 do
97 create Result.make (as_attachment_mark_free)
98 end
99
100 c_type: REFERENCE_I
101 -- Void C type
102 do
103 Result := reference_c_type
104 end
105
106 feature {TYPE_A} -- Helpers
107
108 internal_conform_to (a_context_class: CLASS_C; other: TYPE_A; a_in_generic: BOOLEAN): BOOLEAN
109 -- <Precursor>
110 local
111 l_other_attachable_type: TYPE_A
112 do
113 -- Apply the same conformance rules as for a class type.
114 l_other_attachable_type := other.conformance_type
115 if
116 not l_other_attachable_type.is_void and then
117 (not l_other_attachable_type.is_expanded and then
118 (l_other_attachable_type.is_formal implies l_other_attachable_type.is_reference) or else
119 is_attached)
120 then
121 Result := True
122 if a_context_class.lace_class.is_void_safe_conformance then
123 Result :=
124 is_attachable_to (l_other_attachable_type) and then
125 (l_other_attachable_type.is_formal implies
126 (l_other_attachable_type.has_detachable_mark or else is_implicitly_attached))
127 end
128 if Result then
129 Result := is_processor_attachable_to (other)
130 end
131 end
132 end
133
134 note
135 copyright: "Copyright (c) 1984-2014, Eiffel Software"
136 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
137 licensing_options: "http://www.eiffel.com/licensing"
138 copying: "[
139 This file is part of Eiffel Software's Eiffel Development Environment.
140
141 Eiffel Software's Eiffel Development Environment is free
142 software; you can redistribute it and/or modify it under
143 the terms of the GNU General Public License as published
144 by the Free Software Foundation, version 2 of the License
145 (available at the URL listed under "license" above).
146
147 Eiffel Software's Eiffel Development Environment is
148 distributed in the hope that it will be useful, but
149 WITHOUT ANY WARRANTY; without even the implied warranty
150 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
151 See the GNU General Public License for more details.
152
153 You should have received a copy of the GNU General Public
154 License along with Eiffel Software's Eiffel Development
155 Environment; if not, write to the Free Software Foundation,
156 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
157 ]"
158 source: "[
159 Eiffel Software
160 5949 Hollister Ave., Goleta, CA 93117 USA
161 Telephone 805-685-1006, Fax 805-685-6869
162 Website http://www.eiffel.com
163 Customer support http://support.eiffel.com
164 ]"
165
166 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