Commit fdee8d7a authored by John van Groningen's avatar John van Groningen
Browse files

pass TypeVarHeap to backEndInterface (currently not used, but we will need it later)

parent 28558a7d
...@@ -5,4 +5,6 @@ definition module backendinterface ...@@ -5,4 +5,6 @@ definition module backendinterface
import frontend import frontend
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*AttrVarHeap !*File !*File -> (!Bool, !*VarHeap, !*AttrVarHeap, !*File, !*File) backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int
!*VarHeap !*TypeVarHeap !*AttrVarHeap !*File !*File
-> (!Bool,!*VarHeap,!*TypeVarHeap,!*AttrVarHeap,!*File,!*File)
...@@ -23,8 +23,11 @@ checkVersion VersionObservedIsTooOld errorFile ...@@ -23,8 +23,11 @@ checkVersion VersionObservedIsTooOld errorFile
= fwrites "Error: the back end library is too old\n" errorFile = fwrites "Error: the back end library is too old\n" errorFile
= (False, errorFile) = (False, errorFile)
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*AttrVarHeap !*File !*File -> (!Bool, !*VarHeap, !*AttrVarHeap, !*File, !*File) backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int
backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbols syntaxTree=:{fe_icl,fe_components,fe_dcls} main_dcl_module_n var_heap attrHeap errorFile outFile !*VarHeap !*TypeVarHeap !*AttrVarHeap !*File !*File
-> (!Bool,!*VarHeap,!*TypeVarHeap,!*AttrVarHeap,!*File,!*File)
backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbols syntaxTree=:{fe_icl,fe_components,fe_dcls} main_dcl_module_n
var_heap type_var_heap attrHeap errorFile outFile
# (observedCurrent, observedOldestDefinition, observedOldestImplementation) # (observedCurrent, observedOldestDefinition, observedOldestImplementation)
= BEGetVersion = BEGetVersion
observedVersion = observedVersion =
...@@ -46,7 +49,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo ...@@ -46,7 +49,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo
# (compatible, errorFile) # (compatible, errorFile)
= checkVersion (versionCompare expectedVersion observedVersion) errorFile = checkVersion (versionCompare expectedVersion observedVersion) errorFile
| not compatible | not compatible
= (False, var_heap, attrHeap, errorFile, outFile) = (False, var_heap, type_var_heap, attrHeap, errorFile, outFile)
# varHeap # varHeap
= backEndPreprocess predefined_idents.[PD_DummyForStrictAliasFun] functionIndices fe_icl var_heap = backEndPreprocess predefined_idents.[PD_DummyForStrictAliasFun] functionIndices fe_icl var_heap
with with
...@@ -79,7 +82,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo ...@@ -79,7 +82,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo
= optionallyPrintFunctionTypes listTypes typesPath (DictionaryToClassInfo main_dcl_module_n fe_icl fe_dcls) fe_components fe_icl.icl_functions attrHeap outFile backEnd = optionallyPrintFunctionTypes listTypes typesPath (DictionaryToClassInfo main_dcl_module_n fe_icl fe_dcls) fe_components fe_icl.icl_functions attrHeap outFile backEnd
# backEndFiles # backEndFiles
= BEFree backEnd backEndFiles = BEFree backEnd backEndFiles
= (backEndFiles == 0 && success, var_heap, attrHeap, errorFile, outFile) = (backEndFiles == 0 && success, var_heap, type_var_heap, attrHeap, errorFile, outFile)
:: DictionaryToClassInfo = :: DictionaryToClassInfo =
{ dtci_iclModuleIndex :: Int { dtci_iclModuleIndex :: Int
......
...@@ -324,14 +324,16 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede ...@@ -324,14 +324,16 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
= abort ("couldn't close stdio") = abort ("couldn't close stdio")
# var_heap=heaps.hp_var_heap # var_heap=heaps.hp_var_heap
hp_type_heaps=heaps.hp_type_heaps hp_type_heaps=heaps.hp_type_heaps
type_var_heap=hp_type_heaps.th_vars
attrHeap=hp_type_heaps.th_attrs attrHeap=hp_type_heaps.th_attrs
# (success,functions_and_macros,var_heap,attrHeap,error, out) # (success,functions_and_macros,var_heap,type_var_heap,attrHeap,error,out)
= case optionalSyntaxTree of = case optionalSyntaxTree of
Yes syntaxTree Yes syntaxTree
# functions_and_macros = syntaxTree.fe_icl.icl_functions # functions_and_macros = syntaxTree.fe_icl.icl_functions
# (success, var_heap, attrHeap, error, out) # (success, var_heap, type_var_heap, attrHeap, error, out)
= backEndInterface outputPath (map appendRedirection backendArgs) options.listTypes options.outPath predef_symbols syntaxTree main_dcl_module_n var_heap attrHeap error out = backEndInterface outputPath (map appendRedirection backendArgs) options.listTypes options.outPath predef_symbols syntaxTree main_dcl_module_n
-> (success,functions_and_macros,var_heap,attrHeap, error, out) var_heap type_var_heap attrHeap error out
-> (success,functions_and_macros,var_heap,type_var_heap,attrHeap,error,out)
with with
appendRedirection arg appendRedirection arg
= case arg of = case arg of
...@@ -342,7 +344,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede ...@@ -342,7 +344,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
arg arg
-> arg -> arg
No No
-> (False,{},var_heap,attrHeap,error, out) -> (False,{},var_heap,type_var_heap,attrHeap,error,out)
with with
/* /*
outputPath outputPath
...@@ -353,7 +355,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede ...@@ -353,7 +355,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
outputPath outputPath
// = /* directoryName options.pathName +++ "Clean System Files" +++ {DirectorySeparator} +++ */ baseName options.pathName // = /* directoryName options.pathName +++ "Clean System Files" +++ {DirectorySeparator} +++ */ baseName options.pathName
= baseName options.pathName = baseName options.pathName
# heaps = {heaps & hp_var_heap=var_heap, hp_type_heaps = {hp_type_heaps & th_attrs = attrHeap}} # heaps = {heaps & hp_var_heap=var_heap, hp_type_heaps = {th_vars=type_var_heap, th_attrs=attrHeap}}
# (closed, files) = fclose out files # (closed, files) = fclose out files
| not closed | not closed
= abort ("couldn't close out file \"" +++ options.outPath +++ "\"\n") = abort ("couldn't close out file \"" +++ options.outPath +++ "\"\n")
......
Supports Markdown
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