convertcases.dcl 1.05 KB
Newer Older
1
2
3
/*
	module owner: Ronny Wichers Schreur
*/
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
4
5
definition module convertcases

6
import syntax, transform
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
7

8
convertCasesOfFunctions :: !*{! Group} !Int !{# {# FunType} } !{# CommonDefs} !*{#FunDef} !*{#{# CheckedTypeDef}}
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
9
10
11
		!ImportedConstructors !*VarHeap !*TypeHeaps !*ExpressionHeap
			-> (!ImportedFunctions, !*{! Group}, !*{#FunDef}, !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap)

12
newFunction :: !(Optional Ident) !FunctionBody ![FreeVar] ![AType] !AType !Int !(!Int, ![FunctionInfoPtr],!*FunctionHeap)
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
13
14
	-> (! SymbIdent, !(!Int, ![FunctionInfoPtr],!*FunctionHeap))

15
16
17
18
19
20
21

::	TypedVariable =
	{	tv_free_var	:: !FreeVar
	,	tv_type		:: !AType
	}

copyExpression :: ![TypedVariable] !Expression !*VarHeap -> (![Expression], ![TypedVariable], ![FreeVar], !Expression, !*VarHeap)
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
22

23
addNewFunctionsToGroups :: !{#.CommonDefs} FunctionHeap ![FunctionInfoPtr] !Int !*{! Group} !*{#{# CheckedTypeDef}} !ImportedFunctions !*TypeHeaps !*VarHeap
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
24
25
	-> (!*{! Group}, ![FunDef],  !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*TypeHeaps, !*VarHeap)