/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e
ViewVC logotype

Contents of /branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 50374 - (show annotations)
Sat Apr 23 15:07:18 2005 UTC (14 years, 9 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3588 byte(s)
`convert_to' should be called on `actual_type'. This solves eweasel test valid 166.

1 indexing
2 description: "Representation of an anchored type"
3 date: "$Date$"
4 revision: "$Revision$"
5
6 deferred class
7 LIKE_TYPE_A
8
9 inherit
10 TYPE_A
11 undefine
12 same_as, solved_type, instantiation_in
13 redefine
14 actual_type, has_like, is_loose, is_like, is_external,
15 is_basic, instantiated_in, meta_type,
16 has_associated_class,
17 is_reference, is_expanded, is_none, convert_to
18 end
19
20 SHARED_LIKE_CONTROLER
21
22 feature -- Properties
23
24 actual_type: TYPE_A
25 -- Actual type of the anchored type in a given class
26
27 is_like: BOOLEAN is True
28 -- Is the type anchored one ?
29
30 has_like: BOOLEAN is True
31 -- Does the type have anchored type in its definition ?
32
33 is_loose: BOOLEAN is True
34 -- Does type depend on formal generic parameters and/or anchors?
35
36 class_id: INTEGER
37 -- Class ID of the class where the anchor is referenced
38
39 is_basic: BOOLEAN is
40 -- Is the current actual type a basic one ?
41 do
42 Result := actual_type.is_basic
43 end
44
45 is_external: BOOLEAN is
46 -- Is current type based on an external class?
47 do
48 Result := actual_type.is_external
49 end
50
51 is_reference: BOOLEAN is
52 -- Is current actual type a reference one?
53 do
54 Result := actual_type.is_reference
55 end
56
57 is_expanded: BOOLEAN is
58 -- Is current actual type an expanded one?
59 do
60 Result := actual_type.is_expanded
61 end
62
63 is_none: BOOLEAN is
64 -- Is current actual type NONE?
65 do
66 Result := actual_type.is_none
67 end
68
69 feature -- Access
70
71 same_as (other: TYPE_A): BOOLEAN is
72 -- Is the current type the same as `other' ?
73 deferred
74 end
75
76 has_associated_class: BOOLEAN is
77 -- Does Current have an associated class?
78 do
79 Result := actual_type /= Void and then
80 actual_type.has_associated_class
81 end
82
83 associated_class: CLASS_C is
84 -- Associated class
85 do
86 Result := actual_type.associated_class
87 end
88
89 feature -- Primitives
90
91 set_actual_type (a: TYPE_A) is
92 -- Assign `a' to `actual_type'.
93 do
94 actual_type := a
95 end
96
97 solved_type (feat_table: FEATURE_TABLE f: FEATURE_I): like Current is
98 -- Calculated type in function of the feature `f' which has
99 -- the type Current and the feautre table `feat_table
100 deferred
101 end
102
103 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
104 -- Instantiation of Current in the context of `class_type',
105 -- assuming that Current is written in class of id `written_id'.
106 deferred
107 end
108
109 instantiated_in (class_type: CL_TYPE_A): like Current is
110 -- Instantiation of Current in the context of `class_type'
111 -- assuming that Current is written in the associated class
112 -- of `class_type'.
113 do
114 Result := twin
115 Result.set_actual_type (actual_type.instantiated_in (class_type))
116 end
117
118 conform_to (other: TYPE_A): BOOLEAN is
119 -- Does `actual_type' conform to `other'?
120 do
121 Result := actual_type.conform_to (other.actual_type)
122 end
123
124 convert_to (a_context_class: CLASS_C; a_target_type: TYPE_A): BOOLEAN is
125 -- Does current convert to `a_target_type' in `a_context_class'?
126 -- Update `last_conversion_info' of AST_CONTEXT.
127 do
128 Result := actual_type.convert_to (a_context_class, a_target_type)
129 end
130
131 type_i: TYPE_I is
132 -- Reduced type of `actual_type'
133 local
134 cl_type : CL_TYPE_I
135 do
136 Result := actual_type.type_i
137 cl_type ?= Result
138
139 if cl_type /= Void and then not cl_type.is_expanded then
140 -- Remember that it's an anchored type, not needed
141 -- when handling expanded types.
142 cl_type.set_cr_info (create_info)
143 end
144 end
145
146 meta_type: TYPE_I is
147 -- C type for `actual_type'
148 do
149 Result := actual_type.meta_type
150 end
151
152 end -- class LIKE_TYPE_A

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23