Commit 4939c751 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl
Browse files

mark constructors of dictionaries of classes in imported instances

parent f2aff0b0
......@@ -11,9 +11,12 @@ convertIclModule main_dcl_module_n common_defs imported_types imported_conses va
#! types_and_heaps = convertConstructorTypes common_defs.[main_dcl_module_n].com_cons_defs main_dcl_module_n common_defs (imported_types, imported_conses, var_heap, type_heaps)
# (imported_types,imported_conses,var_heap,type_heaps)
= convertSelectorTypes common_defs.[main_dcl_module_n].com_selector_defs main_dcl_module_n common_defs types_and_heaps
# {com_class_defs,com_type_defs,com_cons_defs,com_selector_defs,com_member_defs} = common_defs.[main_dcl_module_n]
{com_class_defs,com_type_defs,com_cons_defs,com_selector_defs,com_member_defs,com_instance_defs} = common_defs.[main_dcl_module_n]
(imported_types,imported_conses,var_heap,type_heaps)
= convert_member_types_of_module 0 com_class_defs com_type_defs com_cons_defs com_selector_defs com_member_defs main_dcl_module_n common_defs
imported_types imported_conses var_heap type_heaps
(imported_conses,var_heap) = mark_imported_classes_in_instances 0 main_dcl_module_n com_instance_defs common_defs imported_conses var_heap
= (imported_types,imported_conses,var_heap,type_heaps)
convertDclModule :: !Int !{# DclModule} !{# CommonDefs} !*{#{# CheckedTypeDef}} !ImportedConstructors !*VarHeap !*TypeHeaps
-> (!*{#{# CheckedTypeDef}},!ImportedConstructors,!*VarHeap,!*TypeHeaps)
......@@ -79,6 +82,29 @@ convert_member_types module_i main_dcl_module_n dcl_mods common_defs used_module
= convert_member_types (module_i+1) main_dcl_module_n dcl_mods common_defs used_module_numbers imported_types imported_conses var_heap type_heaps
= convert_member_types (module_i+1) main_dcl_module_n dcl_mods common_defs used_module_numbers imported_types imported_conses var_heap type_heaps
mark_imported_classes_in_instances :: !Int !Int !{#ClassInstance} {#CommonDefs} !ImportedConstructors !*VarHeap
-> (!ImportedConstructors,!*VarHeap)
mark_imported_classes_in_instances instance_i main_dcl_module_n instance_defs common_defs imported_conses var_heap
| instance_i<size instance_defs
# {gi_module,gi_index} = instance_defs.[instance_i].ins_class_index
| gi_module==main_dcl_module_n
= mark_imported_classes_in_instances (instance_i+1) main_dcl_module_n instance_defs common_defs imported_conses var_heap
# {com_class_defs,com_type_defs,com_cons_defs} = common_defs.[gi_module]
{ds_index=type_index} = com_class_defs.[gi_index].class_dictionary
{td_rhs=RecordType {rt_constructor={ds_index=cons_index}}} = com_type_defs.[type_index]
{cons_type_ptr} = com_cons_defs.[cons_index]
(cons_type_ptr_v,var_heap) = readPtr cons_type_ptr var_heap
= case cons_type_ptr_v of
VI_Used
-> mark_imported_classes_in_instances (instance_i+1) main_dcl_module_n instance_defs common_defs imported_conses var_heap
VI_ExpandedType _
-> mark_imported_classes_in_instances (instance_i+1) main_dcl_module_n instance_defs common_defs imported_conses var_heap
_
# var_heap = writePtr cons_type_ptr VI_Used var_heap
imported_conses = [{glob_module=gi_module,glob_object=cons_index}:imported_conses]
-> mark_imported_classes_in_instances (instance_i+1) main_dcl_module_n instance_defs common_defs imported_conses var_heap
= (imported_conses,var_heap)
convert_member_types_of_module :: !Int !{#ClassDef} !{#CheckedTypeDef} !{#ConsDef} !{#SelectorDef} !{#MemberDef} !Int !{#CommonDefs}
!*{#{#CheckedTypeDef}} ![Global Int] !*VarHeap !*TypeHeaps
-> (!*{#{#CheckedTypeDef}},![Global Int],!*VarHeap,!*TypeHeaps)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment