/[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 75567 - (show annotations)
Thu Nov 13 20:39:48 2008 UTC (11 years, 2 months ago) by manus
Original Path: trunk/Src/Eiffel/API/evaluated_type/none_a.e
File size: 3692 byte(s)
Added support for attachment marks at runtime in actual generic parameters:
- Updated runtime to understand annotation marks in our type arrays and all routines for 
  creating types and handling conformance.
- To properly handle conformance, a new entry in the type arrays generated in eparents.c have been
  added, it stores whether or not a type is attached. That is to say A inherits B, and when we check if
  !A conforms to !B, we modify the type array so that it has the attachment mark.
- Increased storable version number as old systems cannot understand the marks.
- Fixed catcall detection at runtime which was not properly handling attached arguments (as before
  we only check catcalls for non-void argument, but it the argument is attached, then we need to
  check that it is indeed not Void.
- Changed the Eiffel code generation so that even if we asked to create !A, we actually create A
  (i.e. we remove the annotation as they do not make sense for the type of an object).
- Made sure that a generic descriptor is created for attributes whose type is an attached non-generic type
  as well as a non-explicit type (e.g. formal/anchors).

1 indexing
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) is
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 is
29 -- Is `other' equivalent to the current object ?
30 do
31 Result := True
32 end
33
34 feature -- Properties
35
36 is_none: BOOLEAN is True
37 -- Is the current type a none type ?
38
39 is_full_named_type: BOOLEAN is True
40 -- Current is a full named type.
41
42 feature -- Access
43
44 hash_code: INTEGER is
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 is
51 -- Is the current type the same as `other' ?
52 do
53 Result := other.is_none
54 end
55
56 associated_class: CLASS_C is
57 do
58 -- No associated class
59 end
60
61 feature -- Output
62
63 dump: STRING is "NONE"
64 -- Dumped trace
65
66 ext_append_to (st: TEXT_FORMATTER; c: CLASS_C) is
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 is
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) is
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 is
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 is
97 -- Void C type
98 do
99 Result := reference_c_type
100 end
101
102 conform_to (other: TYPE_A): BOOLEAN is
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
112 end
113
114 indexing
115 copyright: "Copyright (c) 1984-2006, Eiffel Software"
116 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
117 licensing_options: "http://www.eiffel.com/licensing"
118 copying: "[
119 This file is part of Eiffel Software's Eiffel Development Environment.
120
121 Eiffel Software's Eiffel Development Environment is free
122 software; you can redistribute it and/or modify it under
123 the terms of the GNU General Public License as published
124 by the Free Software Foundation, version 2 of the License
125 (available at the URL listed under "license" above).
126
127 Eiffel Software's Eiffel Development Environment is
128 distributed in the hope that it will be useful, but
129 WITHOUT ANY WARRANTY; without even the implied warranty
130 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
131 See the GNU General Public License for more details.
132
133 You should have received a copy of the GNU General Public
134 License along with Eiffel Software's Eiffel Development
135 Environment; if not, write to the Free Software Foundation,
136 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
137 ]"
138 source: "[
139 Eiffel Software
140 356 Storke Road, Goleta, CA 93117 USA
141 Telephone 805-685-1006, Fax 805-685-6869
142 Website http://www.eiffel.com
143 Customer support http://support.eiffel.com
144 ]"
145
146 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