/[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 74866 - (hide annotations)
Mon Sep 29 16:28:32 2008 UTC (11 years, 3 months ago) by manus
Original Path: trunk/Src/Eiffel/API/evaluated_type/none_a.e
File size: 3676 byte(s)
Refactored the code for simplification of the runtime type encoding code generation.
Fixed an issue where A [INTEGER], A [?INTEGER] and A [!INTEGER] would generate 3 different
  CLASS_TYPEs instances where one is enough since an expanded type is always attached.
Added support (but disabled it for the time being) for encoding the attachment mark in the
  runtime type encoding, this is done via {TYPE_A}.annotation_flags which currently always
  return 0.
Changed the way `eparents' is generated, instead of generating again the class name, we simply
  generate the type id and we use that `type_id' to get the class name via the `cn_generator' field
  of the `struct cnode' structure.

1 dinov 3375 indexing
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 manus 9656 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     process (v: TYPE_A_VISITOR) is
21     -- Process current element.
22     do
23     v.process_none_a (Current)
24     end
25    
26 manus 9656 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 dinov 3078 feature -- Properties
35 grator 18
36 manus 9656 is_none: BOOLEAN is True
37 grator 18 -- Is the current type a none type ?
38    
39 manus 44539 is_full_named_type: BOOLEAN is True
40     -- Current is a full named type.
41    
42 dinov 3180 feature -- Access
43    
44 manus 72419 hash_code: INTEGER is
45     -- Hash code for current type
46     do
47     Result := {SHARED_HASH_CODE}.none_code
48     end
49    
50 dinov 3180 same_as (other: TYPE_A): BOOLEAN is
51     -- Is the current type the same as `other' ?
52     do
53 manus 9656 Result := other.is_none
54     end
55 dinov 3180
56 manus 11302 associated_class: CLASS_C is
57     do
58     -- No associated class
59     end
60    
61 dinov 3078 feature -- Output
62    
63 manus 9656 dump: STRING is "NONE"
64 grator 18 -- Dumped trace
65    
66 martins 67227 ext_append_to (st: TEXT_FORMATTER; c: CLASS_C) is
67 grator 296 do
68 manus 72419 st.add ({SHARED_TEXT_ITEMS}.ti_none_class)
69 manus 9656 end
70 grator 296
71 manus 72419 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 dinov 3180 feature {COMPILER_EXPORTER}
89 dinov 3078
90 manus 9656 create_info: CREATE_TYPE is
91     -- Byte code information for entity type creation
92     do
93 manus 72419 create Result.make (Current)
94 manus 9656 end
95    
96 manus 72419 c_type: REFERENCE_I is
97 grator 18 -- Void C type
98 manus 72419 do
99     Result := reference_c_type
100 manus 9656 end
101 grator 18
102 manus 41740 conform_to (other: TYPE_A): BOOLEAN is
103     -- Does Current conform to `other'?
104 manus 48130 local
105     l_type: TYPE_A
106 grator 18 do
107 alexk 70996 -- If `other' is attached, then NONE does not conform to it.
108 manus 48130 -- But it should not be `VOID_A' since VOID_A is only used as
109     -- return type for procedure
110 alexk 55786 l_type := other.conformance_type
111 alexk 70996 Result := not l_type.is_expanded and not l_type.is_void and then not l_type.is_attached
112 manus 9656 end
113 grator 18
114 manus 56535 indexing
115     copyright: "Copyright (c) 1984-2006, Eiffel Software"
116 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
117 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
118     copying: "[
119     This file is part of Eiffel Software's Eiffel Development Environment.
120 manus 58027
121 manus 56535 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 manus 58027
127 manus 56535 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 manus 58027
133 manus 56535 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 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