/[eiffelstudio]/vendor/gobosoft.com/gobo/4.0d/library/tools/src/eiffel/ast/type/et_base_type.e
ViewVC logotype

Contents of /vendor/gobosoft.com/gobo/4.0d/library/tools/src/eiffel/ast/type/et_base_type.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98698 - (show annotations)
Mon May 9 13:53:54 2016 UTC (3 years, 5 months ago) by manus
File size: 27337 byte(s)
Update 4.0d version with changes in Gobo from 2016/05/09

1 note
2
3 description:
4
5 "Eiffel types directly based on a class"
6
7 library: "Gobo Eiffel Tools Library"
8 copyright: "Copyright (c) 2003-2016, Eric Bezault and others"
9 license: "MIT License"
10 date: "$Date$"
11 revision: "$Revision$"
12
13 deferred class ET_BASE_TYPE
14
15 inherit
16
17 ET_NAMED_TYPE
18 rename
19 base_class as base_class_in_context,
20 named_base_class as named_base_class_in_context
21 redefine
22 reset,
23 reset_qualified_anchored_types,
24 is_named_type,
25 is_base_type,
26 has_anchored_type,
27 has_identifier_anchored_type,
28 depends_on_qualified_anchored_type,
29 has_formal_types,
30 conforms_from_formal_parameter_type_with_type_marks,
31 conforms_from_tuple_type_with_type_marks,
32 resolved_formal_parameters,
33 resolved_formal_parameters_with_type_mark,
34 type_with_type_mark,
35 is_valid_context_type
36 end
37
38 ET_TYPE_CONTEXT
39 rename
40 base_type as context_base_type,
41 base_type_with_type_mark as context_base_type_with_type_mark,
42 base_type_actual as context_base_type_actual,
43 base_type_actual_parameter as context_base_type_actual_parameter,
44 base_type_actual_count as context_base_type_actual_count,
45 base_type_index_of_label as context_base_type_index_of_label,
46 named_type as context_named_type,
47 named_type_with_type_mark as context_named_type_with_type_mark,
48 is_type_expanded as context_is_type_expanded,
49 is_type_expanded_with_type_mark as context_is_type_expanded_with_type_mark,
50 is_type_reference as context_is_type_reference,
51 is_type_reference_with_type_mark as context_is_type_reference_with_type_mark,
52 is_type_attached as context_is_type_attached,
53 is_type_attached_with_type_mark as context_is_type_attached_with_type_mark,
54 is_type_detachable as context_is_type_detachable,
55 is_type_detachable_with_type_mark as context_is_type_detachable_with_type_mark,
56 same_named_type as context_same_named_type,
57 same_named_type_with_type_marks as context_same_named_type_with_type_marks,
58 same_base_type as context_same_base_type,
59 same_base_type_with_type_marks as context_same_base_type_with_type_marks,
60 same_named_class_type_with_type_marks as context_same_named_class_type_with_type_marks,
61 same_named_formal_parameter_type_with_type_marks as context_same_named_formal_parameter_type_with_type_marks,
62 same_named_tuple_type_with_type_marks as context_same_named_tuple_type_with_type_marks,
63 same_base_class_type_with_type_marks as context_same_base_class_type_with_type_marks,
64 same_base_formal_parameter_type_with_type_marks as context_same_base_formal_parameter_type_with_type_marks,
65 same_base_tuple_type_with_type_marks as context_same_base_tuple_type_with_type_marks,
66 conforms_to_type as context_conforms_to_type,
67 conforms_to_type_with_type_marks as context_conforms_to_type_with_type_marks,
68 conforms_from_class_type_with_type_marks as context_conforms_from_class_type_with_type_marks,
69 conforms_from_formal_parameter_type_with_type_marks as context_conforms_from_formal_parameter_type_with_type_marks,
70 conforms_from_tuple_type_with_type_marks as context_conforms_from_tuple_type_with_type_marks,
71 base_type_has_class as context_base_type_has_class,
72 named_type_has_class as context_named_type_has_class
73 redefine
74 base_class,
75 is_root_context
76 end
77
78 feature -- Initialization
79
80 reset
81 -- Reset type as it was just after it was last parsed.
82 do
83 if attached actual_parameters as l_parameters then
84 l_parameters.reset
85 end
86 end
87
88 reset_qualified_anchored_types
89 -- Reset qualified anchored types contained in current type
90 -- as they were just after they were last parsed.
91 do
92 if attached actual_parameters as l_parameters then
93 l_parameters.reset_qualified_anchored_types
94 end
95 end
96
97 feature -- Access
98
99 base_class: ET_CLASS
100 -- Base class of current type
101 require else
102 base_class_available: True
103 do
104 Result := named_base_class.actual_class
105 end
106
107 named_base_class: ET_NAMED_CLASS
108 -- Class visible from the surrounding universe under the name `name'
109 --
110 -- Note that this class may have been written in another library
111 -- with another name.
112
113 named_base_class_in_context (a_context: ET_TYPE_CONTEXT): ET_NAMED_CLASS
114 -- Same as `base_class' except that it returns information about this
115 -- class (e.g. its name) as known from the universe it is used from
116 -- (instead of from the universe it is written in).
117 -- Return "*UNKNOWN*" class if unresolved identifier type,
118 -- or unmatched formal generic parameter.
119 do
120 Result := named_base_class
121 end
122
123 actual_parameters: detachable ET_ACTUAL_PARAMETERS
124 -- Actual generic parameters
125 do
126 -- Result := Void
127 end
128
129 shallow_base_type_with_type_mark (a_type_mark: detachable ET_TYPE_MARK; a_context: ET_TYPE_CONTEXT): ET_BASE_TYPE
130 -- Same as `shallow_base_type' except that its type mark status is
131 -- overridden by `a_type_mark', if not Void
132 do
133 Result := type_with_type_mark (a_type_mark)
134 end
135
136 base_type_actual (i: INTEGER; a_context: ET_TYPE_CONTEXT): ET_NAMED_TYPE
137 -- `i'-th actual generic parameter's type of the base type of current
138 -- type when it appears in `a_context'
139 local
140 an_actual: ET_TYPE
141 do
142 check attached actual_parameters as l_actual_parameters then
143 an_actual := l_actual_parameters.type (i)
144 if (a_context = Current or (a_context.is_root_context and then a_context.root_context = Current)) and then attached {ET_NAMED_TYPE} an_actual as l_named_type then
145 -- The current type is its own context,
146 -- therefore it is its own base type (i.e all
147 -- its actual generic parameters are named).
148 Result := l_named_type
149 else
150 Result := an_actual.named_type (a_context)
151 end
152 end
153 end
154
155 base_type_actual_parameter (i: INTEGER; a_context: ET_TYPE_CONTEXT): ET_ACTUAL_PARAMETER
156 -- `i'-th actual generic parameter of the base type of current
157 -- type when it appears in `a_context'
158 local
159 an_actual: ET_ACTUAL_PARAMETER
160 do
161 check attached actual_parameters as l_actual_parameters then
162 an_actual := l_actual_parameters.actual_parameter (i)
163 if a_context = Current or (a_context.is_root_context and then a_context.root_context = Current) then
164 -- The current type is its own context,
165 -- therefore it is its own base type (i.e all
166 -- its actual generic parameters are named).
167 Result := an_actual
168 else
169 Result := an_actual.named_parameter (a_context)
170 end
171 end
172 end
173
174 base_type_index_of_label (a_label: ET_IDENTIFIER; a_context: ET_TYPE_CONTEXT): INTEGER
175 -- Index of actual generic parameter with label `a_label' in
176 -- the base type of current type when it appears in `a_context';
177 -- 0 if it does not exist
178 do
179 Result := index_of_label (a_label)
180 end
181
182 index_of_label (a_label: ET_IDENTIFIER): INTEGER
183 -- Index of actual generic parameter with label `a_label';
184 -- 0 if it does not exist
185 require
186 a_label_not_void: a_label /= Void
187 do
188 if attached actual_parameters as l_parameters then
189 Result := l_parameters.index_of_label (a_label)
190 end
191 ensure
192 index_large_enough: Result >= 0
193 index_small_enough: Result <= actual_parameter_count
194 end
195
196 type_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): ET_BASE_TYPE
197 -- Current type whose type mark status is
198 -- overridden by `a_type_mark', if not Void
199 do
200 Result := Current
201 end
202
203 feature -- Measurement
204
205 base_type_actual_count (a_context: ET_TYPE_CONTEXT): INTEGER
206 -- Number of actual generic parameters of the base type of current type
207 do
208 Result := actual_parameter_count
209 end
210
211 actual_parameter_count: INTEGER
212 -- Number of generic parameters
213 do
214 if attached actual_parameters as l_actual_parameters then
215 Result := l_actual_parameters.count
216 end
217 ensure
218 non_negative_count: Result >= 0
219 generic: attached actual_parameters as l_actual_parameters implies Result = l_actual_parameters.count
220 non_generic: actual_parameters = Void implies Result = 0
221 end
222
223 feature -- Status report
224
225 is_generic: BOOLEAN
226 -- Is current class type generic?
227 do
228 Result := attached actual_parameters as l_actual_parameters and then not l_actual_parameters.is_empty
229 ensure
230 definition: Result = (attached actual_parameters as l_actual_parameters and then not l_actual_parameters.is_empty)
231 end
232
233 is_named_type: BOOLEAN
234 -- Is current type only made up of named types?
235 local
236 i, nb: INTEGER
237 do
238 Result := True
239 if attached actual_parameters as l_actual_parameters then
240 nb := l_actual_parameters.count
241 from i := 1 until i > nb loop
242 if not l_actual_parameters.type (i).is_named_type then
243 Result := False
244 i := nb + 1 -- Jump out of the loop.
245 else
246 i := i + 1
247 end
248 end
249 end
250 end
251
252 is_base_type: BOOLEAN
253 -- Is current type only made up of base types?
254 local
255 i, nb: INTEGER
256 do
257 Result := True
258 if attached actual_parameters as l_actual_parameters then
259 nb := l_actual_parameters.count
260 from i := 1 until i > nb loop
261 if not l_actual_parameters.type (i).is_base_type then
262 Result := False
263 i := nb + 1 -- Jump out of the loop.
264 else
265 i := i + 1
266 end
267 end
268 end
269 ensure then
270 valid_context: Result implies is_valid_context
271 end
272
273 is_expanded: BOOLEAN
274 -- Is current type expanded?
275 deferred
276 end
277
278 has_anchored_type: BOOLEAN
279 -- Does current type contain an anchored type?
280 do
281 if attached actual_parameters as l_actual_parameters then
282 Result := l_actual_parameters.has_anchored_type
283 end
284 end
285
286 has_identifier_anchored_type: BOOLEAN
287 -- Does current type contain an identifier anchored type?
288 do
289 if attached actual_parameters as l_actual_parameters then
290 Result := l_actual_parameters.has_identifier_anchored_type
291 end
292 end
293
294 depends_on_qualified_anchored_type (a_context: ET_TYPE_CONTEXT): BOOLEAN
295 -- Does current type depend on a qualified anchored type when
296 -- viewed from `a_context' when trying to determine its base type?
297 do
298 if attached actual_parameters as l_actual_parameters then
299 Result := l_actual_parameters.depends_on_qualified_anchored_type (a_context)
300 end
301 end
302
303 has_formal_types (a_context: ET_TYPE_CONTEXT): BOOLEAN
304 -- Does the named type of current type contain a formal generic parameter
305 -- when viewed from `a_context'?
306 do
307 if attached actual_parameters as l_actual_parameters then
308 Result := l_actual_parameters.has_formal_types (a_context)
309 end
310 end
311
312 feature -- Comparison
313
314 same_as_base_class: BOOLEAN
315 -- Is current type a non-generic class type with the same
316 -- expandedness and separateness status as its base class,
317 -- or is it its own base class?
318 do
319 -- Result := False
320 end
321
322 feature {ET_TYPE, ET_TYPE_CONTEXT} -- Conformance
323
324 conforms_from_formal_parameter_type_with_type_marks (other: ET_FORMAL_PARAMETER_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK; a_context: ET_TYPE_CONTEXT): BOOLEAN
325 -- Does `other' type appearing in `other_context' conform
326 -- to current type appearing in `a_context'?
327 -- Note that the type mark status of `Current' and `other' is
328 -- overridden by `a_type_mark' and `other_type_mark', if not Void
329 -- (Note: 'current_system.ancestor_builder' is used on the classes
330 -- whose ancestors need to be built in order to check for conformance.)
331 local
332 an_index: INTEGER
333 a_formal: ET_FORMAL_PARAMETER
334 l_detachable_any_type: ET_CLASS_TYPE
335 a_base_class: ET_CLASS
336 do
337 an_index := other.index
338 a_base_class := other_context.base_class
339 if attached a_base_class.formal_parameters as a_formals and then an_index <= a_formals.count then
340 a_formal := a_formals.formal_parameter (an_index)
341 if a_formal.constraint = Void then
342 -- `a_formal' is implicitly constrained by "detachable ANY",
343 -- so it conforms to any type to which "detachable ANY" conforms.
344 if not a_base_class.is_preparsed then
345 -- Internal error: we have a formal parameter of a class that
346 -- is not even preparsed (i.e. for which we know nothing,
347 -- not even its filename). Therefore it is impossible to
348 -- determine whether "detachable ANY" conforms to it.
349 Result := False
350 else
351 -- Keep the attachment mark of `other' (possibly overridden by `other_type_mark').
352 l_detachable_any_type := a_base_class.current_system.detachable_any_type
353 Result := conforms_from_class_type_with_type_marks (l_detachable_any_type, other.overridden_type_mark (other_type_mark), other_context, a_type_mark, a_context)
354 end
355 else
356 if attached a_formal.constraint_base_type as l_base_type then
357 -- The constraint of `a_formal' is not another formal
358 -- parameter, or if it is there is no cycle and
359 -- the resolved base type of this constraint has
360 -- been made available in `base_type'.
361 -- Keep the attachment mark of `other' (possibly overridden by `other_type_mark').
362 Result := l_base_type.conforms_to_type_with_type_marks (Current, a_type_mark, a_context, other.overridden_type_mark (other_type_mark), other_context)
363 else
364 -- There is a cycle of the form "A [G -> H, H -> G]"
365 -- in the constraint of `a_formal'. Therefore `other'
366 -- can only conform to itself.
367 Result := False
368 end
369 end
370 else
371 -- Internal error: does `other' type really appear in `other_context'?
372 Result := False
373 end
374 end
375
376 conforms_from_tuple_type_with_type_marks (other: ET_TUPLE_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK; a_context: ET_TYPE_CONTEXT): BOOLEAN
377 -- Does `other' type appearing in `other_context' conform
378 -- to current type appearing in `a_context'?
379 -- Note that the type mark status of `Current' and `other' is
380 -- overridden by `a_type_mark' and `other_type_mark', if not Void
381 -- (Note: 'current_system.ancestor_builder' is used on the classes
382 -- whose ancestors need to be built in order to check for conformance.)
383 local
384 l_other_base_class: ET_CLASS
385 l_any_type: ET_CLASS_TYPE
386 do
387 l_other_base_class := other.base_class
388 if l_other_base_class.is_preparsed then
389 -- If the base class of a Tuple_type conforms to current class type,
390 -- then the Tuple_type itself conforms to it.
391 -- Keep the attachment mark of `other' (possibly overridden by `other_type_mark').
392 Result := conforms_from_class_type_with_type_marks (l_other_base_class, other.overridden_type_mark (other_type_mark), other_context, a_type_mark, a_context)
393 end
394 if not Result then
395 -- "TUPLE [...]" conforms to "ANY", so "TUPLE [...]"
396 -- conforms to current type if "ANY" conforms to it.
397 if not base_class.is_preparsed then
398 -- Internal error: the base class is not even preparsed (i.e. we
399 -- know nothing, not even its filename). Therefore it is impossible
400 -- to determine whether "ANY" conforms to it.
401 Result := False
402 else
403 -- Keep the attachment mark of `other' (possibly overridden by `other_type_mark').
404 l_any_type := base_class.current_system.any_type
405 Result := conforms_from_class_type_with_type_marks (l_any_type, other.overridden_type_mark (other_type_mark), other_context, a_type_mark, a_context)
406 end
407 end
408 end
409
410 feature -- Type processing
411
412 resolved_formal_parameters (a_parameters: ET_ACTUAL_PARAMETERS): ET_BASE_TYPE
413 -- Version of current type where the formal generic
414 -- parameter types have been replaced by their actual
415 -- counterparts in `a_parameters'
416 do
417 Result := resolved_formal_parameters_with_type_mark (Void, a_parameters)
418 end
419
420 resolved_formal_parameters_with_type_mark (a_type_mark: detachable ET_TYPE_MARK; a_parameters: ET_ACTUAL_PARAMETERS): ET_BASE_TYPE
421 -- Same as `resolved_formal_parameters' except that the type mark status is
422 -- overridden by `a_type_mark', if not Void
423 do
424 Result := type_with_type_mark (a_type_mark)
425 end
426
427 feature -- Type context
428
429 root_context: ET_BASE_TYPE
430 -- Root context
431 do
432 Result := Current
433 ensure then
434 is_root: Result = Current
435 end
436
437 new_type_context (a_type: ET_TYPE): ET_NESTED_TYPE_CONTEXT
438 -- New type context made up of `a_type' in current context
439 do
440 create Result.make_with_capacity (Current, 1)
441 Result.put_last (a_type)
442 end
443
444 context_base_type_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): ET_BASE_TYPE
445 -- Same as `base_type' except that its type mark status is
446 -- overridden by `a_type_mark', if not Void
447 do
448 Result := type_with_type_mark (a_type_mark)
449 end
450
451 context_base_type_actual (i: INTEGER): ET_NAMED_TYPE
452 -- `i'-th actual generic parameter's type of `base_type'
453 do
454 Result := base_type_actual (i, Current)
455 end
456
457 context_base_type_actual_parameter (i: INTEGER): ET_ACTUAL_PARAMETER
458 -- `i'-th actual generic parameter of `base_type'
459 do
460 Result := base_type_actual_parameter (i, Current)
461 end
462
463 context_base_type_actual_count: INTEGER
464 -- Number of actual generic parameters of `base_type'
465 do
466 Result := base_type_actual_count (Current)
467 end
468
469 context_base_type_index_of_label (a_label: ET_IDENTIFIER): INTEGER
470 -- Index of actual generic parameter with label `a_label' in `base_type';
471 -- 0 if it does not exist
472 do
473 Result := index_of_label (a_label)
474 end
475
476 context_named_type_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): ET_NAMED_TYPE
477 -- Same as `named_type' except that its type mark status is
478 -- overridden by `a_type_mark', if not Void
479 do
480 Result := type_with_type_mark (a_type_mark)
481 end
482
483 is_root_context: BOOLEAN
484 -- Is current context its own root context?
485 do
486 Result := True
487 end
488
489 is_valid_context: BOOLEAN
490 -- A context is valid if its `root_context' is only made up
491 -- of class names and formal generic parameter names, and if
492 -- the actual parameters of these formal parameters are
493 -- themselves
494 do
495 Result := is_valid_context_type (Current)
496 end
497
498 is_valid_context_type (a_root_context: ET_BASE_TYPE): BOOLEAN
499 -- Is current type only made up of class names and
500 -- formal generic parameter names, and are the actual
501 -- parameters of these formal parameters themselves
502 -- in `a_root_context'?
503 local
504 i, nb: INTEGER
505 do
506 Result := True
507 if attached actual_parameters as a_parameters then
508 nb := a_parameters.count
509 from i := 1 until i > nb loop
510 if not a_parameters.type (i).is_valid_context_type (a_root_context) then
511 Result := False
512 i := nb + 1 -- Jump out of the look.
513 else
514 i := i + 1
515 end
516 end
517 end
518 end
519
520 context_is_type_expanded_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
521 -- Same as `context_is_type_expanded' except that the type mark status is
522 -- overridden by `a_type_mark', if not Void
523 do
524 Result := is_type_expanded_with_type_mark (a_type_mark, Current)
525 end
526
527 context_is_type_reference_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
528 -- Same as `context_is_type_reference' except that the type mark status is
529 -- overridden by `a_type_mark', if not Void
530 do
531 Result := is_type_reference_with_type_mark (a_type_mark, Current)
532 end
533
534 context_is_type_attached_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
535 -- Same as `context_is_type_attached' except that the type mark status is
536 -- overridden by `a_type_mark', if not Void
537 do
538 Result := is_type_attached_with_type_mark (a_type_mark, Current)
539 end
540
541 context_is_type_detachable_with_type_mark (a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
542 -- Same as `context_is_type_detachable' except that the type mark status is
543 -- overridden by `a_type_mark', if not Void
544 do
545 Result := is_type_detachable_with_type_mark (a_type_mark, Current)
546 end
547
548 context_base_type_has_class (a_class: ET_CLASS): BOOLEAN
549 -- Does the base type of current context contain `a_class'?
550 do
551 Result := base_type_has_class (a_class, Current)
552 end
553
554 context_named_type_has_class (a_class: ET_CLASS): BOOLEAN
555 -- Does the named type of current context contain `a_class'?
556 do
557 Result := named_type_has_class (a_class, Current)
558 end
559
560 context_same_named_type_with_type_marks (other: ET_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
561 -- Same as `context_same_named_type' except that the type mark status of `Current'
562 -- and `other' is overridden by `a_type_mark' and `other_type_mark', if not Void
563 do
564 Result := same_named_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
565 end
566
567 context_same_base_type_with_type_marks (other: ET_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
568 -- Same as `context_same_base_type' except that the type mark status of `Current'
569 -- and `other' is overridden by `a_type_mark' and `other_type_mark', if not Void
570 do
571 Result := same_base_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
572 end
573
574 context_conforms_to_type_with_type_marks (other: ET_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
575 -- Same as `context_conforms_to_type' except that the type mark status of `Current'
576 -- and `other' is overridden by `a_type_mark' and `other_type_mark', if not Void
577 do
578 Result := conforms_to_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
579 end
580
581 to_nested_type_context: ET_NESTED_TYPE_CONTEXT
582 -- Nested type context corresponding to the same type as current;
583 -- Return a new object at each call.
584 do
585 create Result.make_with_capacity (Current, 1)
586 end
587
588 feature {ET_TYPE, ET_TYPE_CONTEXT} -- Type context
589
590 context_same_named_class_type_with_type_marks (other: ET_CLASS_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
591 -- Do current context and `other' type appearing in
592 -- `other_context' have the same named type?
593 -- Note that the type mark status of `Current' and `other' is
594 -- overridden by `a_type_mark' and `other_type_mark', if not Void
595 do
596 Result := same_named_class_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
597 end
598
599 context_same_named_formal_parameter_type_with_type_marks (other: ET_FORMAL_PARAMETER_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
600 -- Do current context and `other' type appearing in
601 -- `other_context' have the same named type?
602 -- Note that the type mark status of `Current' and `other' is
603 -- overridden by `a_type_mark' and `other_type_mark', if not Void
604 do
605 Result := same_named_formal_parameter_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
606 end
607
608 context_same_named_tuple_type_with_type_marks (other: ET_TUPLE_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
609 -- Do current context and `other' type appearing in
610 -- `other_context' have the same named type?
611 -- Note that the type mark status of `Current' and `other' is
612 -- overridden by `a_type_mark' and `other_type_mark', if not Void
613 do
614 Result := same_named_tuple_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
615 end
616
617 context_same_base_class_type_with_type_marks (other: ET_CLASS_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
618 -- Do current context and `other' type appearing in
619 -- `other_context' have the same base type?
620 -- Note that the type mark status of `Current' and `other' is
621 -- overridden by `a_type_mark' and `other_type_mark', if not Void
622 do
623 Result := same_base_class_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
624 end
625
626 context_same_base_formal_parameter_type_with_type_marks (other: ET_FORMAL_PARAMETER_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
627 -- Do current context and `other' type appearing in
628 -- `other_context' have the same base type?
629 -- Note that the type mark status of `Current' and `other' is
630 -- overridden by `a_type_mark' and `other_type_mark', if not Void
631 do
632 Result := same_base_formal_parameter_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
633 end
634
635 context_same_base_tuple_type_with_type_marks (other: ET_TUPLE_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
636 -- Do current context and `other' type appearing in
637 -- `other_context' have the same base type?
638 -- Note that the type mark status of `Current' and `other' is
639 -- overridden by `a_type_mark' and `other_type_mark', if not Void
640 do
641 Result := same_base_tuple_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
642 end
643
644 context_conforms_from_class_type_with_type_marks (other: ET_CLASS_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
645 -- Does `other' type appearing in `other_context' conform to current context?
646 -- Note that the type mark status of `Current' and `other' is
647 -- overridden by `a_type_mark' and `other_type_mark', if not Void
648 -- (Note: 'current_system.ancestor_builder' is used on the classes
649 -- whose ancestors need to be built in order to check for conformance.)
650 do
651 Result := conforms_from_class_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
652 end
653
654 context_conforms_from_formal_parameter_type_with_type_marks (other: ET_FORMAL_PARAMETER_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
655 -- Does `other' type appearing in `other_context' conform to current context?
656 -- Note that the type mark status of `Current' and `other' is
657 -- overridden by `a_type_mark' and `other_type_mark', if not Void
658 -- (Note: 'current_system.ancestor_builder' is used on the classes
659 -- whose ancestors need to be built in order to check for conformance.)
660 do
661 Result := conforms_from_formal_parameter_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
662 end
663
664 context_conforms_from_tuple_type_with_type_marks (other: ET_TUPLE_TYPE; other_type_mark: detachable ET_TYPE_MARK; other_context: ET_TYPE_CONTEXT; a_type_mark: detachable ET_TYPE_MARK): BOOLEAN
665 -- Does `other' type appearing in `other_context' conform to current context?
666 -- Note that the type mark status of `Current' and `other' is
667 -- overridden by `a_type_mark' and `other_type_mark', if not Void
668 -- (Note: 'current_system.ancestor_builder' is used on the classes
669 -- whose ancestors need to be built in order to check for conformance.)
670 do
671 Result := conforms_from_tuple_type_with_type_marks (other, other_type_mark, other_context, a_type_mark, Current)
672 end
673
674 invariant
675
676 is_root_context: is_root_context
677 named_base_class_not_void: named_base_class /= Void
678
679 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23