/[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 83524 - (show annotations)
Fri Jun 11 08:12:14 2010 UTC (9 years, 7 months ago) by jasonw
File size: 3766 byte(s)
<<Merged from trunk#83523.>>
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 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 st.add ({SHARED_TEXT_ITEMS}.ti_none_class)
71 end
72
73 feature -- Generic conformance
74
75 generated_id (final_mode: BOOLEAN; a_context_type: TYPE_A): NATURAL_16
76 -- Id of a `like xxx'.
77 do
78 Result := {SHARED_GEN_CONF_LEVEL}.none_type
79 end
80
81 feature -- IL code generation
82
83 generate_gen_type_il (il_generator: IL_CODE_GENERATOR; use_info: BOOLEAN)
84 -- `use_info' is true iff we generate code for a
85 -- creation instruction.
86 do
87 il_generator.generate_none_type_instance
88 end
89
90 feature {COMPILER_EXPORTER}
91
92 create_info: CREATE_TYPE
93 -- Byte code information for entity type creation
94 do
95 create Result.make (as_attachment_mark_free)
96 end
97
98 c_type: REFERENCE_I
99 -- Void C type
100 do
101 Result := reference_c_type
102 end
103
104 conform_to (a_context_class: CLASS_C; other: TYPE_A): BOOLEAN
105 -- Does Current conform to `other'?
106 local
107 l_type: TYPE_A
108 do
109 -- If `other' is attached, then NONE does not conform to it.
110 -- But it should not be `VOID_A' since VOID_A is only used as
111 -- return type for procedure
112 l_type := other.conformance_type
113 Result := not l_type.is_expanded and not l_type.is_void and then not l_type.is_attached and then
114 (l_type.is_formal implies l_type.is_reference)
115 end
116
117 note
118 copyright: "Copyright (c) 1984-2010, Eiffel Software"
119 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
120 licensing_options: "http://www.eiffel.com/licensing"
121 copying: "[
122 This file is part of Eiffel Software's Eiffel Development Environment.
123
124 Eiffel Software's Eiffel Development Environment is free
125 software; you can redistribute it and/or modify it under
126 the terms of the GNU General Public License as published
127 by the Free Software Foundation, version 2 of the License
128 (available at the URL listed under "license" above).
129
130 Eiffel Software's Eiffel Development Environment is
131 distributed in the hope that it will be useful, but
132 WITHOUT ANY WARRANTY; without even the implied warranty
133 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
134 See the GNU General Public License for more details.
135
136 You should have received a copy of the GNU General Public
137 License along with Eiffel Software's Eiffel Development
138 Environment; if not, write to the Free Software Foundation,
139 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
140 ]"
141 source: "[
142 Eiffel Software
143 5949 Hollister Ave., Goleta, CA 93117 USA
144 Telephone 805-685-1006, Fax 805-685-6869
145 Website http://www.eiffel.com
146 Customer support http://support.eiffel.com
147 ]"
148
149 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