/[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 48822 - (show annotations)
Tue Mar 1 10:37:05 2005 UTC (14 years, 11 months ago) by alexk
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3188 byte(s)
Added a feature to determine whether type is completely fixed or is subject
to changes because of anchored and/or formal generic types that are used
in its definition.

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
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 feature -- Access
64
65 same_as (other: TYPE_A): BOOLEAN is
66 -- Is the current type the same as `other' ?
67 deferred
68 end
69
70 has_associated_class: BOOLEAN is
71 -- Does Current have an associated class?
72 do
73 Result := actual_type /= Void and then
74 actual_type.has_associated_class
75 end
76
77 associated_class: CLASS_C is
78 -- Associated class
79 do
80 Result := actual_type.associated_class
81 end
82
83 feature -- Primitives
84
85 set_actual_type (a: TYPE_A) is
86 -- Assign `a' to `actual_type'.
87 do
88 actual_type := a
89 end
90
91 solved_type (feat_table: FEATURE_TABLE f: FEATURE_I): like Current is
92 -- Calculated type in function of the feature `f' which has
93 -- the type Current and the feautre table `feat_table
94 deferred
95 end
96
97 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
98 -- Instantiation of Current in the context of `class_type',
99 -- assuming that Current is written in class of id `written_id'.
100 deferred
101 end
102
103 instantiated_in (class_type: CL_TYPE_A): like Current is
104 -- Instantiation of Current in the context of `class_type'
105 -- assuming that Current is written in the associated class
106 -- of `class_type'.
107 do
108 Result := twin
109 Result.set_actual_type (actual_type.instantiated_in (class_type))
110 end
111
112 conform_to (other: TYPE_A): BOOLEAN is
113 -- Does `actual_type' conform to `other'?
114 do
115 Result := actual_type.conform_to (other.actual_type)
116 end
117
118 type_i: TYPE_I is
119 -- Reduced type of `actual_type'
120 local
121 cl_type : CL_TYPE_I
122 do
123 Result := actual_type.type_i
124 cl_type ?= Result
125
126 if cl_type /= Void and then not cl_type.is_expanded then
127 -- Remember that it's an anchored type, not needed
128 -- when handling expanded types.
129 cl_type.set_cr_info (create_info)
130 end
131 end
132
133 meta_type: TYPE_I is
134 -- C type for `actual_type'
135 do
136 Result := actual_type.meta_type
137 end
138
139 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