/[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 44434 - (show annotations)
Wed Jul 21 04:49:24 2004 UTC (15 years, 6 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3082 byte(s)
Removed support for `reference' types:
  - removed `reference_actual_type'.
  - added `is_conformant_to' which enables us to find if one type inherits
    from another one in a conformant way. It is needed for checking constraint
	genericity when actual generic is an expanded and constraint is a reference.
	Before we were using `reference_actual_type.conform_to' but since we
	removed it, we need something else and this is `is_conformant_to'.

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_like, is_external,
15 is_basic, instantiated_in, meta_type,
16 has_associated_class,
17 is_reference, is_expanded
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 class_id: INTEGER
34 -- Class ID of the class where the anchor is referenced
35
36 is_basic: BOOLEAN is
37 -- Is the current actual type a basic one ?
38 do
39 Result := actual_type.is_basic
40 end
41
42 is_external: BOOLEAN is
43 -- Is current type based on an external class?
44 do
45 Result := actual_type.is_external
46 end
47
48 is_reference: BOOLEAN is
49 -- Is current actual type a reference one?
50 do
51 Result := actual_type.is_reference
52 end
53
54 is_expanded: BOOLEAN is
55 -- Is current actual type an expanded one?
56 do
57 Result := actual_type.is_expanded
58 end
59
60 feature -- Access
61
62 same_as (other: TYPE_A): BOOLEAN is
63 -- Is the current type the same as `other' ?
64 deferred
65 end
66
67 has_associated_class: BOOLEAN is
68 -- Does Current have an associated class?
69 do
70 Result := actual_type /= Void and then
71 actual_type.has_associated_class
72 end
73
74 associated_class: CLASS_C is
75 -- Associated class
76 do
77 Result := actual_type.associated_class
78 end
79
80 feature -- Primitives
81
82 set_actual_type (a: TYPE_A) is
83 -- Assign `a' to `actual_type'.
84 do
85 actual_type := a
86 end
87
88 solved_type (feat_table: FEATURE_TABLE f: FEATURE_I): like Current is
89 -- Calculated type in function of the feature `f' which has
90 -- the type Current and the feautre table `feat_table
91 deferred
92 end
93
94 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
95 -- Instantiation of Current in the context of `class_type',
96 -- assuming that Current is written in class of id `written_id'.
97 deferred
98 end
99
100 instantiated_in (class_type: CL_TYPE_A): like Current is
101 -- Instantiation of Current in the context of `class_type'
102 -- assuming that Current is written in the associated class
103 -- of `class_type'.
104 do
105 Result := twin
106 Result.set_actual_type (actual_type.instantiated_in (class_type))
107 end
108
109 conform_to (other: TYPE_A): BOOLEAN is
110 -- Does `actual_type' conform to `other'?
111 do
112 Result := actual_type.conform_to (other.actual_type)
113 end
114
115 type_i: TYPE_I is
116 -- Reduced type of `actual_type'
117 local
118 cl_type : CL_TYPE_I
119 do
120 Result := actual_type.type_i
121 cl_type ?= Result
122
123 if cl_type /= Void and then not cl_type.is_expanded then
124 -- Remember that it's an anchored type, not needed
125 -- when handling expanded types.
126 cl_type.set_cr_info (create_info)
127 end
128 end
129
130 meta_type: TYPE_I is
131 -- C type for `actual_type'
132 do
133 Result := actual_type.meta_type
134 end
135
136 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