/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/eiffel/genericity/cl_type_i.e
ViewVC logotype

Annotation of /branches/CAT_mono/Src/Eiffel/eiffel/genericity/cl_type_i.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64191 - (hide annotations)
Thu Oct 5 21:04:08 2006 UTC (13 years, 4 months ago) by manus
Original Path: trunk/Src/Eiffel/eiffel/genericity/cl_type_i.e
File size: 19895 byte(s)
Merged from Eiffel_57:
  Fixed `il_type_name' to properly generate the class name when an external class name is
  specified. Before if you specified A.B you would get for the implementation class A.B.Impl
  which does not follow the normal pattern, instead we should get A.Impl.B. This is now the
  case with this fix.

1 manus 26913 indexing
2     description: "Type class."
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 26913 date: "$Date$"
6     revision: "$Revision$"
7 grator 18
8     class CL_TYPE_I
9    
10     inherit
11     TYPE_I
12     redefine
13 alexk 56564 anchor_instantiation_in,
14 grator 18 c_type,
15 manus 10818 conforms_to_array,
16 alexk 56356 created_in,
17 alexk 62805 full_type_byte_code_type_id,
18 manus 11298 generate_cid,
19 manus 14013 generate_cid_array,
20 manus 30169 generate_cid_init,
21 manus 35665 generate_gen_type_il,
22 manus 41824 generate_expanded_creation,
23 manus 43364 generate_expanded_initialization,
24 alexk 56356 generated_id,
25     generic_derivation,
26 alexk 55897 instantiated_description,
27 manus 41824 instantiation_in,
28 alexk 56356 is_expanded,
29     is_explicit,
30     is_external,
31 alexk 56735 is_frozen,
32 alexk 56356 is_generated_as_single_type,
33     is_reference,
34     is_separate,
35 manus 63371 is_consistent,
36 alexk 56356 make_gen_type_byte_code,
37 manus 63370 same_as,
38     static_type_id
39 grator 18 end
40    
41 manus 33952 SHARED_IL_CASING
42     export
43     {NONE} all
44     end
45    
46 manus 35665 SHARED_GENERATION
47     export
48     {NONE} all
49     end
50    
51     SHARED_DECLARATIONS
52     export
53     {NONE} all
54     end
55    
56 manus 30224 create
57     make
58 alexk 55707
59 manus 30224 feature {NONE} -- Initialization
60    
61     make (id: INTEGER) is
62 manus 30293 -- Create new instance of `Current' with `class_id'
63 manus 30224 -- assigned with `id'.
64     require
65     valid_id: id > 0
66     do
67 manus 30293 class_id := id
68 manus 30224 ensure
69 manus 30293 class_id_set: class_id = id
70 manus 30224 end
71 alexk 55707
72 manus 26913 feature -- Access
73 grator 18
74 manus 30293 class_id: INTEGER
75 grator 18 -- Base class id of the type class
76    
77     meta_generic: META_GENERIC is
78     -- Meta generic array describing the type class
79     do
80     -- No meta generic in non-generic type
81 manus 9655 end
82 grator 18
83 manus 10890 cr_info : CREATE_INFO
84     -- Additional information for the creation
85     -- of generic types with anchored parameters
86    
87 manus 10818 true_generics : ARRAY [TYPE_I] is
88     -- Array of generics: no mapping reference -> REFERENCE_I
89     do
90     -- Non generic types don't have them
91     end
92    
93 grator 18 base_class: CLASS_C is
94     -- Base class associated to the class type
95     do
96 manus 30293 Result := System.class_of_id (class_id)
97 manus 9655 end
98 grator 18
99 manus 41824 generic_derivation: CL_TYPE_I is
100     -- Precise generic derivation of current type.
101     -- That is to say given a type, it gives the associated TYPE_I
102     -- which can be used to search its associated CLASS_TYPE.
103     do
104     Result := Current
105     end
106 alexk 55707
107 manus 26913 type_a: CL_TYPE_A is
108 grator 236 do
109 manus 30293 create Result.make (class_id)
110 alexk 56011 Result.set_mark (declaration_mark)
111 manus 9655 end
112 grator 236
113 manus 41824 name: STRING is
114     -- String that should be displayed in debugger to represent `Current'.
115     do
116 manus 43828 Result := base_name
117 manus 41824 end
118 alexk 55707
119 alexk 56011 duplicate: like Current is
120     -- Duplication
121     do
122     Result := twin
123     end
124    
125 alexk 61575 reference_type: CL_TYPE_I is
126     -- Corresponding reference type
127     require
128     is_expanded: is_expanded
129     do
130     Result := duplicate
131     Result.set_reference_mark
132     ensure
133     result_is_reference: Result.is_reference
134     end
135    
136 manus 43828 instantiation_in (other: CLASS_TYPE): CL_TYPE_I is
137 manus 41824 -- Instantation of Current in `other'
138     do
139     Result := Current
140     end
141 alexk 55707
142 alexk 56564 anchor_instantiation_in (other: CLASS_TYPE): CL_TYPE_I is
143     -- Instantation of `like Current' parts of Current in `other'
144     do
145     Result := Current
146     end
147    
148 alexk 56356 created_in (other: CLASS_TYPE): TYPE_I is
149     -- Resulting type of Current as if it was used to create object in `other'.
150     do
151     Result := Current
152     if cr_info /= Void then
153     Result := cr_info.created_in (other)
154     end
155     end
156    
157 manus 33952 il_type_name (a_prefix: STRING): STRING is
158 manus 26913 -- Class name of current type.
159 manus 29681 local
160     l_class_c: like base_class
161 manus 34253 l_is_precompiled: BOOLEAN
162     l_cl_type: like associated_class_type
163 manus 64191 l_alias_name: STRING
164     l_dot_pos: INTEGER
165 grator 18 do
166 manus 29681 l_class_c := base_class
167 manus 41824 if is_external then
168 manus 40771 Result := l_class_c.external_class_name.twin
169 manus 29681 else
170 manus 34253 l_is_precompiled := l_class_c.is_precompiled
171     if l_is_precompiled then
172 manus 64191 -- Reuse the name that was computed at precompilation time.
173 manus 34253 l_cl_type := associated_class_type
174     l_is_precompiled := l_cl_type.is_precompiled
175     if l_is_precompiled then
176 manus 49345 Result := l_cl_type.il_type_name (a_prefix)
177 manus 34253 end
178     end
179     if not l_is_precompiled then
180 raphaels 48802 if l_class_c.external_class_name.is_equal (l_class_c.name) then
181     Result := internal_il_type_name (l_class_c.name.twin, a_prefix)
182     else
183 manus 64191 -- Special case when an external name has been specified.
184 raphaels 48802 Result := l_class_c.external_class_name.twin
185 manus 64191 Result.left_adjust
186     Result.right_adjust
187     -- Remove leading `.' since it is not a valid .NET name.
188     from
189     until
190     Result.is_empty or else Result.item (1) /= '.'
191     loop
192     Result.remove_head (1)
193     end
194     -- Remove trailing `.' since it is not a valid .NET name.
195     from
196     until
197     Result.is_empty or else Result.item (Result.count) /= '.'
198     loop
199     Result.remove_tail (1)
200     end
201     if Result.is_empty then
202     -- External name is invalid since empty, we use the normal
203     -- way of generating the .Net name
204     Result := internal_il_type_name (l_class_c.name.twin, a_prefix)
205     else
206     if a_prefix /= Void then
207     l_dot_pos := Result.last_index_of ('.', Result.count)
208     if l_dot_pos = 0 then
209     Result.prepend_character ('.')
210     Result.prepend (a_prefix)
211     else
212     check
213     -- Because there are no more leading or trailing `.'.
214     valid_l_dot_pos: l_dot_pos > 1 and l_dot_pos < Result.count
215     end
216     l_alias_name := Result.substring (l_dot_pos + 1, Result.count)
217     check
218     l_alias_name_not_empty: not l_alias_name.is_empty
219     end
220     Result.keep_head (l_dot_pos)
221     l_alias_name := internal_il_base_type_name (l_alias_name)
222     Result.append (a_prefix)
223     Result.append_character ('.')
224     Result.append (l_alias_name)
225     end
226 raphaels 48802 end
227     end
228     end
229 manus 34253 end
230 manus 29681 end
231 manus 11218 end
232    
233 alexk 55897 description, instantiated_description: ATTR_DESC is
234 grator 18 -- Type description for skeletons
235     local
236 michaels 7681 exp: EXPANDED_DESC
237     ref: REFERENCE_DESC
238 grator 485 do
239 manus 41824 if is_expanded then
240 julieng 37663 create exp
241 manus 42413 exp.set_cl_type_i (Current)
242 manus 13232 exp.set_type_i (Current)
243 manus 9655 Result := exp
244 grator 18 else
245 manus 9655 Result := c_type.description
246 manus 42413 ref ?= Result
247     if ref /= Void then
248     ref.set_type_i (Current)
249     end
250 manus 9655 end
251     end
252 grator 18
253     c_type: TYPE_C is
254     -- Associated C type
255     do
256 manus 9655 Result := Reference_c_type
257     end
258 manus 42413
259 grator 18 associated_class_type: CLASS_TYPE is
260     -- Associated class type
261 michaels 7681 require
262 manus 42865 has: has_associated_class_type
263 grator 485 do
264 manus 41824 Result := base_class.types.search_item (Current)
265 alexk 48670 ensure
266     result_not_void: Result /= Void
267 manus 9655 end
268 grator 18
269     type_id: INTEGER is
270     -- Type id of the correponding class type
271     do
272 manus 9655 Result := associated_class_type.type_id
273     end
274 grator 18
275 manus 63370 static_type_id: INTEGER is
276     -- Type id of the correponding class type
277     require else
278     ok: True
279     do
280     Result := associated_class_type.static_type_id
281     end
282    
283 manus 26913 sk_value: INTEGER is
284     -- Generate SK value associated to the current type.
285 grator 18 do
286 manus 41824 if is_expanded then
287     Result := Sk_exp | (type_id - 1)
288     else
289 manus 31263 Result := Sk_ref | (type_id - 1)
290 manus 9655 end
291     end
292 grator 18
293     hash_code: INTEGER is
294     -- Hash code for current type
295     do
296 manus 30293 Result := Other_code + class_id
297 manus 9655 end
298 grator 18
299 manus 26913 feature -- Status
300    
301 manus 31541 element_type: INTEGER_8 is
302     -- Void element type
303     do
304 manus 41824 if is_expanded then
305 alexk 55707 Result := {MD_SIGNATURE_CONSTANTS}.Element_type_valuetype
306 manus 31541 else
307 manus 37130 if class_id = System.system_string_class.compiled_class.class_id then
308 manus 49446 Result := {MD_SIGNATURE_CONSTANTS}.Element_type_string
309 manus 44032 elseif class_id = System.system_object_id or class_id = system.any_id then
310     -- For ANY or SYSTEM_OBJECT, we always generate a System.Object
311     -- signature since we can now assign SYSTEM_OBJECTs into ANYs.
312 manus 49446 Result := {MD_SIGNATURE_CONSTANTS}.Element_type_object
313 manus 31541 else
314 manus 49446 Result := {MD_SIGNATURE_CONSTANTS}.Element_type_class
315 manus 31541 end
316     end
317     end
318    
319 manus 41824 tuple_code: INTEGER_8 is
320     -- Tuple code for class type
321     do
322 manus 49446 Result := {SHARED_GEN_CONF_LEVEL}.reference_tuple_code
323 manus 41824 end
324 alexk 55707
325 alexk 56011 has_no_mark: BOOLEAN is
326     -- Has class type no explicit mark?
327     do
328     Result := declaration_mark = {CL_TYPE_A}.no_mark
329     ensure
330     definition: Result = (declaration_mark = {CL_TYPE_A}.no_mark)
331     end
332    
333     has_expanded_mark: BOOLEAN is
334     -- Is class type explicitly marked as expanded?
335     do
336     Result := declaration_mark = {CL_TYPE_A}.expanded_mark
337     ensure
338     definition: Result = (declaration_mark = {CL_TYPE_A}.expanded_mark)
339     end
340    
341     has_reference_mark: BOOLEAN is
342     -- Is class type explicitly marked as reference?
343     do
344     Result := declaration_mark = {CL_TYPE_A}.reference_mark
345     ensure
346     definition: Result = (declaration_mark = {CL_TYPE_A}.reference_mark)
347     end
348    
349     has_separate_mark: BOOLEAN is
350     -- Is class type explicitly marked as reference?
351     do
352     Result := declaration_mark = {CL_TYPE_A}.separate_mark
353     ensure
354     definition: Result = (declaration_mark = {CL_TYPE_A}.separate_mark)
355     end
356    
357     is_expanded: BOOLEAN is
358 manus 26913 -- Is the type expanded?
359 alexk 56011 do
360 manus 60994 -- Do not check for `has_separate_mark' because a separate class cannot be expanded.
361     Result := has_expanded_mark or else (has_no_mark and then base_class.is_expanded)
362 alexk 56011 end
363 manus 26913
364 alexk 56011 is_reference: BOOLEAN is
365     -- Is the type a reference type?
366     do
367 manus 60994 Result := has_reference_mark or else
368     ((has_no_mark or has_separate_mark) and then not base_class.is_expanded)
369 alexk 56011 end
370    
371     is_separate: BOOLEAN is
372 manus 26913 -- Is the type separate?
373 alexk 56011 do
374     Result := has_separate_mark
375     end
376 manus 26913
377     is_enum: BOOLEAN is
378     -- Is current type an IL enum type?
379     -- Useful to find out if some call optimization can be done
380     -- in FEATURE_B.
381     require
382     il_generation: System.il_generation
383 grator 18 do
384 manus 41824 Result := is_expanded and then base_class.is_enum
385 manus 26913 end
386    
387 manus 28380 is_external: BOOLEAN is
388 manus 41824 -- Is current type based on an external class?
389     local
390     l_base_class: like base_class
391 manus 28380 do
392 manus 41824 -- All Eiffel basic types are externals, and only basic types used
393     -- as reference are not external.
394     l_base_class := base_class
395     Result := is_basic or (not l_base_class.is_basic and l_base_class.is_external)
396 manus 28380 end
397 alexk 55707
398 alexk 56735 is_frozen: BOOLEAN is
399     -- Is current type based on a frozen class?
400     do
401     Result := base_class.is_frozen
402     end
403    
404 manus 41824 is_generated_as_single_type: BOOLEAN is
405 alexk 55707 -- Is associated type generated as a single type or as an interface type and
406 manus 41824 -- an implementation type.
407     do
408 manus 44032 -- External classes have only one type.
409     Result := is_external
410 manus 41824 if not Result then
411 manus 44058 -- Classes that inherits from external classes
412 alexk 55396 -- have only one generated type as well as expanded types.
413     Result := base_class.is_single or else is_expanded
414 manus 41824 end
415     end
416 manus 28380
417 manus 63371 is_consistent: BOOLEAN is
418 manus 35544 -- Is the base class still in the system and matches its specification?
419 manus 41824 local
420     l_base_class: like base_class
421 manus 26913 do
422 manus 41824 l_base_class := base_class
423     Result := l_base_class /= Void and then (l_base_class.generics = Void)
424 manus 26913 end
425    
426     is_explicit: BOOLEAN is
427 manus 39713 -- Is Current type fixed at compile time?
428 manus 26913 do
429 manus 39713 if cr_info /= Void then
430     Result := cr_info.is_explicit
431     else
432     Result := True
433     end
434 manus 26913 end
435    
436     has_associated_class_type: BOOLEAN is
437     -- Has `Current' an associated class type?
438     do
439 alexk 48670 Result := base_class.types.has_type (Current)
440 manus 9655 end
441 grator 18
442 manus 26913 same_as (other: TYPE_I): BOOLEAN is
443     -- Is `other' equal to Current ?
444     local
445     other_cl_type: CL_TYPE_I
446 grator 508 do
447 manus 26913 other_cl_type ?= other
448     Result := other_cl_type /= Void -- FIXME
449 manus 30293 and then other_cl_type.class_id = class_id
450 manus 41824 and then other_cl_type.is_expanded = is_expanded
451 manus 26913 and then other_cl_type.is_separate = is_separate
452     and then other_cl_type.meta_generic = Void
453     and then other_cl_type.true_generics = Void
454     end
455    
456 alexk 56564 has_actual (type: CL_TYPE_I): BOOLEAN is
457     -- Is `type' an (possibly nested) actual parameter of this type?
458     require
459     non_void_type: type /= Void
460     do
461     -- False here.
462     end
463    
464 manus 26913 feature -- Setting
465    
466 alexk 56011 set_expanded_mark is
467     -- Set class type declaration as expanded.
468 manus 26913 do
469 alexk 56011 declaration_mark := {CL_TYPE_A}.expanded_mark
470 manus 35178 ensure
471 alexk 56011 has_expanded_mark: has_expanded_mark
472 manus 26913 end
473    
474 alexk 56011 set_reference_mark is
475     -- Set class type declaration as reference.
476 manus 26913 do
477 alexk 56011 declaration_mark := {CL_TYPE_A}.reference_mark
478 manus 35178 ensure
479 alexk 56011 has_reference_mark: has_reference_mark
480 manus 26913 end
481    
482 alexk 56011 set_separate_mark is
483     -- Set class type declaration as separate.
484     do
485     declaration_mark := {CL_TYPE_A}.separate_mark
486     ensure
487     has_separate_mark: has_separate_mark
488     end
489    
490 manus 26913 set_cr_info (cinfo : CREATE_INFO) is
491     -- Set `cr_info' to `cinfo'.
492 manus 30224 require
493     create_info_not_void: cinfo /= Void
494 manus 41824 not_expanded: not is_expanded
495 manus 26913 do
496     cr_info := cinfo
497     ensure
498     cr_info_set : cr_info = cinfo
499     end
500    
501     feature -- C generation
502    
503 manus 43364 generate_expanded_creation (buffer: GENERATION_BUFFER; target_name: STRING) is
504 manus 35665 -- Generate creation of expanded object associated to Current.
505     do
506 manus 60999 associated_class_type.generate_expanded_creation (buffer, target_name, Current)
507 manus 43364 end
508 manus 35665
509 manus 43364 generate_expanded_initialization (buffer: GENERATION_BUFFER; target_name: STRING) is
510     -- Generate creation of expanded object associated to Current.
511     do
512     associated_class_type.generate_expanded_initialization (buffer, target_name, target_name, True)
513 manus 35665 end
514    
515 manus 26913 generate_cecil_value (buffer: GENERATION_BUFFER) is
516     -- Generate cecil value
517     do
518 manus 41824 if not is_expanded then
519 manus 43084 buffer.put_string ("SK_REF + (uint32) ")
520 grator 508 else
521 manus 43084 buffer.put_string ("SK_EXP + (uint32) ")
522 manus 9655 end
523 manus 43084 buffer.put_type_id (associated_class_type.type_id)
524 manus 9655 end
525 grator 508
526 grator 930 feature -- Array optimization
527    
528     conforms_to_array: BOOLEAN is
529     do
530     Result := base_class.conform_to (array_class_c)
531 manus 9655 end
532 grator 930
533     feature {NONE} -- Array optimization
534    
535     array_class_c: CLASS_C is
536     once
537     Result := System.array_class.compiled_class
538 manus 9655 end
539 grator 930
540 alexk 62805 feature {NONE} -- Generic conformance
541    
542     full_type_byte_code_type_id: INTEGER is
543     -- Associated type ID used in type information byte code.
544     do
545     Result := type_id - 1
546     ensure then
547     definition: Result = type_id - 1
548     end
549    
550 manus 10818 feature -- Generic conformance
551    
552     generated_id (final_mode : BOOLEAN) : INTEGER is
553 manus 11298
554 manus 10818 do
555 manus 11298 if final_mode then
556     Result := type_id - 1
557 manus 10818 else
558 manus 41824 Result := associated_class_type.static_type_id - 1
559 manus 10818 end
560     end
561    
562 manus 11599 generate_cid (buffer : GENERATION_BUFFER; final_mode, use_info : BOOLEAN) is
563 manus 11298
564 manus 10818 do
565 manus 11209 if
566     use_info and then (cr_info /= Void)
567 manus 26913 and then not is_expanded
568 manus 11209 then
569 alexk 55707 -- It's an anchored type
570 manus 11599 cr_info.generate_cid (buffer, final_mode)
571 manus 39412 else
572 manus 43084 buffer.put_integer (generated_id (final_mode))
573 manus 43156 buffer.put_character (',')
574 manus 10890 end
575 manus 10818 end
576    
577 manus 10890 make_gen_type_byte_code (ba : BYTE_ARRAY; use_info : BOOLEAN) is
578 manus 10818 do
579 manus 11209 if
580     use_info and then (cr_info /= Void)
581 manus 26913 and then not is_expanded
582 manus 11209 then
583 alexk 55707 -- It's an anchored type
584 manus 10890 cr_info.make_gen_type_byte_code (ba)
585 manus 39412 else
586     ba.append_short_integer (generated_id (False))
587 manus 10890 end
588 manus 10818 end
589    
590 alexk 55707 generate_cid_array (buffer : GENERATION_BUFFER;
591 manus 14013 final_mode, use_info : BOOLEAN; idx_cnt : COUNTER) is
592     local
593     dummy : INTEGER
594     do
595     if
596     use_info and then (cr_info /= Void)
597 manus 26913 and then not is_expanded
598 manus 14013 then
599 alexk 55707 -- It's an anchored type
600 manus 14013 cr_info.generate_cid_array (buffer, final_mode, idx_cnt)
601 manus 39412 else
602 manus 43084 buffer.put_integer (generated_id (final_mode))
603 manus 43156 buffer.put_character (',')
604 manus 39412
605     -- Increment counter
606     dummy := idx_cnt.next
607 manus 14013 end
608     end
609    
610 alexk 55707 generate_cid_init (buffer : GENERATION_BUFFER;
611 manus 14013 final_mode, use_info : BOOLEAN; idx_cnt : COUNTER) is
612     local
613     dummy : INTEGER
614     do
615     if
616     use_info and then (cr_info /= Void)
617 manus 26913 and then not is_expanded
618 manus 14013 then
619 alexk 55707 -- It's an anchored type
620 manus 14013 cr_info.generate_cid_init (buffer, final_mode, idx_cnt)
621 manus 39412 else
622     dummy := idx_cnt.next
623 manus 14013 end
624     end
625 manus 30169
626     feature -- Generic conformance for IL
627    
628     generate_gen_type_il (il_generator: IL_CODE_GENERATOR; use_info : BOOLEAN) is
629 alexk 55707 -- `use_info' is true iff we generate code for a
630 manus 30169 -- creation instruction.
631     do
632     if use_info and then cr_info /= Void then
633 manus 30582 -- It's an anchored type, we call feature
634 alexk 55707 -- that will tell us the real type of the
635 manus 30582 -- anchor in the context of Current.
636     cr_info.generate_il_type
637     else
638     il_generator.generate_class_type_instance (Current)
639 alexk 55707 end
640 manus 30169 end
641    
642 manus 33952 feature {NONE} -- Implementation
643    
644 manus 43828 base_name: STRING is
645     -- String that should be displayed in debugger to represent `Current'.
646     local
647     l_base_class: like base_class
648     do
649     create Result.make (32)
650     l_base_class := base_class
651     if is_expanded and not l_base_class.is_expanded then
652     Result.append ("expanded ")
653 alexk 56011 elseif is_reference and l_base_class.is_expanded then
654     Result.append ("reference ")
655 manus 43828 elseif is_separate then
656     Result.append ("separate ")
657     end
658     Result.append (l_base_class.name)
659     end
660    
661 manus 41824 frozen internal_il_type_name (a_base_name, a_prefix: STRING): STRING is
662 manus 33952 -- Full type name of `a_base_name' using `a_prefix' in IL code generation
663     -- with namespace specification
664     require
665     a_base_name_not_void: a_base_name /= Void
666 manus 64191 a_base_name_not_empty: not a_base_name.is_empty
667     do
668     Result := internal_il_base_type_name (a_base_name)
669     -- Result needs to be in lower case because that's
670     -- what our casing conversion routines require to perform
671     -- a good job.
672     Result.to_lower
673     Result := il_casing.type_name (base_class.original_class.actual_namespace, a_prefix, Result, System.dotnet_naming_convention)
674     ensure
675     internal_il_type_name_not_void: Result /= Void
676     internal_il_type_name_not_empty: not Result.is_empty
677     end
678    
679     frozen internal_il_base_type_name (a_base_name: STRING): STRING is
680     -- Given `a_base_name' provides its updated name depending on its usage.
681     require
682     a_base_name_not_void: a_base_name /= Void
683     a_base_name_not_empty: not a_base_name.is_empty
684 manus 33952 local
685 manus 41824 l_base_class: like base_class
686 manus 33952 do
687 manus 41824 l_base_class := base_class
688 alexk 46609 if is_expanded and then not l_base_class.is_expanded then
689     create Result.make (6 + a_base_name.count)
690     Result.append ("value_")
691     elseif not is_expanded and then l_base_class.is_expanded then
692     create Result.make (10 + a_base_name.count)
693     Result.append ("reference_")
694 manus 41824 else
695 alexk 46609 create Result.make (a_base_name.count)
696 manus 41824 end
697 alexk 46609 Result.append (a_base_name)
698 manus 33952 ensure
699 manus 64191 internal_il_base_type_name_not_void: Result /= Void
700     internal_il_base_type_name_not_empty: not Result.is_empty
701 manus 33952 end
702    
703 alexk 56062 feature {CL_TYPE_A, TUPLE_CLASS_B} -- Implementation: class type declaration marks
704 alexk 56011
705     declaration_mark: NATURAL_8
706     -- Declaration mark associated with a class type (if any)
707    
708     set_mark (mark: like declaration_mark) is
709     -- Set `declaration_mark' to the given value `mark'.
710     require
711     valid_declaration_mark:
712     mark = {CL_TYPE_A}.no_mark or mark = {CL_TYPE_A}.expanded_mark or
713     mark = {CL_TYPE_A}.reference_mark or mark = {CL_TYPE_A}.separate_mark
714     do
715     declaration_mark := mark
716     ensure
717     declaration_mark_set: declaration_mark = mark
718     end
719    
720 manus 41824 invariant
721     class_id_positive: class_id > 0
722 alexk 56011 valid_declaration_mark:
723     declaration_mark = {CL_TYPE_A}.no_mark or
724     declaration_mark = {CL_TYPE_A}.expanded_mark or
725     declaration_mark = {CL_TYPE_A}.reference_mark or
726     declaration_mark = {CL_TYPE_A}.separate_mark
727 manus 41824
728 manus 56535 indexing
729     copyright: "Copyright (c) 1984-2006, Eiffel Software"
730 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
731 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
732     copying: "[
733     This file is part of Eiffel Software's Eiffel Development Environment.
734 manus 58027
735 manus 56535 Eiffel Software's Eiffel Development Environment is free
736     software; you can redistribute it and/or modify it under
737     the terms of the GNU General Public License as published
738     by the Free Software Foundation, version 2 of the License
739     (available at the URL listed under "license" above).
740 manus 58027
741 manus 56535 Eiffel Software's Eiffel Development Environment is
742     distributed in the hope that it will be useful, but
743     WITHOUT ANY WARRANTY; without even the implied warranty
744     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
745     See the GNU General Public License for more details.
746 manus 58027
747 manus 56535 You should have received a copy of the GNU General Public
748     License along with Eiffel Software's Eiffel Development
749     Environment; if not, write to the Free Software Foundation,
750     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
751     ]"
752     source: "[
753     Eiffel Software
754     356 Storke Road, Goleta, CA 93117 USA
755     Telephone 805-685-1006, Fax 805-685-6869
756     Website http://www.eiffel.com
757     Customer support http://support.eiffel.com
758     ]"
759    
760 grator 18 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23