Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
f8d9a6cb
Commit
f8d9a6cb
authored
Sep 06, 2001
by
Artem Alimarine
Browse files
added command line flag to enable generics
parent
1dd23238
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
coclmaindll/cocl.prj
View file @
f8d9a6cb
This diff is collapsed.
Click to expand it.
frontend/compilerSwitches.dcl
View file @
f8d9a6cb
definition
module
compilerSwitches
SwitchGenerics
on
off
:==
on
PA_BUG
on
off
:==
off
switch_import_syntax
one_point_three
two_point_zero
:==
one_point_three
...
...
frontend/compilerSwitches.icl
View file @
f8d9a6cb
implementation
module
compilerSwitches
SwitchGenerics
on
off
:==
on
PA_BUG
on
off
:==
off
switch_import_syntax
one_point_three
two_point_zero
:==
one_point_three
...
...
frontend/frontend.dcl
View file @
f8d9a6cb
...
...
@@ -4,6 +4,11 @@ from scanner import SearchPaths
from
general
import
Optional
,
Yes
,
No
import
checksupport
,
transform
,
overloading
::
FrontEndOptions
=
{
feo_up_to_phase
::
!
FrontEndPhase
,
feo_generics
::
!
Bool
}
::
FrontEndSyntaxTree
=
{
fe_icl
::
!
IclModule
,
fe_dcls
::
!{#
DclModule
}
...
...
@@ -22,5 +27,5 @@ import checksupport, transform, overloading
|
FrontEndPhaseConvertModules
|
FrontEndPhaseAll
frontEndInterface
::
!
FrontEnd
Phase
!
Ident
!
SearchPaths
!{#
DclModule
}
!{#
FunDef
}
!(
Optional
Bool
)
!*
PredefinedSymbols
!*
HashTable
!*
Files
!*
File
!*
File
!*
File
(!
Optional
!*
File
)
!*
Heaps
frontEndInterface
::
!
FrontEnd
Options
!
Ident
!
SearchPaths
!{#
DclModule
}
!{#
FunDef
}
!(
Optional
Bool
)
!*
PredefinedSymbols
!*
HashTable
!*
Files
!*
File
!*
File
!*
File
(!
Optional
!*
File
)
!*
Heaps
->
(
!
Optional
*
FrontEndSyntaxTree
,!.{#
FunDef
},!
Int
,!
Int
,!*
PredefinedSymbols
,
!*
HashTable
,
!*
Files
,
!*
File
,
!*
File
,
!*
File
,
!
Optional
!*
File
,
!*
Heaps
)
frontend/frontend.icl
View file @
f8d9a6cb
...
...
@@ -3,6 +3,11 @@ implementation module frontend
import
scanner
,
parse
,
postparse
,
check
,
type
,
trans
,
convertcases
,
overloading
,
utilities
,
convertDynamics
,
convertimportedtypes
,
checkKindCorrectness
,
compilerSwitches
,
analtypes
,
generics
::
FrontEndOptions
=
{
feo_up_to_phase
::
!
FrontEndPhase
,
feo_generics
::
!
Bool
}
::
FrontEndSyntaxTree
=
{
fe_icl
::
!
IclModule
,
fe_dcls
::
!{#
DclModule
}
...
...
@@ -73,19 +78,19 @@ frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_module
//import StdDebug
//frontEndInterface :: !FrontEndPhase !Ident !SearchPaths !{#DclModule} !{#FunDef} !(Optional Bool) !*PredefinedSymbols !*HashTable !*Files !*File !*File !*File !*File !*Heaps -> ( !Optional *FrontEndSyntaxTree,!.{# FunDef },!Int,!Int,!*PredefinedSymbols, !*HashTable, !*Files, !*File !*File, !*File, !*File, !*Heaps)
frontEndInterface
::
!
FrontEnd
Phase
!
Ident
!
SearchPaths
!{#
DclModule
}
!{#
FunDef
}
!(
Optional
Bool
)
!*
PredefinedSymbols
!*
HashTable
!*
Files
!*
File
!*
File
!*
File
(!
Optional
!*
File
)
!*
Heaps
frontEndInterface
::
!
FrontEnd
Options
!
Ident
!
SearchPaths
!{#
DclModule
}
!{#
FunDef
}
!(
Optional
Bool
)
!*
PredefinedSymbols
!*
HashTable
!*
Files
!*
File
!*
File
!*
File
(!
Optional
!*
File
)
!*
Heaps
->
(
!
Optional
*
FrontEndSyntaxTree
,!.{#
FunDef
},!
Int
,!
Int
,!*
PredefinedSymbols
,
!*
HashTable
,
!*
Files
,
!*
File
,
!*
File
,
!*
File
,
!
Optional
!*
File
,
!*
Heaps
)
frontEndInterface
upToPhase
mod_ident
search_paths
dcl_modules
functions_and_macros
list_inferred_types
predef_symbols
hash_table
files
error
io
out
tcl_file
heaps
frontEndInterface
options
mod_ident
search_paths
dcl_modules
functions_and_macros
list_inferred_types
predef_symbols
hash_table
files
error
io
out
tcl_file
heaps
// # files = trace_n ("Compiling "+++mod_ident.id_name) files
#
(
ok
,
mod
,
hash_table
,
error
,
predef_symbols
,
files
)
=
wantModule
cWantIclFile
mod_ident
NoPos
(
hash_table
/* ---> ("Parsing:", mod_ident)*/
)
error
search_paths
predef_symbols
files
=
wantModule
cWantIclFile
mod_ident
NoPos
options
.
feo_generics
(
hash_table
/* ---> ("Parsing:", mod_ident)*/
)
error
search_paths
predef_symbols
files
|
not
ok
=
(
No
,{},
0
,
0
,
predef_symbols
,
hash_table
,
files
,
error
,
io
,
out
,
tcl_file
,
heaps
)
#
cached_module_idents
=
[
dcl_mod
.
dcl_name
\\
dcl_mod
<-:
dcl_modules
]
#
(
ok
,
mod
,
global_fun_range
,
mod_functions
,
optional_dcl_mod
,
modules
,
dcl_module_n_in_cache
,
n_functions_and_macros_in_dcl_modules
,
hash_table
,
error
,
predef_symbols
,
files
)
=
scanModule
(
mod
-*->
"Scanning"
)
cached_module_idents
(
size
functions_and_macros
)
hash_table
error
search_paths
predef_symbols
files
=
scanModule
(
mod
-*->
"Scanning"
)
cached_module_idents
(
size
functions_and_macros
)
options
.
feo_generics
hash_table
error
search_paths
predef_symbols
files
/* JVG: */
// # hash_table = {hash_table & hte_entries={}}
#
hash_table
=
remove_icl_symbols_from_hash_table
hash_table
...
...
@@ -120,7 +125,7 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
type_heaps = heaps.hp_type_heaps
fun_defs = icl_functions
|
upToP
hase == FrontEndPhaseCheck
|
options.feo_up_to_p
hase == FrontEndPhaseCheck
# array_instances = {ali_array_first_instance_indices=[],ali_list_first_instance_indices=[],ali_tail_strict_list_first_instance_indices=[],ali_instances_range={ir_from=0,ir_to=0}}
= frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_modules main_dcl_module_n predef_symbols hash_table files error io out tcl_file icl_mod dcl_mods fun_defs components array_instances optional_dcl_icl_conversions global_fun_range heaps
...
...
@@ -142,12 +147,20 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
#! (components, ti_common_defs, fun_defs, generic_range, td_infos, heaps, hash_table, predef_symbols, dcl_mods, optional_dcl_icl_conversions, error_admin) =
/*
SwitchGenerics
(convertGenerics
components main_dcl_module_n ti_common_defs fun_defs td_infos
heaps hash_table predef_symbols dcl_mods optional_dcl_icl_conversions error_admin)
(components, ti_common_defs, fun_defs, {ir_to=0,ir_from=0}, td_infos, heaps, hash_table, predef_symbols, dcl_mods, optional_dcl_icl_conversions, error_admin)
*/
case options.feo_generics of
True ->
convertGenerics
components main_dcl_module_n ti_common_defs fun_defs td_infos
heaps hash_table predef_symbols dcl_mods optional_dcl_icl_conversions error_admin
False ->
(components, ti_common_defs, fun_defs, {ir_to=0,ir_from=0}, td_infos, heaps, hash_table, predef_symbols, dcl_mods, optional_dcl_icl_conversions, error_admin)
# (icl_common, ti_common_defs) = replace copied_ti_common_defs main_dcl_module_n saved_main_dcl_common
with
...
...
@@ -178,7 +191,7 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
// (components, fun_defs, out) = showComponents components 0 True fun_defs out
// (fun_defs, error) = showFunctions array_instances fun_defs error
|
upToP
hase == FrontEndPhaseTypeCheck
|
options.feo_up_to_p
hase == FrontEndPhaseTypeCheck
= frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_modules main_dcl_module_n predef_symbols hash_table files error io out tcl_file icl_mod dcl_mods fun_defs components array_instances optional_dcl_icl_conversions global_fun_range heaps
# (components, fun_defs, predef_symbols, dcl_types, used_conses_in_dynamics, var_heap, type_heaps, expression_heap, tcl_file)
...
...
@@ -187,7 +200,7 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
// # (components, fun_defs, error) = showComponents3 components 0 False fun_defs error
// (components, fun_defs, error) = showComponents components 0 True fun_defs error
|
upToP
hase == FrontEndPhaseConvertDynamics
|
options.feo_up_to_p
hase == FrontEndPhaseConvertDynamics
# heaps = {hp_var_heap=var_heap, hp_type_heaps=type_heaps, hp_expression_heap=expression_heap}
= frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_modules main_dcl_module_n predef_symbols hash_table files error io out tcl_file icl_mod dcl_mods fun_defs components array_instances optional_dcl_icl_conversions global_fun_range heaps
...
...
@@ -206,7 +219,7 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
(components, fun_defs, dcl_types, used_conses, var_heap, type_heaps, expression_heap)
= transformGroups cleanup_info main_dcl_module_n stdStrictLists_module_n (components -*-> "Transform") fun_defs acc_args common_defs imported_funs dcl_types used_conses_in_dynamics type_def_infos var_heap type_heaps expression_heap
|
upToP
hase == FrontEndPhaseTransformGroups
|
options.feo_up_to_p
hase == FrontEndPhaseTransformGroups
# heaps = {hp_var_heap=var_heap, hp_type_heaps=type_heaps, hp_expression_heap=expression_heap}
= frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_modules main_dcl_module_n predef_symbols hash_table files error io out tcl_file icl_mod dcl_mods fun_defs components array_instances optional_dcl_icl_conversions global_fun_range heaps
...
...
@@ -215,7 +228,7 @@ frontEndInterface upToPhase mod_ident search_paths dcl_modules functions_and_mac
// (components, fun_defs, out) = showComponents components 0 False fun_defs out
|
upToP
hase == FrontEndPhaseConvertModules
|
options.feo_up_to_p
hase == FrontEndPhaseConvertModules
# heaps = {hp_var_heap=var_heap, hp_type_heaps=type_heaps, hp_expression_heap=expression_heap}
= frontSyntaxTree cached_functions_and_macros n_functions_and_macros_in_dcl_modules main_dcl_module_n predef_symbols hash_table files error io out tcl_file icl_mod dcl_mods fun_defs components array_instances optional_dcl_icl_conversions global_fun_range heaps
...
...
frontend/generics.icl
View file @
f8d9a6cb
...
...
@@ -2071,7 +2071,6 @@ where
#!
kinds
=
init
ks
#!
arity
=
length
kinds
#!
num_gen_vars
=
lengh
gvs
// build lifting argumnents
#!
(
args
,
th
)
=
mapSt
(
build_arg
agvs
st
postfix
)
(
zip2
kinds
[
1
..
arity
])
th
...
...
@@ -2113,7 +2112,6 @@ where
#
postfix
=
postfix
+++
"_"
+++
toString
arg_num
#!
gavs
=
[
av
\\
{
atv_attribute
=
TA_Var
av
}
<-
agvs
]
#
num_gen_vars
=
lengh
gvs
#!
th
=
clearSymbolType
st
th
#!
th
=
foldSt
subst_av_for_self
(
st
.
st_attr_vars
++
gavs
)
th
...
...
@@ -2377,17 +2375,6 @@ buildIsoRecord
#
(
iso_expr
,
gs_heaps
)
=
buildISO
to_expr
from_expr
gs_predefs
gs_heaps
#
fun_def
=
makeFunction
def_sym
group_index
[]
iso_expr
No
[]
[
from_fun
.
ds_index
,
to_fun
.
ds_index
]
NoPos
=
(
fun_def
,
{
gs
&
gs_heaps
=
gs_heaps
})
where
build_fun_expr
mod_index
fun_def
heaps
=:{
hp_expression_heap
}
#
(
expr_info_ptr
,
hp_expression_heap
)
=
newPtr
EI_Empty
hp_expression_heap
#
global_index
=
{
glob_module
=
mod_index
/*gs_maindcl_module_n???*/
,
glob_object
=
fun_def
.
fun_index
}
#
fun_symb
=
{
symb_name
=
fun_def
.
fun_symb
,
symb_kind
=
SK_Function
global_index
,
symb_arity
=
0
//fun_def.fun_arity
}
#
fun_expr
=
App
{
app_symb
=
fun_symb
,
app_args
=
[],
app_info_ptr
=
expr_info_ptr
}
=
(
fun_expr
,
{
heaps
&
hp_expression_heap
=
hp_expression_heap
})
// convert a type to ot's generic representation
buildIsoTo
::
!
DefinedSymbol
!
Int
!
Int
!
CheckedTypeDef
![
DefinedSymbol
]
!*
GenericState
...
...
frontend/parse.dcl
View file @
f8d9a6cb
...
...
@@ -10,5 +10,5 @@ import syntax, hashtable, scanner, predef
cWantIclFile
:==
True
cWantDclFile
:==
False
wantModule
::
!
Bool
!
Ident
!
Position
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
wantModule
::
!
Bool
!
Ident
!
Position
!
Bool
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
->
(!
Bool
,
!
ParsedModule
,
!*
HashTable
,
!*
File
,
!*
PredefinedSymbols
,
!*
Files
)
frontend/parse.icl
View file @
f8d9a6cb
...
...
@@ -48,6 +48,7 @@ Conventions:
,
ps_skipping
::
!
Bool
,
ps_hash_table
::
!*
HashTable
,
ps_pre_def_symbols
::
!*
PredefinedSymbols
,
ps_support_generics
::
!
Bool
// AA: compiler option "-generics"
}
/*
appScanState :: (ScanState -> ScanState) !ParseState -> ParseState
...
...
@@ -288,9 +289,9 @@ isClassOrInstanceDefsContext context :== context bitand cClassOrInstanceDefsCont
cWantIclFile
:==
True
cWantDclFile
:==
False
wantModule
::
!
Bool
!
Ident
!
Position
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
wantModule
::
!
Bool
!
Ident
!
Position
!
Bool
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
->
(!
Bool
,
!
ParsedModule
,
!*
HashTable
,
!*
File
,
!*
PredefinedSymbols
,
!*
Files
)
wantModule
iclmodule
file_id
=:{
id_name
}
import_file_position
hash_table
error
searchPaths
pre_def_symbols
files
wantModule
iclmodule
file_id
=:{
id_name
}
import_file_position
support_generics
hash_table
error
searchPaths
pre_def_symbols
files
=
case
openScanner
file_name
searchPaths
files
of
(
Yes
scanState
,
files
)
#
hash_table
=
set_hte_mark
(
if
iclmodule
1
0
)
hash_table
...
...
@@ -312,6 +313,7 @@ where
,
ps_skipping
=
False
,
ps_hash_table
=
hash_table
,
ps_pre_def_symbols
=
pre_def_symbols
,
ps_support_generics
=
support_generics
}
pState
=
verify_name
mod_name
id_name
file_name
pState
(
mod_ident
,
pState
)
=
stringToIdent
mod_name
IC_Module
pState
...
...
@@ -1336,7 +1338,7 @@ optionalCoercions pState
wantGenericDefinition
::
!
ParseContext
!
Position
!
ParseState
->
(!
ParsedDefinition
,
!
ParseState
)
wantGenericDefinition
context
pos
pState
|
SwitchGenerics
False
True
|
not
pState
.
ps_support_generics
=
(
PD_Erroneous
,
parseError
"generic definition"
No
"support for generics is disabled in the compiler. "
pState
)
#
(
name
,
pState
)
=
want_name
pState
|
name
==
""
...
...
@@ -3365,9 +3367,9 @@ wantBeginGroup msg pState
_
->
parseError
msg
(
Yes
token
)
"begin group without layout, {,"
pState
// AA..
wantKind
::
!
ParseState
->
!(!
TypeKind
,
ParseState
)
wantKind
::
!
ParseState
->
!(!
TypeKind
,
!
ParseState
)
wantKind
pState
|
SwitchGenerics
False
True
|
not
pState
.
ps_support_generics
=
(
KindConst
,
parseError
"kind"
No
"support for generics is disabled in the compiler. "
pState
)
#
(
token
,
pState
)
=
nextToken
TypeContext
pState
#
(
kind
,
pState
)
=
want_simple_kind
token
pState
...
...
frontend/postparse.dcl
View file @
f8d9a6cb
...
...
@@ -4,5 +4,5 @@ import StdEnv
import
syntax
,
parse
,
predef
scanModule
::
!
ParsedModule
![
Ident
]
!
Int
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
scanModule
::
!
ParsedModule
![
Ident
]
!
Int
!
Bool
!*
HashTable
!*
File
!
SearchPaths
!*
PredefinedSymbols
!*
Files
->
(!
Bool
,
!
ScannedModule
,
!
IndexRange
,
![
FunDef
],
!
Optional
ScannedModule
,
![
ScannedModule
],!
Int
,!
Int
,!*
HashTable
,
!*
File
,
!*
PredefinedSymbols
,
!*
Files
)
frontend/postparse.icl
View file @
f8d9a6cb
...
...
@@ -1002,25 +1002,25 @@ transformArrayDenot exprs pi
[{bind_dst=toParsedExpr i pi, bind_src=expr} \\ expr <- exprs & i <- [0..]]
pi
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths *Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths files ca
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths
Bool
*Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths
support_generics
files ca
= (True, parsed_modules, files, ca)
scanModules [{import_module,import_symbols,import_file_position} : mods] parsed_modules cached_modules searchPaths files ca
scanModules [{import_module,import_symbols,import_file_position} : mods] parsed_modules cached_modules searchPaths
support_generics
files ca
| in_cache import_module cached_modules
= scanModules mods parsed_modules cached_modules searchPaths files ca
= scanModules mods parsed_modules cached_modules searchPaths
support_generics
files ca
# (found_module,mod_type) = try_to_find import_module parsed_modules
| found_module
= case mod_type of
MK_NoMainDcl
# ca = postParseError import_file_position ("main module \'"+++import_module.id_name+++"\' does not have a definition module") ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths files ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths
support_generics
files ca
-> (False,parsed_modules,files,ca)
_
-> scanModules mods parsed_modules cached_modules searchPaths files ca
-> scanModules mods parsed_modules cached_modules searchPaths
support_generics
files ca
# (succ, parsed_modules, files, ca)
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths files ca
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths
support_generics
files ca
(mods_succ, parsed_modules, files, ca)
= scanModules mods parsed_modules cached_modules searchPaths files ca
= scanModules mods parsed_modules cached_modules searchPaths
support_generics
files ca
= (succ && mods_succ, parsed_modules, files, ca)
where
in_cache mod_id []
...
...
@@ -1043,15 +1043,15 @@ MakeEmptyModule name mod_type
{ def_types = [], def_constructors = [], def_selectors = [], def_classes = [], def_macros = { ir_from = 0, ir_to = 0 },
def_members = [], def_funtypes = [], def_instances = [], /*
AA */
def_generics = [] } }
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths !*Files !*CollectAdmin
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths
!Bool
!*Files !*CollectAdmin
-> *(!Bool, ![ScannedModule], !*Files, !*CollectAdmin)
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths files ca
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths
support_generics
files ca
# {ca_error, ca_fun_count, ca_rev_fun_defs, ca_predefs, ca_u_predefs, ca_hash_table}
= ca
hash_table = ca_hash_table
pea_file = ca_error.pea_file
predefs = ca_u_predefs
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile dcl_module import_file_position hash_table pea_file searchPaths predefs files
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile dcl_module import_file_position
support_generics
hash_table pea_file searchPaths predefs files
# ca = {ca_hash_table=hash_table, ca_error={pea_file=err_file,pea_ok=True}, ca_u_predefs=predefs, ca_fun_count=ca_fun_count, ca_rev_fun_defs=ca_rev_fun_defs, ca_predefs=ca_predefs}
| parse_ok
= scan_dcl_module mod parsed_modules searchPaths files ca
...
...
@@ -1070,12 +1070,12 @@ where
mod
= { mod & mod_imports = imports, mod_imported_objects = imported_objects, mod_defs = { defs & def_macros = range }}
(import_ok, parsed_modules, files, ca)
= scanModules imports [mod : parsed_modules] cached_modules searchPaths files ca
= scanModules imports [mod : parsed_modules] cached_modules searchPaths
support_generics
files ca
= (pea_ok && import_ok, parsed_modules, files, ca)
scanModule :: !ParsedModule ![Ident] !Int !*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
scanModule :: !ParsedModule ![Ident] !Int
!Bool
!*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
-> (!Bool, !ScannedModule, !IndexRange, ![FunDef], !Optional ScannedModule, ![ScannedModule],!Int,!Int,!*HashTable, !*File, !*PredefinedSymbols, !*Files)
scanModule mod=:{mod_name,mod_type,mod_defs = pdefs} cached_modules first_new_function_or_macro_index hash_table err_file searchPaths predefs files
scanModule mod=:{mod_name,mod_type,mod_defs = pdefs} cached_modules first_new_function_or_macro_index
support_generics
hash_table err_file searchPaths predefs files
# (predefIdents, predefs) = SelectPredefinedIdents predefs
# ca = { ca_error = {pea_file = err_file, pea_ok = True}
, ca_fun_count = first_new_function_or_macro_index
...
...
@@ -1090,7 +1090,7 @@ scanModule mod=:{mod_name,mod_type,mod_defs = pdefs} cached_modules first_new_fu
(import_dcl_ok, optional_parsed_dcl_mod,dcl_module_n,parsed_modules, cached_modules,files, ca)
= scan_main_dcl_module mod_name mod_type files ca
(import_dcls_ok, parsed_modules, files, ca)
= scanModules imports parsed_modules cached_modules searchPaths files ca
= scanModules imports parsed_modules cached_modules searchPaths
support_generics
files ca
(pea_dcl_ok,optional_dcl_mod,ca) = collect_main_dcl_module optional_parsed_dcl_mod dcl_module_n ca
...
...
@@ -1142,7 +1142,7 @@ where
hash_table = ca_hash_table
pea_file = ca_error.pea_file
predefs = ca_u_predefs
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile mod_name NoPos hash_table pea_file searchPaths predefs files
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile mod_name NoPos
support_generics
hash_table pea_file searchPaths predefs files
# ca = {ca_hash_table=hash_table, ca_error={pea_file=err_file,pea_ok=True}, ca_u_predefs=predefs, ca_fun_count=ca_fun_count, ca_rev_fun_defs=ca_rev_fun_defs, ca_predefs=ca_predefs}
| not parse_ok
= (False, No,NoIndex, [],cached_modules, files, ca)
...
...
@@ -1150,7 +1150,7 @@ where
# (_, defs, imports, imported_objects, ca) = reorganiseDefinitions False pdefs 0 0 0 0 ca
# mod = { mod & mod_imports = imports, mod_imported_objects = imported_objects, mod_defs = defs}
# cached_modules = [mod.mod_name:cached_modules]
# (import_ok, parsed_modules, files, ca) = scanModules imports [] cached_modules searchPaths files ca
# (import_ok, parsed_modules, files, ca) = scanModules imports [] cached_modules searchPaths
support_generics
files ca
= (import_ok, Yes mod, NoIndex,parsed_modules, cached_modules,files, ca)
collect_main_dcl_module (Yes mod=:{mod_defs=defs}) dcl_module_n ca
...
...
main/compile.icl
View file @
f8d9a6cb
...
...
@@ -19,6 +19,9 @@ import portToNewSyntax
// MV ...
,
compile_for_dynamics
::
!
Bool
// ... MV
// AA ..
,
support_generics
::
!
Bool
// .. AA
}
InitialCoclOptions
=
...
...
@@ -32,6 +35,9 @@ InitialCoclOptions =
// MV ...
,
compile_for_dynamics
=
False
// ... MV
// AA ..
,
support_generics
=
False
// .. AA
}
::
DclCache
=
{
...
...
@@ -85,6 +91,12 @@ parseCommandLine [arg1=:"-dynamics":args] options
#
(
args
,
modules
,
options
)=
parseCommandLine
args
{
options
&
compile_for_dynamics
=
True
}
=
(
args
,
modules
,
options
)
// ... MV
// AA ..
parseCommandLine
[
arg1
=:
"-generics"
:
args
]
options
=
parseCommandLine
args
{
options
&
support_generics
=
True
}
// .. AA
parseCommandLine
[
arg
:
args
]
options
|
arg
.[
0
]
==
'-'
#
(
args
,
modules
,
options
)=
parseCommandLine
args
options
...
...
@@ -183,7 +195,12 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s
#
({
boxed_ident
=
moduleIdent
},
hash_table
)
=
putIdentInHashTable
options
.
moduleName
IC_Module
hash_table
#
list_inferred_types
=
if
(
isMember
"-lt"
commandLineArgs
)
(
Yes
(
not
(
isMember
"-lattr"
commandLineArgs
)))
No
#
(
optionalSyntaxTree
,
cached_functions_and_macros
,
n_functions_and_macros_in_dcl_modules
,
main_dcl_module_n
,
predef_symbols
,
hash_table
,
files
,
error
,
io
,
out
,
tcl_file
,
heaps
)
=
frontEndInterface
FrontEndPhaseAll
moduleIdent
options
.
searchPaths
dcl_modules
functions_and_macros
list_inferred_types
predef_symbols
hash_table
files
error
io
out
tcl_file
heaps
=
frontEndInterface
front_end_options
moduleIdent
options
.
searchPaths
dcl_modules
functions_and_macros
list_inferred_types
predef_symbols
hash_table
files
error
io
out
tcl_file
heaps
with
front_end_options
=
{
feo_up_to_phase
=
FrontEndPhaseAll
,
feo_generics
=
options
.
support_generics
}
#
unique_copy_of_predef_symbols
={
predef_symbol
\\
predef_symbol
<-:
predef_symbols
}
#
(
closed
,
files
)
=
closeTclFile
tcl_file
files
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment