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

Contents of /branches/eth/eve/Src/Eiffel/API/evaluated_type/typed_pointer_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 94740 - (show annotations)
Fri Mar 28 09:42:08 2014 UTC (5 years, 9 months ago) by jasonw
File size: 4805 byte(s)
<<Merged from trunk#94739.>>
1 note
2 description: "Actual type for typed pointer type."
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 TYPED_POINTER_A
9
10 inherit
11 BASIC_A
12 rename
13 make as cl_make
14 undefine
15 hash_code, generics, has_like, has_like_argument, parent_type,
16 deep_actual_type, context_free_type, ext_append_to, internal_conform_to,
17 has_formal_generic, is_loose, valid_generic, actual_argument_type,
18 formal_instantiated_in, instantiated_in, good_generics, error_generics, check_constraints,
19 expanded_deferred, valid_expanded_creation, update_dependance,
20 has_expanded, dump, duplicate, reference_type, formal_instantiation_in,
21 is_equivalent, instantiation_of, same_as, instantiation_in,
22 is_full_named_type, evaluated_type_in_descendant, is_explicit, is_known,
23 generate_cid, generate_cid_array, generate_cid_init, has_actual,
24 make_type_byte_code, generate_gen_type_il, internal_is_valid_for_class,
25 adapted_in, skeleton_adapted_in, is_class_valid, is_valid_generic_derivation,
26 dispatch_anchors, has_like_current, internal_generic_derivation,
27 internal_same_generic_derivation_as, generic_derivation, check_labels,
28 duplicate_for_instantiation
29 redefine
30 is_typed_pointer, c_type, base_class, process,
31 il_type_name, generic_il_type_name
32 end
33
34 GEN_TYPE_A
35 undefine
36 meta_type, is_basic,
37 description, instantiated_description, description_with_detachable_type,
38 generate_cecil_value, sk_value, element_type, cl_make, is_processor_attachable_to
39 redefine
40 is_typed_pointer, c_type, base_class, process, reference_type,
41 il_type_name, generic_il_type_name
42 end
43
44 create
45 make_typed
46
47 feature {NONE} -- Initialization
48
49 make_typed (a_type: TYPE_A)
50 -- Set `pointed_type' with `a_type'.
51 require
52 a_type_not_void: a_type /= Void
53 local
54 l_generics: like generics
55 do
56 create l_generics.make (1)
57 l_generics.extend (a_type)
58 make (base_class.class_id, l_generics)
59 ensure
60 pointed_type_set: pointed_type = a_type
61 end
62
63 feature -- Visitor
64
65 process (v: TYPE_A_VISITOR)
66 -- Process current element.
67 do
68 v.process_typed_pointer_a (Current)
69 end
70
71 feature -- Property
72
73 is_typed_pointer: BOOLEAN = True
74 -- Is current type a typed pointer type?
75
76 base_class: CLASS_C
77 -- Class POINTER
78 once
79 Result := System.typed_pointer_class.compiled_class
80 end
81
82 pointed_type: TYPE_A
83 -- Type pointed by current if any.
84 do
85 Result := generics.first
86 end
87
88 feature -- IL code generation
89
90 il_type_name (a_prefix: STRING; a_context_type: TYPE_A): STRING
91 -- Name of current class
92 local
93 t: TYPE_A
94 do
95 t := generics.first
96 Result := t.il_type_name (a_prefix, a_context_type).twin
97 Result.append ("&")
98 if a_prefix /= Void and then t.is_external then
99 Result.precede ('.')
100 Result.prepend (a_prefix)
101 end
102 end
103
104 generic_il_type_name (a_context_type: TYPE_A): STRING
105 -- Name of current class
106 do
107 Result := generics.first.generic_il_type_name (a_context_type).twin
108 Result.append ("&")
109 end
110
111 feature {COMPILER_EXPORTER} -- Access
112
113 reference_type: GEN_TYPE_A
114 -- Reference counterpart of an expanded type
115 do
116 create Result.make (class_id, duplicate.generics)
117 if class_declaration_mark = expanded_mark then
118 Result.set_expanded_class_mark
119 end
120 Result.set_reference_mark
121 end
122
123 c_type: TYPED_POINTER_I
124 -- Pointer C type
125 do
126 create Result.make (pointed_type.c_type)
127 end
128
129 note
130 copyright: "Copyright (c) 1984-2014, Eiffel Software"
131 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
132 licensing_options: "http://www.eiffel.com/licensing"
133 copying: "[
134 This file is part of Eiffel Software's Eiffel Development Environment.
135
136 Eiffel Software's Eiffel Development Environment is free
137 software; you can redistribute it and/or modify it under
138 the terms of the GNU General Public License as published
139 by the Free Software Foundation, version 2 of the License
140 (available at the URL listed under "license" above).
141
142 Eiffel Software's Eiffel Development Environment is
143 distributed in the hope that it will be useful, but
144 WITHOUT ANY WARRANTY; without even the implied warranty
145 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
146 See the GNU General Public License for more details.
147
148 You should have received a copy of the GNU General Public
149 License along with Eiffel Software's Eiffel Development
150 Environment; if not, write to the Free Software Foundation,
151 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
152 ]"
153 source: "[
154 Eiffel Software
155 5949 Hollister Ave., Goleta, CA 93117 USA
156 Telephone 805-685-1006, Fax 805-685-6869
157 Website http://www.eiffel.com
158 Customer support http://support.eiffel.com
159 ]"
160
161 end -- class TYPED_POINTER_A

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23