Commit 86ffe137 authored by Jurrien Stutterheim's avatar Jurrien Stutterheim
Browse files

Pre-merge commit

parent 6d0c02ae
This diff is collapsed.
This diff is collapsed.
No preview for this file type
No preview for this file type
definition module expand_types
import syntax
simplifyTypeApplication :: !Type ![AType] -> Type
convertSymbolType :: !Bool !{#CommonDefs} !SymbolType !Int !*ImportedTypes !ImportedConstructors !*TypeHeaps !*VarHeap
-> (!SymbolType, !*ImportedTypes,!ImportedConstructors,!*TypeHeaps,!*VarHeap)
convertSymbolTypeWithoutExpandingAbstractSynTypes :: !Bool !{#CommonDefs} !SymbolType !Int
!*ImportedTypes !ImportedConstructors !*TypeHeaps !*VarHeap
-> (!SymbolType, !Bool, !*ImportedTypes,!ImportedConstructors,!*TypeHeaps,!*VarHeap)
convertSymbolTypeWithoutCollectingImportedConstructors :: !Bool !{#CommonDefs} !SymbolType !Int !*ImportedTypes !*TypeHeaps !*VarHeap
-> (!SymbolType,!*ImportedTypes,!*TypeHeaps,!*VarHeap)
addTypesOfDictionaries :: !{#CommonDefs} ![TypeContext] ![AType] -> [AType]
RemoveAnnotationsMask:==1
ExpandAbstractSynTypesMask:==2
DontCollectImportedConstructors:==4
:: ExpandTypeState =
{ ets_type_defs :: !.{#{#CheckedTypeDef}}
, ets_collected_conses :: !ImportedConstructors
, ets_type_heaps :: !.TypeHeaps
, ets_var_heap :: !.VarHeap
, ets_main_dcl_module_n :: !Int
, ets_contains_unexpanded_abs_syn_type :: !Bool
}
class expandSynTypes a :: !Int !{#CommonDefs} !a !*ExpandTypeState -> (!Bool,!a, !*ExpandTypeState)
instance expandSynTypes (a,b) | expandSynTypes a & expandSynTypes b special a=[AType],b=AType
class substitute a :: !a !*TypeHeaps -> (!Bool, !a, !*TypeHeaps)
instance substitute Type,AType,TypeContext,AttrInequality,CaseType
instance substitute [a] | substitute a special a=AType; a=TypeContext; a=AttrInequality
class removeAnnotations a :: !a -> (!Bool, !a)
instance removeAnnotations Type,SymbolType
definition module expand_types
import syntax
simplifyTypeApplication :: !Type ![AType] -> Type
convertSymbolType :: !Bool !{#CommonDefs} !SymbolType !Int !*ImportedTypes !ImportedConstructors !*TypeHeaps !*VarHeap
-> (!SymbolType, !*ImportedTypes,!ImportedConstructors,!*TypeHeaps,!*VarHeap)
convertSymbolTypeWithoutExpandingAbstractSynTypes :: !Bool !{#CommonDefs} !SymbolType !Int
!*ImportedTypes !ImportedConstructors !*TypeHeaps !*VarHeap
-> (!SymbolType, !Bool, !*ImportedTypes,!ImportedConstructors,!*TypeHeaps,!*VarHeap)
convertSymbolTypeWithoutCollectingImportedConstructors :: !Bool !{#CommonDefs} !SymbolType !Int !*ImportedTypes !*TypeHeaps !*VarHeap
-> (!SymbolType,!*ImportedTypes,!*TypeHeaps,!*VarHeap)
addTypesOfDictionaries :: !{#CommonDefs} ![TypeContext] ![AType] -> [AType]
RemoveAnnotationsMask:==1
ExpandAbstractSynTypesMask:==2
DontCollectImportedConstructors:==4
:: ExpandTypeState =
{ ets_type_defs :: !.{#{#CheckedTypeDef}}
, ets_collected_conses :: !ImportedConstructors
, ets_type_heaps :: !.TypeHeaps
, ets_var_heap :: !.VarHeap
, ets_main_dcl_module_n :: !Int
, ets_contains_unexpanded_abs_syn_type :: !Bool
}
class expandSynTypes a :: !Int !{#CommonDefs} !a !*ExpandTypeState -> (!Bool,!a, !*ExpandTypeState)
instance expandSynTypes (a,b) | expandSynTypes a & expandSynTypes b special a=[AType],b=AType
class substitute a :: !a !*TypeHeaps -> (!Bool, !a, !*TypeHeaps)
instance substitute Type,AType,TypeContext,AttrInequality,CaseType
instance substitute [a] | substitute a special a=AType; a=TypeContext; a=AttrInequality
class removeAnnotations a :: !a -> (!Bool, !a)
instance removeAnnotations Type,SymbolType
This diff is collapsed.
definition module gensapl
import StdEnv,syntax,transform,backend
:: SaplAnnotation = SA_None | SA_Strict
:: SaplExp = SaplApp SaplExp SaplExp
| SaplLit SaplLiteral
| SaplFun String
| SaplVar String VarInfoPtr SaplAnnotation (Optional Type) // VarInfoPtr: for comparison
| SaplCase SaplExp [(SaplPattern,SaplExp)] (Optional SaplExp)
| SaplLet [((SaplAnnotation,Type),SaplExp,SaplExp)] SaplExp
| SaplSelect SaplExp String Int
| SaplUpdate SaplExp String [(Int, SaplExp)]
| SaplError String
:: SaplLiteral = LInt Int
| LReal Real
| LBool Bool
| LChar String
| LString String
:: SaplPattern = PCons String [SaplExp]
| PLit SaplLiteral
// | PDefault
// module name, type name, constructor name, ?alt?, nrargs, strictness info, nrconstructors
::SaplConsDef = SaplConsDef !String !String !String !Int !Int ![Type] !StrictnessList !Int
// fun name, nrargs, args, body, type, return type
::SaplFuncDef = SaplFuncDef !String !Int ![SaplExp] !SaplExp !FunKind !Type
// module name, type name, list of field names and global field indeces
::SaplRecordDef = SaplRecordDef !String !String !StrictnessList [(!String, !Int, !Type)]
instance toString SaplExp
instance toString SaplConsDef
instance toString SaplFuncDef
instance toString SaplRecordDef
renameVars :: SaplFuncDef -> SaplFuncDef
CleanFunctoSaplFunc :: Int CommonDefs Int Int FunDef String {#DclModule} [IndexRange] !*BackEnd !*Heaps -> *(!*BackEnd, !*Heaps, !SaplFuncDef)
definition module gensapl
import StdEnv,syntax,transform,backend
:: SaplAnnotation = SA_None | SA_Strict
:: SaplExp = SaplApp SaplExp SaplExp
| SaplLit SaplLiteral
| SaplFun String
| SaplVar String VarInfoPtr SaplAnnotation (Optional Type) // VarInfoPtr: for comparison
| SaplCase SaplExp [(SaplPattern,SaplExp)] (Optional SaplExp)
| SaplLet [((SaplAnnotation,Type),SaplExp,SaplExp)] SaplExp
| SaplSelect SaplExp String Int
| SaplUpdate SaplExp String [(Int, SaplExp)]
| SaplError String
:: SaplLiteral = LInt Int
| LReal Real
| LBool Bool
| LChar String
| LString String
:: SaplPattern = PCons String [SaplExp]
| PLit SaplLiteral
// | PDefault
// module name, type name, constructor name, ?alt?, nrargs, strictness info, nrconstructors
::SaplConsDef = SaplConsDef !String !String !String !Int !Int ![Type] !StrictnessList !Int
// fun name, nrargs, args, body, type, return type
::SaplFuncDef = SaplFuncDef !String !Int ![SaplExp] !SaplExp !FunKind !Type
// module name, type name, list of field names and global field indeces
::SaplRecordDef = SaplRecordDef !String !String !StrictnessList [(!String, !Int, !Type)]
instance toString SaplExp
instance toString SaplConsDef
instance toString SaplFuncDef
instance toString SaplRecordDef
renameVars :: SaplFuncDef -> SaplFuncDef
CleanFunctoSaplFunc :: Int CommonDefs Int Int FunDef String {#DclModule} [IndexRange] !*BackEnd !*Heaps -> *(!*BackEnd, !*Heaps, !SaplFuncDef)
......@@ -3923,7 +3923,7 @@ wantListExp is_pattern pState
-> wantListComprehension head_strictness (acc!!0) pState
// otherwise // length acc <> 1
# nil_expr = makeNilExpression head_strictness is_pattern
pState = parseError "list comprehension" No "one expressions before \\\\ " pState
pState = parseError "list comprehension" No "one expressions before \\\\" pState
-> (gen_cons_nodes acc nil_expr,pState)
_ # nil_expr = makeNilExpression head_strictness is_pattern
pState = parseError "list" (Yes token) "list element separator" pState
......
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