/[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 50192 - (hide annotations)
Tue Apr 19 04:53:40 2005 UTC (14 years, 9 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3299 byte(s)
Added proper definition of `is_none' for anchored types.

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 50192 is_reference, is_expanded, is_none
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 manus 50192
63     is_none: BOOLEAN is
64     -- Is current actual type NONE?
65     do
66     Result := actual_type.is_none
67     end
68 manus 42626
69 manus 9658 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 manus 11302 Result := actual_type /= Void and then
80     actual_type.has_associated_class
81 manus 9658 end
82    
83 manus 11302 associated_class: CLASS_C is
84 manus 9658 -- Associated class
85     do
86 manus 11302 Result := actual_type.associated_class
87 manus 9658 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 manus 26913 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
104 manus 9658 -- 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 manus 40762 Result := twin
115 manus 9658 Result.set_actual_type (actual_type.instantiated_in (class_type))
116     end
117    
118 manus 41738 conform_to (other: TYPE_A): BOOLEAN is
119     -- Does `actual_type' conform to `other'?
120 manus 9658 do
121 manus 41738 Result := actual_type.conform_to (other.actual_type)
122 manus 9658 end
123    
124     type_i: TYPE_I is
125     -- Reduced type of `actual_type'
126 manus 10886 local
127     cl_type : CL_TYPE_I
128 manus 9658 do
129     Result := actual_type.type_i
130 manus 10886 cl_type ?= Result
131    
132 manus 41738 if cl_type /= Void and then not cl_type.is_expanded then
133     -- Remember that it's an anchored type, not needed
134     -- when handling expanded types.
135 manus 10886 cl_type.set_cr_info (create_info)
136     end
137 manus 9658 end
138    
139     meta_type: TYPE_I is
140     -- C type for `actual_type'
141     do
142     Result := actual_type.meta_type
143     end
144    
145     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