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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 41738 - (hide annotations)
Fri Mar 5 18:59:26 2004 UTC (15 years, 10 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3020 byte(s)
Added definition of `is_external' to find if we are handling an external type.
Added definition of `reference_actual_type' in case we anchor to a basic type.
Renamed `internal_conform_to' into `conform_to' since `internal_conform_to'
  has now been removed from parent.
Fixed `type_i' so that when the type is expanded, there is no need to have
  a CREATE_INFO instance because no redefinition can occur on the anchor type.

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