/[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 48822 - (hide annotations)
Tue Mar 1 10:37:05 2005 UTC (14 years, 10 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 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 alexk 48822 actual_type, has_like, is_loose, is_like, is_external,
15 manus 9658 is_basic, instantiated_in, meta_type,
16 manus 44434 has_associated_class,
17 manus 42626 is_reference, is_expanded
18 manus 9658 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 manus 41738
27 manus 9658 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 alexk 48822 is_loose: BOOLEAN is True
34     -- Does type depend on formal generic parameters and/or anchors?
35    
36 manus 26913 class_id: INTEGER
37 manus 9658 -- 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 manus 11302 Result := actual_type.is_basic
43 manus 9658 end
44 manus 41738
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 manus 42626
51     is_reference: BOOLEAN is
52     -- Is current actual type a reference one?
53     do
54     Result := actual_type.is_reference
55     end
56 manus 9658
57 manus 42626 is_expanded: BOOLEAN is
58     -- Is current actual type an expanded one?
59     do
60     Result := actual_type.is_expanded
61     end
62    
63 manus 9658 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 manus 11302 Result := actual_type /= Void and then
74     actual_type.has_associated_class
75 manus 9658 end
76    
77 manus 11302 associated_class: CLASS_C is
78 manus 9658 -- Associated class
79     do
80 manus 11302 Result := actual_type.associated_class
81 manus 9658 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 manus 26913 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
98 manus 9658 -- 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 manus 40762 Result := twin
109 manus 9658 Result.set_actual_type (actual_type.instantiated_in (class_type))
110     end
111    
112 manus 41738 conform_to (other: TYPE_A): BOOLEAN is
113     -- Does `actual_type' conform to `other'?
114 manus 9658 do
115 manus 41738 Result := actual_type.conform_to (other.actual_type)
116 manus 9658 end
117    
118     type_i: TYPE_I is
119     -- Reduced type of `actual_type'
120 manus 10886 local
121     cl_type : CL_TYPE_I
122 manus 9658 do
123     Result := actual_type.type_i
124 manus 10886 cl_type ?= Result
125    
126 manus 41738 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 manus 10886 cl_type.set_cr_info (create_info)
130     end
131 manus 9658 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