Commit cb71daec authored by clean's avatar clean
Browse files

caching of dcl modules, return unique heap

parent 9207c4bf
......@@ -3,4 +3,4 @@ definition module backendconvert
from backend import BackEnd
import frontend
backEndConvertModules :: PredefinedSymbols FrontEndSyntaxTree VarHeap *BackEnd -> *BackEnd
backEndConvertModules :: PredefinedSymbols FrontEndSyntaxTree !Int *VarHeap *BackEnd -> (!*VarHeap,!*BackEnd)
This diff is collapsed.
......@@ -2,4 +2,4 @@ definition module backendinterface
import frontend
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !*FrontEndSyntaxTree !*File !*Files -> (!Bool, !*File, !*Files)
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*File !*Files -> (!Bool,!*VarHeap, !*File, !*Files)
......@@ -19,8 +19,8 @@ checkVersion VersionObservedIsTooOld errorFile
= fwrites "[Backend] the back end library is too old\n" errorFile
= (False, errorFile)
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !*FrontEndSyntaxTree !*File !*Files -> (!Bool, !*File, !*Files)
backEndInterface outputFileName commandLineArgs predefs syntaxTree errorFile files
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*File !*Files -> (!Bool,!*VarHeap, !*File, !*Files)
backEndInterface outputFileName commandLineArgs predef_symbols syntaxTree=:{fe_icl,fe_components} main_dcl_module_n var_heap errorFile files
# (observedCurrent, observedOldestDefinition, observedOldestImplementation)
= BEGetVersion
observedVersion =
......@@ -42,25 +42,22 @@ backEndInterface outputFileName commandLineArgs predefs syntaxTree errorFile fil
# (compatible, errorFile)
= checkVersion (versionCompare expectedVersion observedVersion) errorFile
| not compatible
= (False, errorFile, files)
= (False, var_heap,errorFile, files)
# varHeap
= backEndPreprocess predefs.[PD_DummyForStrictAliasFun].pds_ident functionIndices
syntaxTree.fe_icl syntaxTree.fe_varHeap
= backEndPreprocess predef_symbols.[PD_DummyForStrictAliasFun].pds_ident functionIndices fe_icl var_heap
with
functionIndices
= flatten [[member \\ member <- group.group_members] \\ group <-: syntaxTree.fe_components]
syntaxTree
= {syntaxTree & fe_varHeap = varHeap}
= flatten [[member \\ member <- group.group_members] \\ group <-: fe_components]
# backEndFiles
= 0
# (backEnd, backEndFiles)
= BEInit (length commandLineArgs) backEndFiles
# backEnd
= foldState BEArg commandLineArgs backEnd
# backEnd
= backEndConvertModules predefs syntaxTree varHeap backEnd
# (var_heap,backEnd)
= backEndConvertModules predef_symbols syntaxTree main_dcl_module_n varHeap backEnd
# (success, backEnd)
= BEGenerateCode outputFileName backEnd
# backEndFiles
= BEFree backEnd backEndFiles
= (backEndFiles == 0 && success, errorFile, files)
= (backEndFiles == 0 && success, var_heap,errorFile, files)
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