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

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

Parent Directory Parent Directory | Revision Log Revision Log


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