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
493b61ba
Commit
493b61ba
authored
Nov 18, 2005
by
John van Groningen
Browse files
check kinds of local functions,
move function indices in IclModule to separate record
parent
5aa199b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
backend/backendconvert.icl
View file @
493b61ba
...
...
@@ -383,8 +383,9 @@ backEndConvertModules p s main_dcl_module_n var_heap attr_var_heap be
backEndConvertModulesH
::
PredefinedSymbols
FrontEndSyntaxTree
!
Int
*
BackEndState
->
*
BackEndState
backEndConvertModulesH
predefs
{
fe_icl
=
fe_icl
=:
{
icl_name
,
icl_functions
,
icl_common
,
icl_global_functions
,
icl_type_funs
,
icl_imported_objects
,
icl_foreign_exports
,
icl_used_module_numbers
,
icl_modification_time
},
fe_icl
=:
{
icl_name
,
icl_functions
,
icl_common
,
icl_function_indices
=
{
ifi_type_function_indices
,
ifi_global_function_indices
},
icl_imported_objects
,
icl_foreign_exports
,
icl_used_module_numbers
,
icl_modification_time
},
fe_components
,
fe_dcls
,
fe_arrayInstances
}
main_dcl_module_n
backEnd
// sanity check ...
...
...
@@ -445,7 +446,7 @@ backEndConvertModulesH predefs {fe_icl =
=
appBackEnd
(
BEDeclareIclModule
icl_name
.
id_name
icl_modification_time
(
size
icl_functions
)
(
size
icl_common
.
com_type_defs
)
(
size
icl_common
.
com_cons_defs
)
(
size
icl_common
.
com_selector_defs
))
(
backEnd
-*->
"BEDeclareIclModule"
)
#!
backEnd
=
declareFunctionSymbols
icl_functions
functionIndices
(
i
cl
_type_funs
++
i
cl
_global_functions
)
(
backEnd
-*->
"declareFunctionSymbols"
)
(
i
fi
_type_fun
ction_indice
s
++
i
fi
_global_function
_indice
s
)
(
backEnd
-*->
"declareFunctionSymbols"
)
#!
backEnd
=
declare
main_dcl_module_n
icl_common
(
backEnd
-*->
"declare (main_dcl_module_n)"
)
#!
backEnd
...
...
@@ -482,7 +483,7 @@ backEndConvertModulesH predefs {fe_icl =
=
[]
// otherwise
=
flatten
[[
r
.
ir_from
..
r
.
ir_to
-1
]
\\
r
<-
[
i
cl
_type_funs
!!
1
]]
\\
r
<-
[
i
fi
_type_fun
ction_indice
s
!!
1
]]
#
backEnd
=
bindSpecialIdents
predefs
icl_used_module_numbers
backEnd
#!
backEnd
=
removeExpandedTypesFromDclModules
fe_dcls
icl_used_module_numbers
backEnd
=
(
backEnd
-*->
"backend done"
)
...
...
frontend/check.icl
View file @
493b61ba
...
...
@@ -2135,10 +2135,8 @@ renumber_icl_module mod_type icl_global_function_range icl_instance_range icl_ge
#!
dcl_specials
=
dcl_mod
.
dcl_specials
#
n_dcl_specials
=
dcl_specials
.
ir_to
-
dcl_specials
.
ir_from
//AA..
#
dcl_gencases
=
dcl_mod
.
dcl_gencases
#
n_dcl_gencases
=
dcl_gencases
.
ir_to
-
dcl_gencases
.
ir_from
//..AA
#
dcl_type_funs
=
dcl_mod
.
dcl_type_funs
#
n_dcl_type_funs
=
dcl_type_funs
.
ir_to
-
dcl_type_funs
.
ir_from
...
...
@@ -2316,7 +2314,7 @@ renumber_icl_module mod_type icl_global_function_range icl_instance_range icl_ge
=
fill_conversion_table_for_type_funs
(
inc
dcl_type_index
)
dcl_types
icl_type_defs
type_conversions
new_table
checkModule
::
!
Bool
!
ScannedModule
!
IndexRange
![
FunDef
]
!
Int
!
Int
!(
Optional
ScannedModule
)
![
ScannedModule
]
!{#
DclModule
}
!*{#*{#
FunDef
}}
!*
PredefinedSymbols
!*
SymbolTable
!*
File
!*
Heaps
->
(!
Bool
,
*
IclModule
,
*{#
DclModule
},
*{!
Group
},
!*{#*{#
FunDef
}},!
Int
,
!*
Heaps
,
!*
PredefinedSymbols
,
!*
SymbolTable
,
*
File
,
[
String
])
->
(!
Bool
,
*
IclModule
,
*{#
DclModule
},
*{!
Group
},
!*{#*{#
FunDef
}},!
Int
,
!*
Heaps
,
!*
PredefinedSymbols
,
!*
SymbolTable
,
*
File
,
[
String
])
checkModule
support_dynamics
{
mod_defs
,
mod_ident
,
mod_type
,
mod_imports
,
mod_imported_objects
,
mod_foreign_exports
,
mod_modification_time
}
icl_global_function_range
fun_defs
n_functions_and_macros_in_dcl_modules
dcl_module_n_in_cache
optional_dcl_mod
scanned_modules
dcl_modules
cached_dcl_macros
predef_symbols
symbol_table
err_file
heaps
...
...
@@ -2326,11 +2324,11 @@ checkModule support_dynamics {mod_defs,mod_ident,mod_type,mod_imports,mod_import
0
#
(
predef_mod
,
predef_symbols
)
=
buildPredefinedModule
predef_symbols
->
(
Yes
predef_mod
,
predef_symbols
)
_
->
(
No
,
predef_symbols
)
#
(
icl_global_function_range
,
nr_of_functions
,
first_inst_index
,
first_gen_inst_index
,
local_defs
,
icl_functions
,
macro_defs
,
init_dcl_modules
,
main_dcl_module_n
,
cdefs
,
sizes
,
cs
)
#
(
nr_of_functions
,
first_inst_index
,
first_gen_inst_index
,
local_defs
,
icl_functions
,
macro_defs
,
init_dcl_modules
,
main_dcl_module_n
,
cdefs
,
sizes
,
cs
)
=
check_module1
mod_defs
icl_global_function_range
fun_defs
optional_dcl_mod
optional_pre_def_mod
scanned_modules
dcl_modules
cached_dcl_macros
dcl_module_n_in_cache
predef_symbols
symbol_table
err_file
#
icl_instance_range
=
{
ir_from
=
first_inst_index
,
ir_to
=
first_gen_inst_index
/*AA nr_of_functions*/
}
#
icl_generic_range
=
{
ir_from
=
first_gen_inst_index
,
ir_to
=
nr_of_functions
}
//AA
=
check_module2
support_dynamics
mod_ident
mod_modification_time
mod_imported_objects
mod_imports
mod_foreign_exports
mod_type
icl_global_function_range
icl_instance_range
icl_generic_range
nr_of_functions
nr_of_cached_modules
optional_pre_def_mod
local_defs
icl_functions
macro_defs
init_dcl_modules
cdefs
sizes
heaps
cs
#
icl_instance_range
=
{
ir_from
=
first_inst_index
,
ir_to
=
first_gen_inst_index
}
#
icl_generic_range
=
{
ir_from
=
first_gen_inst_index
,
ir_to
=
nr_of_functions
}
=
check_module2
mod_ident
mod_modification_time
mod_imported_objects
mod_imports
mod_foreign_exports
mod_type
icl_global_function_range
icl_instance_range
icl_generic_range
nr_of_cached_modules
optional_pre_def_mod
local_defs
support_dynamics
icl_functions
macro_defs
init_dcl_modules
cdefs
sizes
heaps
cs
check_module1
cdefs
icl_global_function_range
fun_defs
optional_dcl_mod
optional_pre_def_mod
scanned_modules
dcl_modules
cached_dcl_macros
dcl_module_n_in_cache
predef_symbols
symbol_table
err_file
#
error
=
{
ea_file
=
err_file
,
ea_loc
=
[],
ea_ok
=
True
}
...
...
@@ -2338,18 +2336,12 @@ check_module1 cdefs icl_global_function_range fun_defs optional_dcl_mod optional
first_inst_index
=
length
fun_defs
(
inst_fun_defs
,
def_instances
)
=
convert_class_instances
cdefs
.
def_instances
first_inst_index
// AA..
first_gen_inst_index
=
first_inst_index
+
length
inst_fun_defs
(
gen_inst_fun_defs
,
def_generic_cases
)
=
convert_generic_instances
cdefs
.
def_generic_cases
first_gen_inst_index
// ..AA
icl_functions
=
{
next_fun
\\
next_fun
<-
fun_defs
++
inst_fun_defs
++
gen_inst_fun_defs
}
cdefs
=
{
cdefs
&
def_instances
=
def_instances
,
def_generic_cases
=
def_generic_cases
}
cdefs
=
{
cdefs
&
def_instances
=
def_instances
,
def_generic_cases
=
def_generic_cases
}
#!
nr_of_functions
=
size
icl_functions
#
sizes_and_local_defs
=
collectCommonfinitions
cdefs
...
...
@@ -2372,7 +2364,7 @@ check_module1 cdefs icl_global_function_range fun_defs optional_dcl_mod optional
dcl_modules
.[
i
]
init_new_dcl_modules
.[
i
-
size
dcl_modules
]
\\
i
<-[
0
..
size
dcl_modules
+
size
init_new_dcl_modules
-1
]}
=
(
icl_global_function_range
,
nr_of_functions
,
first_inst_index
,
first_gen_inst_index
,
local_defs
,
icl_functions
,
macro_defs
,
init_dcl_modules
,
main_dcl_module_n
,
cdefs
,
sizes
,
cs
)
=
(
nr_of_functions
,
first_inst_index
,
first_gen_inst_index
,
local_defs
,
icl_functions
,
macro_defs
,
init_dcl_modules
,
main_dcl_module_n
,
cdefs
,
sizes
,
cs
)
where
add_dcl_module_predef_module_and_modules_to_symbol_table
(
Yes
dcl_mod
)
optional_predef_mod
modules
mod_index
cs
...
...
@@ -2502,11 +2494,11 @@ check_module1 cdefs icl_global_function_range fun_defs optional_dcl_mod optional
fill_macro_def_array
i
[
dcl_macro_defs
:
macro_defs
]
a
=
fill_macro_def_array
(
i
+1
)
macro_defs
{
a
&
[
i
]=
dcl_macro_defs
}
check_module2
::
Bool
Ident
{#
Char
}
[.
ImportedObject
]
.[
Import
ImportDeclaration
]
[
ParsedForeignExport
]
.
ModuleKind
!.
IndexRange
!.
IndexRange
!.
IndexRange
!
Int
!
Int
(
Optional
(
Module
a
))
[
Declaration
]
*{#
FunDef
}
*{#*{#
FunDef
}}
*{#
DclModule
}
(
CollectedDefinitions
ClassInstance
IndexRange
)
check_module2
::
Ident
{#
Char
}
[.
ImportedObject
]
.[
Import
ImportDeclaration
]
[
ParsedForeignExport
]
.
ModuleKind
!.
IndexRange
!.
IndexRange
!.
IndexRange
!
Int
(
Optional
(
Module
a
))
[
Declaration
]
Bool
*{#
FunDef
}
*{#*{#
FunDef
}}
*{#
DclModule
}
(
CollectedDefinitions
ClassInstance
IndexRange
)
*{#.
Int
}
*
Heaps
*
CheckState
->
(!
Bool
,.
IclModule
,!.{#
DclModule
},.{!
Group
},!*{#*{#
FunDef
}},!
Int
,!.
Heaps
,!.{#
PredefinedSymbol
},!.
Heap
SymbolTableEntry
,!.
File
,[
String
]);
check_module2
support_dynamics
mod_ident
mod_modification_time
mod_imported_objects
mod_imports
mod_foreign_exports
mod_type
icl_global_function_range
icl_instance_range
icl_generic_range
nr_of_functions
nr_of_cached_modules
optional_pre_def_mod
local_defs
icl_functions
macro_defs
init_dcl_modules
cdefs
sizes
heaps
cs
check_module2
mod_ident
mod_modification_time
mod_imported_objects
mod_imports
mod_foreign_exports
mod_type
icl_global_function_range
icl_instance_range
icl_generic_range
nr_of_cached_modules
optional_pre_def_mod
local_defs
support_dynamics
icl_functions
macro_defs
init_dcl_modules
cdefs
sizes
heaps
cs
#
(
main_dcl_module_n
,
cs
)=
cs
!
cs_x
.
x_main_dcl_module_n
(
copied_dcl_defs
,
dcl_conversions
,
dcl_modules
,
local_defs
,
cdefs
,
icl_sizes
,
cs
)
...
...
@@ -2526,12 +2518,9 @@ check_module2 support_dynamics mod_ident mod_modification_time mod_imported_obje
=
(
False
,
abort
"evaluated error 2 (check.icl)"
,
{},
{},
{},
cs
.
cs_x
.
x_main_dcl_module_n
,
heaps
,
cs
.
cs_predef_symbols
,
cs
.
cs_symbol_table
,
cs
.
cs_error
.
ea_file
,
[])
#
cs_symbol_table
=
cs
.
cs_symbol_table
#
cs_predef_symbols
=
cs
.
cs_predef_symbols
#
hp_var_heap
=
heaps
.
hp_var_heap
#
cs_symbol_table
=
cs
.
cs_symbol_table
#
cs_predef_symbols
=
cs
.
cs_predef_symbols
#
hp_var_heap
=
heaps
.
hp_var_heap
#
(
icl_type_fun_range
,
dcl_modules
,
icl_functions
,
icl_common
,
cs_predef_symbols
,
hp_var_heap
,
cs_symbol_table
)
=
if
support_dynamics
...
...
@@ -2540,13 +2529,11 @@ check_module2 support_dynamics mod_ident mod_modification_time mod_imported_obje
cs_predef_symbols
hp_var_heap
cs_symbol_table
)
({
ir_from
=
0
,
ir_to
=
0
},
dcl_modules
,
icl_functions
,
icl_common
,
cs_predef_symbols
,
hp_var_heap
,
cs_symbol_table
)
#
(
nr_of_functions
,
icl_functions
)
=
usize
icl_functions
#
cs
=
{
cs
&
cs_symbol_table
=
cs_symbol_table
,
cs_predef_symbols
=
cs_predef_symbols
}
#
heaps
=
{
heaps
&
hp_var_heap
=
hp_var_heap
}
#
cs
=
{
cs
&
cs_symbol_table
=
cs_symbol_table
,
cs_predef_symbols
=
cs_predef_symbols
}
#
heaps
=
{
heaps
&
hp_var_heap
=
hp_var_heap
}
#
(
nr_of_functions
,
icl_functions
)
=
usize
icl_functions
#
def_macro_indices
=
cdefs
.
def_macro_indices
#
(
icl_global_functions_ranges
,
icl_instances_ranges
,
icl_generic_ranges
,
icl_type_fun_ranges
,
n_exported_global_functions
,
local_functions_index_offset
,
def_macro_indices
,
icl_functions
,
icl_common
,
local_defs
,
dcl_modules
,
error
)
...
...
@@ -2654,12 +2641,18 @@ check_module2 support_dynamics mod_ident mod_modification_time mod_imported_obje
icl_common
=
{
icl_common
&
com_type_defs
=
e_info
.
ef_type_defs
,
com_selector_defs
=
e_info
.
ef_selector_defs
,
com_class_defs
=
e_info
.
ef_class_defs
,
com_cons_defs
=
e_info
.
ef_cons_defs
,
com_member_defs
=
e_info
.
ef_member_defs
,
com_generic_defs
=
e_info
.
ef_generic_defs
,
com_instance_defs
=
class_instances
}
icl_mod
=
{
icl_name
=
mod_ident
,
icl_functions
=
icl_functions
,
icl_common
=
icl_common
,
icl_global_functions
=
icl_global_functions_ranges
,
icl_instances
=
icl_instances_ranges
,
icl_specials
=
icl_specials
,
icl_gencases
=
icl_generic_ranges
,
icl_import
=
icl_imported
,
icl_imported_objects
=
mod_imported_objects
,
icl_foreign_exports
=
foreign_exports
,
icl_used_module_numbers
=
imported_module_numbers
,
icl_copied_from_dcl
=
copied_dcl_defs
,
icl_modification_time
=
mod_modification_time
,
icl_type_funs
=
icl_type_fun_ranges
}
local_function_indices
=
{
ir_from
=
icl_global_function_range
.
ir_to
+
local_functions_index_offset
,
ir_to
=
def_macro_indices
.
ir_from
}
icl_function_indices
=
{
ifi_global_function_indices
=
icl_global_functions_ranges
,
ifi_local_function_indices
=
local_function_indices
,
ifi_instance_indices
=
icl_instances_ranges
,
ifi_specials_indices
=
icl_specials
,
ifi_gencase_indices
=
icl_generic_ranges
,
ifi_type_function_indices
=
icl_type_fun_ranges
}
icl_mod
=
{
icl_name
=
mod_ident
,
icl_functions
=
icl_functions
,
icl_function_indices
=
icl_function_indices
,
icl_common
=
icl_common
,
icl_import
=
icl_imported
,
icl_imported_objects
=
mod_imported_objects
,
icl_foreign_exports
=
foreign_exports
,
icl_used_module_numbers
=
imported_module_numbers
,
icl_copied_from_dcl
=
copied_dcl_defs
,
icl_modification_time
=
mod_modification_time
}
heaps
=
{
heaps
&
hp_var_heap
=
var_heap
,
hp_expression_heap
=
expr_heap
,
hp_type_heaps
=
{
hp_type_heaps
&
th_vars
=
th_vars
}}
(
main_dcl_module
,
dcl_modules
)
=
dcl_modules
![
main_dcl_module_n
]
...
...
@@ -2677,14 +2670,19 @@ check_module2 support_dynamics mod_ident mod_modification_time mod_imported_obje
#
icl_mod
=
{
icl_mod
&
icl_functions
=
icl_functions
}
=
(
cs_error
.
ea_ok
,
icl_mod
,
dcl_modules
,
groups
,
macro_defs
,
cs_x
.
x_main_dcl_module_n
,
heaps
,
cs_predef_symbols
,
cs_symbol_table
,
cs_error
.
ea_file
,
directly_imported_dcl_modules
)
#
icl_common
=
{
icl_common
&
com_type_defs
=
e_info
.
ef_type_defs
,
com_selector_defs
=
e_info
.
ef_selector_defs
,
com_class_defs
=
e_info
.
ef_class_defs
,
com_cons_defs
=
e_info
.
ef_cons_defs
,
com_member_defs
=
e_info
.
ef_member_defs
,
com_generic_defs
=
e_info
.
ef_generic_defs
}
icl_mod
=
{
icl_name
=
mod_ident
,
icl_functions
=
icl_functions
,
icl_common
=
icl_common
,
icl_global_functions
=
icl_global_functions_ranges
,
icl_instances
=
icl_instances_ranges
,
icl_specials
=
{
ir_from
=
nr_of_functions
,
ir_to
=
nr_of_functions
},
icl_gencases
=
icl_generic_ranges
,
icl_import
=
icl_imported
,
icl_imported_objects
=
mod_imported_objects
,
icl_foreign_exports
=
foreign_exports
,
icl_used_module_numbers
=
imported_module_numbers
,
icl_copied_from_dcl
=
copied_dcl_defs
,
icl_modification_time
=
mod_modification_time
,
icl_type_funs
=
icl_type_fun_ranges
}
#
icl_common
=
{
icl_common
&
com_type_defs
=
e_info
.
ef_type_defs
,
com_selector_defs
=
e_info
.
ef_selector_defs
,
com_class_defs
=
e_info
.
ef_class_defs
,
com_cons_defs
=
e_info
.
ef_cons_defs
,
com_member_defs
=
e_info
.
ef_member_defs
,
com_generic_defs
=
e_info
.
ef_generic_defs
}
icl_function_indices
=
{
ifi_global_function_indices
=
icl_global_functions_ranges
,
ifi_local_function_indices
=
{
ir_from
=
0
,
ir_to
=
0
},
ifi_instance_indices
=
icl_instances_ranges
,
ifi_specials_indices
=
{
ir_from
=
nr_of_functions
,
ir_to
=
nr_of_functions
},
ifi_gencase_indices
=
icl_generic_ranges
,
ifi_type_function_indices
=
icl_type_fun_ranges
}
icl_mod
=
{
icl_name
=
mod_ident
,
icl_functions
=
icl_functions
,
icl_function_indices
=
icl_function_indices
,
icl_common
=
icl_common
,
icl_import
=
icl_imported
,
icl_imported_objects
=
mod_imported_objects
,
icl_foreign_exports
=
foreign_exports
,
icl_used_module_numbers
=
imported_module_numbers
,
icl_copied_from_dcl
=
copied_dcl_defs
,
icl_modification_time
=
mod_modification_time
}
=
(
False
,
icl_mod
,
dcl_modules
,
{},
{},
cs_x
.
x_main_dcl_module_n
,
heaps
,
cs_predef_symbols
,
cs_symbol_table
,
cs_error
.
ea_file
,
directly_imported_dcl_modules
)
where
check_start_rule
mod_kind
mod_ident
icl_global_functions_ranges
cs
=:{
cs_symbol_table
,
cs_x
}
...
...
frontend/checksupport.dcl
View file @
493b61ba
...
...
@@ -13,7 +13,7 @@ cRankTwoScope :== 2
cNeedStdArray
:==
1
cNeedStdEnum
:==
2
cNeedStdDynamic
:==
4
cNeedStdGeneric
:==
8
// AA
cNeedStdGeneric
:==
8
cNeedStdStrictLists
:==
16
::
VarHeap
:==
Heap
VarInfo
...
...
@@ -57,8 +57,8 @@ cConversionTableSize :== 10
,
com_class_defs
::
!.{#
ClassDef
}
,
com_member_defs
::
!.{#
MemberDef
}
,
com_instance_defs
::
!.{#
ClassInstance
}
,
com_generic_defs
::
!.{#
GenericDef
}
// AA
,
com_gencase_defs
::
!.{#
GenericCaseDef
}
// AA
,
com_generic_defs
::
!.{#
GenericDef
}
,
com_gencase_defs
::
!.{#
GenericCaseDef
}
}
::
Declarations
=
{
...
...
@@ -89,14 +89,19 @@ cConversionTableSize :== 10
::
FunDefIndex
:==
Int
::
IclFunctionIndices
=
{
ifi_global_function_indices
::
![
IndexRange
]
,
ifi_local_function_indices
::
!
IndexRange
,
ifi_instance_indices
::
![
IndexRange
]
,
ifi_specials_indices
::
!
IndexRange
,
ifi_gencase_indices
::
![
IndexRange
]
,
ifi_type_function_indices
::
![
IndexRange
]
}
::
IclModule
=
{
icl_name
::
!
Ident
,
icl_functions
::
!.{#
FunDef
}
,
icl_global_functions
::
![
IndexRange
]
,
icl_instances
::
![
IndexRange
]
,
icl_specials
::
!
IndexRange
,
icl_gencases
::
![
IndexRange
]
,
icl_type_funs
::
![
IndexRange
]
,
icl_function_indices
::
!
IclFunctionIndices
,
icl_common
::
!.
CommonDefs
,
icl_import
::
!{!
Declaration
}
,
icl_imported_objects
::
![
ImportedObject
]
...
...
frontend/frontend.icl
View file @
493b61ba
...
...
@@ -50,6 +50,8 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
=
(
No
,{},{},
0
,
0
,
predef_symbols
,
hash_table
,
files
,
error
,
io
,
out
,
tcl_file
,
heaps
)
#
symbol_table
=
hash_table
.
hte_symbol_heap
#!
n_cached_dcl_modules
=
size
cached_dcl_modules
#
(
ok
,
icl_mod
,
dcl_mods
,
components
,
cached_dcl_macros
,
main_dcl_module_n
,
heaps
,
predef_symbols
,
symbol_table
,
error
,
directly_imported_dcl_modules
)
=
checkModule
support_dynamics
mod
global_fun_range
mod_functions
n_functions_and_macros_in_dcl_modules
dcl_module_n_in_cache
optional_dcl_mod
modules
cached_dcl_modules
functions_and_macros
predef_symbols
(
symbol_table
-*->
"Checking"
)
error
heaps
...
...
@@ -63,8 +65,8 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
select_and_remove_icl_functions_from_record
::
!*
IclModule
->
(!.{#
FunDef
},!.
IclModule
)
select_and_remove_icl_functions_from_record
icl_mod
=:{
icl_functions
}
=
(
icl_functions
,{
icl_mod
&
icl_functions
={}})
#
{
icl_
globa
l_function
s
,
icl_instances
,
icl_gencases
,
icl_specials
,
icl_common
,
icl_name
,
icl_import
,
icl_imported_objects
,
icl_type_funs
,
icl_foreign_exports
,
icl_used_module_numbers
,
icl_copied_from_dcl
}
=
icl_mod
#
{
icl_
common
,
ic
l_function
_indices
,
icl_name
,
icl_import
,
icl_imported_objects
,
icl_foreign_exports
,
icl_used_module_numbers
,
icl_copied_from_dcl
}
=
icl_mod
/*
(_,f,files) = fopen "components" FWriteText files
(components, icl_functions, f) = showComponents components 0 True icl_functions f
...
...
@@ -114,8 +116,12 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
#
(
td_infos
,
th_vars
,
error_admin
)
=
analyseTypeDefs
ti_common_defs
type_groups
com_type_defs
main_dcl_module_n
td_infos
type_heaps
.
th_vars
error_admin
#
(
class_infos
,
td_infos
,
th_vars
,
error_admin
)
=
determineKindsOfClasses
icl_used_module_numbers
ti_common_defs
td_infos
th_vars
error_admin
#
icl_global_functions
=
icl_function_indices
.
ifi_global_function_indices
#
(
fun_defs
,
dcl_mods
,
td_infos
,
th_vars
,
hp_expression_heap
,
gen_heap
,
error_admin
)
=
checkKindsOfCommonDefsAndFunctions
n_cached_dcl_modules
main_dcl_module_n
icl_used_module_numbers
icl_global_functions
=
checkKindsOfCommonDefsAndFunctions
n_cached_dcl_modules
main_dcl_module_n
icl_used_module_numbers
(
icl_global_functions
++[
icl_function_indices
.
ifi_local_function_indices
])
ti_common_defs
fun_defs
dcl_mods
td_infos
class_infos
th_vars
heaps
.
hp_expression_heap
heaps
.
hp_generic_heap
error_admin
type_heaps
=
{
type_heaps
&
th_vars
=
th_vars
}
...
...
@@ -161,15 +167,19 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
=
(
No
,{},{},
0
,
main_dcl_module_n
,
predef_symbols
,
hash_table
,
files
,
error
,
io
,
out
,
tcl_file
,
heaps
)
#
(
ok
,
fun_defs
,
array_instances
,
common_defs
,
imported_funs
,
type_def_infos
,
heaps
,
predef_symbols
,
error
,
out
)
=
typeProgram
(
components
-*->
"Typing"
)
main_dcl_module_n
fun_defs
/*
icl_function
s*/
icl_special
s
list_inferred_types
icl_common
[
a
\\
a
<-:
icl_import
]
dcl_mods
icl_used_module_numbers
td_infos
heaps
predef_symbols
error
out
dcl_mods
=
typeProgram
(
components
-*->
"Typing"
)
main_dcl_module_n
fun_defs
icl_function
_indices
.
ifi_specials_indice
s
list_inferred_types
icl_common
[
a
\\
a
<-:
icl_import
]
dcl_mods
icl_used_module_numbers
td_infos
heaps
predef_symbols
error
out
dcl_mods
|
not
ok
=
(
No
,{},{},
0
,
main_dcl_module_n
,
predef_symbols
,
hash_table
,
files
,
error
,
io
,
out
,
tcl_file
,
heaps
)
#
icl_gencase_indices
=
icl_function_indices
.
ifi_gencase_indices
++
generic_ranges
#
icl_function_indices
=
{
icl_function_indices
&
ifi_gencase_indices
=
icl_gencase_indices
}
#
(
fun_def_size
,
fun_defs
)
=
usize
fun_defs
#
(
components
,
fun_defs
)
=
partitionateFunctions
(
fun_defs
-*->
"partitionateFunctions"
)
(
icl_global_functions
++
icl_instances
++
[
icl_specials
]
++
icl_gencases
++
generic_ranges
++
icl_type_funs
)
#
(
components
,
fun_defs
)
=
partitionateFunctions
(
fun_defs
-*->
"partitionateFunctions"
)
(
icl_global_functions
++
icl_function_indices
.
ifi_instance_indices
++[
icl_function_indices
.
ifi_specials_indices
:
icl_gencase_indices
++
icl_function_indices
.
ifi_type_function_indices
])
|
options
.
feo_up_to_phase
==
FrontEndPhaseTypeCheck
=
frontSyntaxTree
cached_dcl_macros
cached_dcl_mods
n_functions_and_macros_in_dcl_modules
main_dcl_module_n
...
...
@@ -277,15 +287,10 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
// # (fun_defs,out,var_heap,predef_symbols) = sa components main_dcl_module_n dcl_mods fun_defs out var_heap predef_symbols;
#
heaps
=
{
hp_var_heap
=
var_heap
,
hp_expression_heap
=
expression_heap
,
hp_type_heaps
=
type_heaps
,
hp_generic_heap
=
heaps
.
hp_generic_heap
}
#
fe
={
fe_icl
=
// {icl_mod & icl_functions=fun_defs }
{
icl_functions
=
fun_defs
,
icl_global_functions
=
icl_global_functions
,
icl_instances
=
icl_instances
,
icl_specials
=
icl_specials
,
icl_common
=
icl_common
,
icl_gencases
=
icl_gencases
++
generic_ranges
,
icl_import
=
icl_import
,
icl_imported_objects
=
icl_imported_objects
,
icl_foreign_exports
=
icl_foreign_exports
,
icl_name
=
icl_name
,
icl_used_module_numbers
=
icl_used_module_numbers
,
icl_copied_from_dcl
=
icl_copied_from_dcl
,
icl_modification_time
=
icl_mod
.
icl_modification_time
,
icl_type_funs
=
icl_type_funs
}
#
fe
={
fe_icl
=
{
icl_functions
=
fun_defs
,
icl_function_indices
=
icl_function_indices
,
icl_common
=
icl_common
,
icl_import
=
icl_import
,
icl_imported_objects
=
icl_imported_objects
,
icl_foreign_exports
=
icl_foreign_exports
,
icl_name
=
icl_name
,
icl_used_module_numbers
=
icl_used_module_numbers
,
icl_copied_from_dcl
=
icl_copied_from_dcl
,
icl_modification_time
=
icl_mod
.
icl_modification_time
}
,
fe_dcls
=
dcl_mods
,
fe_components
=
components
,
fe_arrayInstances
=
array_instances
...
...
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