diff options
author | ronny | 1999-10-05 13:09:14 +0000 |
---|---|---|
committer | ronny | 1999-10-05 13:09:14 +0000 |
commit | db9e59813541e06caece64592854862bab9c0138 (patch) | |
tree | ae7cef5982a377261188aed09dc0f0cc95c50f8c /frontend/overloading.dcl | |
parent | Standard project directories initialized by cvs2svn. (diff) |
Initial import
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/overloading.dcl')
-rw-r--r-- | frontend/overloading.dcl | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/frontend/overloading.dcl b/frontend/overloading.dcl new file mode 100644 index 0000000..2b1accb --- /dev/null +++ b/frontend/overloading.dcl @@ -0,0 +1,52 @@ +definition module overloading + +import StdEnv +import syntax, check + +:: InstanceTree = IT_Node !(Global Index) !InstanceTree !InstanceTree | IT_Empty + +:: ClassInstanceInfo :== {# {! .InstanceTree}} + +:: ArrayInstance = + { ai_record :: !TypeSymbIdent + , ai_members :: !{# DefinedSymbol} + } + +:: GlobalTCInstance = + { gtci_type :: !GlobalTCType + , gtci_index :: !Index + } + +:: SpecialInstances = + { si_next_array_member_index :: !Index + , si_array_instances :: ![ArrayInstance] + , si_next_TC_member_index :: !Index + , si_TC_instances :: ![GlobalTCInstance] + } + +:: OverloadingState = + { os_type_heaps :: !.TypeHeaps + , os_var_heap :: !.VarHeap + , os_symbol_heap :: !.ExpressionHeap + , os_predef_symbols :: !.PredefinedSymbols + , os_special_instances :: !.SpecialInstances + , os_error :: !.ErrorAdmin + } + +:: LocalTypePatternVariable + +tryToSolveOverloading :: ![(Optional [TypeContext], [ExprInfoPtr], IdentPos)] !{# CommonDefs } !ClassInstanceInfo !*Coercions !*OverloadingState + -> (![TypeContext], !*Coercions, ![LocalTypePatternVariable], !*OverloadingState) + +:: TypeCodeInfo = + { tci_next_index :: !Index + , tci_instances :: ![GlobalTCInstance] + , tci_type_var_heap :: !.TypeVarHeap + } + +removeOverloadedFunctions :: ![Int] ![(Optional [TypeContext], IdentPos)] ![TypeContext] ![LocalTypePatternVariable] !*{#FunDef} !*ExpressionHeap + !*TypeCodeInfo !*VarHeap !*ErrorAdmin + -> (!*{#FunDef}, !*ExpressionHeap, !*TypeCodeInfo, !*VarHeap, !*ErrorAdmin) + +updateDynamics :: ![Int] ![TypeContext] ![LocalTypePatternVariable] !*{#FunDef} !*ExpressionHeap !*TypeCodeInfo !*VarHeap !*ErrorAdmin + -> (!*{#FunDef}, !*ExpressionHeap, !*TypeCodeInfo, !*VarHeap, !*ErrorAdmin) |