Commit 21d3d959 authored by Martijn Vervoort's avatar Martijn Vervoort
Browse files

compiler option added: -dynamics which instructs the compiler to generate

tcl (type files)
parent af8a2369
...@@ -20,6 +20,9 @@ generate_tcl_file :== False; ...@@ -20,6 +20,9 @@ generate_tcl_file :== False;
, outPath:: {#Char} , outPath:: {#Char}
, outMode:: Int , outMode:: Int
, searchPaths:: SearchPaths , searchPaths:: SearchPaths
// MV ...
, compile_for_dynamics :: !Bool
// ... MV
} }
InitialCoclOptions = InitialCoclOptions =
...@@ -30,6 +33,9 @@ InitialCoclOptions = ...@@ -30,6 +33,9 @@ InitialCoclOptions =
, outPath= "out" , outPath= "out"
, outMode= FWriteText , outMode= FWriteText
, searchPaths= {sp_locations = [], sp_paths = []} , searchPaths= {sp_locations = [], sp_paths = []}
// MV ...
, compile_for_dynamics = False
// ... MV
} }
:: DclCache = { :: DclCache = {
...@@ -51,6 +57,9 @@ compile args cache files ...@@ -51,6 +57,9 @@ compile args cache files
# (args_without_modules,modules,cocl_options) = parseCommandLine args InitialCoclOptions # (args_without_modules,modules,cocl_options) = parseCommandLine args InitialCoclOptions
= compile_modules modules 0 cocl_options args_without_modules cache files; = compile_modules modules 0 cocl_options args_without_modules cache files;
// WARNING:
// if you add an option which is not supported by the backend, then you should remove it from
// the first list in the tuple returned by parseCommandLine
parseCommandLine :: [{#Char}] CoclOptions -> ([{#Char}],[{#Char}],CoclOptions) parseCommandLine :: [{#Char}] CoclOptions -> ([{#Char}],[{#Char}],CoclOptions)
parseCommandLine [] options parseCommandLine [] options
= ([],[],options) = ([],[],options)
...@@ -81,6 +90,13 @@ parseCommandLine [arg1=:"-RE", errorPath : args] options ...@@ -81,6 +90,13 @@ parseCommandLine [arg1=:"-RE", errorPath : args] options
parseCommandLine [arg1=:"-RAE", errorPath : args] options parseCommandLine [arg1=:"-RAE", errorPath : args] options
# (args,modules,options)= parseCommandLine args {options & errorPath = stripQuotes errorPath, errorMode = FAppendText} # (args,modules,options)= parseCommandLine args {options & errorPath = stripQuotes errorPath, errorMode = FAppendText}
= ([arg1,errorPath:args],modules,options) = ([arg1,errorPath:args],modules,options)
// MV ...
parseCommandLine [arg1=:"-dynamics":args] options
// generates for each icl an tcl (which contains the type information for that module)
# (args,modules,options)= parseCommandLine args {options & compile_for_dynamics = True}
= (args,modules,options)
// ... MV
parseCommandLine [arg : args] options parseCommandLine [arg : args] options
| arg.[0] == '-' | arg.[0] == '-'
# (args,modules,options)= parseCommandLine args options # (args,modules,options)= parseCommandLine args options
...@@ -172,7 +188,7 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s ...@@ -172,7 +188,7 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s
| not opened | not opened
= abort ("couldn't open out file \"" +++ options.outPath +++ "\"\n") = abort ("couldn't open out file \"" +++ options.outPath +++ "\"\n")
# (tcl_file, files) # (tcl_file, files)
= openTclFile options.pathName files = openTclFile options options.pathName files
# (io, files) # (io, files)
= stdio files = stdio files
// (moduleIdent, hash_table) = putIdentInHashTable options.moduleName IC_Module hash_table // (moduleIdent, hash_table) = putIdentInHashTable options.moduleName IC_Module hash_table
...@@ -246,11 +262,10 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s ...@@ -246,11 +262,10 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s
= (success,cache,files) = (success,cache,files)
// MV ... // MV ...
openTclFile :: !String !*Files -> (Optional !.File, !*Files) openTclFile :: CoclOptions !String !*Files -> (Optional !.File, !*Files)
openTclFile icl_mod_pathname files openTclFile options=:{compile_for_dynamics=False} icl_mod_pathname files
| not generate_tcl_file = (No,files)
= (No,files); openTclFile options icl_mod_pathname files
# csf_path # csf_path
= directoryName icl_mod_pathname +++ "Clean System Files" = directoryName icl_mod_pathname +++ "Clean System Files"
# tcl_path # tcl_path
......
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