/[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 76432 - (show annotations)
Mon Dec 29 23:41:59 2008 UTC (11 years ago) by manus
Original Path: trunk/Src/Eiffel/API/evaluated_type/none_a.e
File size: 3734 byte(s)
Removal of `is' keyword.
Replacement of `is' by `=' for constant definitions.
Replaced `indexing' by `note'.

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