Skip to content
GitLab
Menu
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
65e7e453
Commit
65e7e453
authored
Nov 10, 2011
by
John van Groningen
Browse files
move type TypeCodeVariableInfo to module syntax, remove type DynamicValueAliasInfo,
adjust imports
parent
55884093
Changes
20
Hide whitespace changes
Inline
Side-by-side
backend/backendconvert.icl
View file @
65e7e453
/*
module owner: Ronny Wichers Schreur
*/
implementation
module
backendconvert
import
code
from
library
"backend_library"
...
...
@@ -9,7 +6,6 @@ import StdEnv, compare_types
import
frontend
import
backend
import
backendsupport
,
backendpreprocess
import
partition
// trace macro
(-*->)
infixl
...
...
frontend/analunitypes.icl
View file @
65e7e453
implementation
module
analunitypes
import
StdEnv
,
compare_types
import
syntax
,
checksupport
,
analtypes
,
typesupport
,
checktypes
,
utilities
import
syntax
,
checksupport
,
analtypes
,
checktypes
,
utilities
instance
+
SignClassification
where
...
...
frontend/check.icl
View file @
65e7e453
...
...
@@ -3,8 +3,7 @@ implementation module check
import
StdEnv
,
compare_types
import
syntax
,
expand_types
,
parse
,
checksupport
,
utilities
,
checktypes
,
transform
,
predef
import
explicitimports
,
comparedefimp
,
checkFunctionBodies
,
containers
import
genericsupport
import
explicitimports
,
comparedefimp
,
checkFunctionBodies
,
containers
,
typesupport
import
typereify
from
checkgenerics
import
checkGenericDefs
,
checkGenericCaseDefs
,
convert_generic_instances
,
create_gencase_funtypes
...
...
frontend/checkgenerics.icl
View file @
65e7e453
implementation
module
checkgenerics
import
syntax
,
checksupport
,
checktypes
,
genericsupport
,
compare_types
import
syntax
,
checksupport
,
checktypes
,
genericsupport
,
compare_types
,
typesupport
checkGenericDefs
::
!
Index
!(
Optional
(
CopiedDefinitions
,
Int
))
!*{#
GenericDef
}
!*{#
CheckedTypeDef
}
!*{#
ClassDef
}
!*{#
DclModule
}
!*
Heaps
!*
CheckState
...
...
frontend/checksupport.dcl
View file @
65e7e453
definition
module
checksupport
import
StdEnv
import
syntax
,
predef
,
containers
,
utilities
import
syntax
,
predef
,
containers
CS_NotChecked
:==
-1
NotFound
:==
-1
...
...
frontend/checktypes.dcl
View file @
65e7e453
definition
module
checktypes
import
checksupport
,
typesupport
import
checksupport
checkTypeDefs
::
!
Index
!(
Optional
(
CopiedDefinitions
,
Int
))
!*{#
CheckedTypeDef
}
!*{#
ConsDef
}
!*{#
SelectorDef
}
!*{#
DclModule
}
!*
Heaps
!*
CheckState
...
...
frontend/classify.icl
View file @
65e7e453
/*
module owner: Diederik van Arkel
*/
implementation
module
classify
SwitchMultimatchClassification
multi
no_multi
:==
multi
SwitchNewOld
new
old
:==
new
import
syntax
from
partition
import
::
Component
(..),::
ComponentMembers
(..)
from
checksupport
import
::
Component
(..),::
ComponentMembers
(..)
from
containers
import
arg_is_strict
import
utilities
import
StdStrictLists
...
...
frontend/convertDynamics.dcl
View file @
65e7e453
...
...
@@ -2,9 +2,6 @@ definition module convertDynamics
import
syntax
,
checksupport
::
TypeCodeVariableInfo
::
DynamicValueAliasInfo
convertDynamicPatternsIntoUnifyAppls
::
!{#
CommonDefs
}
!
Int
{#
DclModule
}
!
IclModule
[
String
]
!
Int
!
Int
!*{!
Component
}
!*{#
FunDef
}
!*
PredefinedSymbols
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!(
Optional
*
File
)
->
(!*{#{#
CheckedTypeDef
}},
...
...
frontend/convertDynamics.icl
View file @
65e7e453
/*
module owner: Ronny Wichers Schreur
*/
implementation
module
convertDynamics
import
syntax
from
type_io_common
import
PredefinedModuleName
// Optional
extended_unify_and_coerce
no
yes
:==
no
;
// change also _unify and _coerce in StdDynamic
import
type_io
;
::
TypeCodeVariableInfo
=
TCI_TypeVar
!
Expression
|
TCI_TypePatternVar
!
Expression
|
TCI_SelectionsTypePatternVar
![(
Expression
,[
Selection
])]
::
DynamicValueAliasInfo
:==
BoundVar
::
*
ConversionState
=
{
ci_predef_symb
::
!*
PredefinedSymbols
,
ci_var_heap
::
!*
VarHeap
...
...
frontend/expand_types.dcl
View file @
65e7e453
...
...
@@ -11,8 +11,8 @@ convertSymbolTypeWithoutExpandingAbstractSynTypes :: !Bool !{#CommonDefs} !Symbo
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
addTypesOfDictionaries
::
!{#
CommonDefs
}
![
TypeContext
]
![
AType
]
->
[
AType
]
...
...
@@ -29,14 +29,14 @@ DontCollectImportedConstructors:==4
,
ets_contains_unexpanded_abs_syn_type
::
!
Bool
}
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
instance
expandSynTypes
(
a
,
b
)
|
expandSynTypes
a
&
expandSynTypes
b
special
a
=[
AType
],
b
=
AType
class
substitute
a
::
!
a
!*
TypeHeaps
->
(!
a
,
!*
TypeHeaps
)
instance
substitute
Type
,
AType
,
TypeContext
,
AttrInequality
,
CaseType
instance
substitute
[
a
]
|
substitute
a
special
a
=
TypeContext
instance
substitute
[
a
]
|
substitute
a
special
a
=
AType
;
a
=
AttrInequality
;
a
=
TypeContext
instance
substitute
(
a
,
b
)
|
substitute
a
&
substitute
b
special
a
=[
AType
],
b
=
AType
class
removeAnnotations
a
::
!
a
->
(!
Bool
,
!
a
)
...
...
frontend/expand_types.icl
View file @
65e7e453
...
...
@@ -49,7 +49,7 @@ RemoveAnnotationsMask:==1
ExpandAbstractSynTypesMask
:==
2
DontCollectImportedConstructors
:==
4
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
convertSymbolType
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolType
rem_annots
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
#
(
st
,
ets_contains_unexpanded_abs_syn_type
,
ets_type_defs
,
ets_collected_conses
,
ets_type_heaps
,
ets_var_heap
)
...
...
@@ -57,19 +57,19 @@ convertSymbolType rem_annots common_defs st main_dcl_module_n imported_types col
=
(
st
,
ets_type_defs
,
ets_collected_conses
,
ets_type_heaps
,
ets_var_heap
)
convertSymbolTypeWithoutExpandingAbstractSynTypes
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,
!*
ImportedTypes
,!
ImportedConstructors
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutExpandingAbstractSynTypes
rem_annots
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
=
convertSymbolType_
(
if
rem_annots
(
RemoveAnnotationsMask
)
0
)
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
=
convertSymbolType_
(
if
rem_annots
RemoveAnnotationsMask
0
)
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
::
!
Bool
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,!*
ImportedTypes
,!*
TypeHeaps
,!*
VarHeap
)
convertSymbolTypeWithoutCollectingImportedConstructors
rem_annots
common_defs
st
main_dcl_module_n
imported_types
type_heaps
var_heap
#
(
st
,
ets_contains_unexpanded_abs_syn_type
,
ets_type_defs
,
ets_collected_conses
,
ets_type_heaps
,
ets_var_heap
)
=
convertSymbolType_
(
if
rem_annots
(
RemoveAnnotationsMask
bitor
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
)
(
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
))
common_defs
st
main_dcl_module_n
imported_types
[]
type_heaps
var_heap
=
convertSymbolType_
(
if
rem_annots
(
RemoveAnnotationsMask
bitor
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
)
(
ExpandAbstractSynTypesMask
bitor
DontCollectImportedConstructors
))
common_defs
st
main_dcl_module_n
imported_types
[]
type_heaps
var_heap
=
(
st
,
ets_type_defs
,
ets_type_heaps
,
ets_var_heap
)
convertSymbolType_
::
!
Int
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
convertSymbolType_
::
!
Int
!{#
CommonDefs
}
!
SymbolType
!
Int
!*
ImportedTypes
!
ImportedConstructors
!*
TypeHeaps
!*
VarHeap
->
(!
SymbolType
,
!
Bool
,!*
ImportedTypes
,
!
ImportedConstructors
,
!*
TypeHeaps
,
!*
VarHeap
)
convertSymbolType_
rem_annots
common_defs
st
main_dcl_module_n
imported_types
collected_imports
type_heaps
var_heap
#
ets
=
{
ets_type_defs
=
imported_types
...
...
@@ -133,7 +133,7 @@ where
,
ets_contains_unexpanded_abs_syn_type
::
!
Bool
}
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
class
expandSynTypes
a
::
!
Int
!{#
CommonDefs
}
!
a
!*
ExpandTypeState
->
(!
Bool
,!
a
,
!*
ExpandTypeState
)
instance
expandSynTypes
Type
where
...
...
frontend/overloading.icl
View file @
65e7e453
...
...
@@ -2,7 +2,7 @@ implementation module overloading
import
StdEnv
,
compare_types
import
syntax
,
type
,
expand_types
,
utilities
,
unitype
,
predef
,
checktypes
,
convertDynamics
import
syntax
,
type
,
expand_types
,
utilities
,
unitype
,
predef
,
checktypes
import
genericsupport
,
type_io_common
::
LocalTypePatternVariable
=
...
...
frontend/partition.icl
View file @
65e7e453
...
...
@@ -3,7 +3,7 @@
*/
implementation
module
partition
import
syntax
,
transform
import
syntax
,
transform
,
utilities
// PARTITIONING
...
...
frontend/predef.icl
View file @
65e7e453
implementation
module
predef
import
syntax
,
hashtable
,
type_io_common
import
syntax
,
hashtable
(<<=)
infixl
(<<=)
symbol_table
val
...
...
frontend/scanner.icl
View file @
65e7e453
implementation
module
scanner
import
StdEnv
,
compare_constructor
,
general
,
compilerSwitches
import
StdEnv
,
compare_constructor
,
general
from
utilities
import
revCharListToString
,
isSpecialChar
...
...
frontend/syntax.dcl
View file @
65e7e453
...
...
@@ -5,7 +5,6 @@ import StdEnv
import
scanner
,
general
,
typeproperties
,
Heap
import
IndexType
from
containers
import
::
NumberSet
from
convertDynamics
import
::
TypeCodeVariableInfo
,
::
DynamicValueAliasInfo
from
convertcases
import
::
LetVarInfo
,
::
LetExpressionInfo
,
::
RefCountsInCase
,
::
SplitsInCase
::
Ident
=
...
...
@@ -707,8 +706,6 @@ pIsSafe :== True
::
AP_Kind
=
APK_Constructor
!
Index
|
APK_NewTypeConstructor
!
Index
|
APK_Macro
!
Bool
// is_dcl_macro
from
convertDynamics
import
::
TypeCodeVariableInfo
,
::
DynamicValueAliasInfo
::
VI_TypeInfo
=
VITI_Empty
|
VITI_Coercion
CoercionPosition
|
VITI_PatternType
[
AType
]
/*module*/
!
Index
/*constructor*/
!
Index
VI_TypeInfo
...
...
@@ -740,7 +737,7 @@ from convertDynamics import :: TypeCodeVariableInfo, :: DynamicValueAliasInfo
VI_Record
![
AuxiliaryPattern
]
|
VI_Pattern
!
AuxiliaryPattern
|
VI_TypeCodeVariable
!
TypeCodeVariableInfo
|
VI_DynamicValueAlias
!
DynamicValueAliasInfo
|
VI_DynamicValueAlias
!
BoundVar
|
VI_Body
!
SymbIdent
!
TransformedBody
![
FreeVar
]
|
/* used during fusion */
VI_ExpressionOrBody
!
Expression
!
SymbIdent
!
TransformedBody
![
FreeVar
]
|
/* used during fusion */
VI_Dictionary
!
SymbIdent
![
Expression
]
!
Type
|
/* used during fusion */
...
...
@@ -751,6 +748,11 @@ from convertDynamics import :: TypeCodeVariableInfo, :: DynamicValueAliasInfo
|
VI_Labelled_Empty
!{#
Char
}
// RWS debugging
|
VI_LocalLetVar
// RWS, mark Let vars during case transformation
::
TypeCodeVariableInfo
=
TCI_TypeVar
!
Expression
|
TCI_TypePatternVar
!
Expression
|
TCI_SelectionsTypePatternVar
![(
Expression
,[
Selection
])]
::
ExtendedVarInfo
=
EVI_VarType
!
AType
::
ArgumentPosition
:==
Int
...
...
@@ -758,9 +760,6 @@ from convertDynamics import :: TypeCodeVariableInfo, :: DynamicValueAliasInfo
::
VarHeap
:==
Heap
VarInfo
::
VarInfoPtr
:==
Ptr
VarInfo
from
convertcases
import
::
LetVarInfo
,
::
LetExpressionInfo
,
::
RefCountsInCase
,
::
SplitsInCase
cNotVarNumber
:==
-1
::
BoundVar
=
...
...
frontend/syntax.icl
View file @
65e7e453
...
...
@@ -2,7 +2,9 @@ implementation module syntax
import
StdEnv
,
compare_constructor
import
scanner
,
general
,
Heap
,
typeproperties
,
utilities
import
syntax
import
IndexType
from
containers
import
::
NumberSet
from
convertcases
import
::
LetVarInfo
,
::
LetExpressionInfo
,
::
RefCountsInCase
,
::
SplitsInCase
instance
toString
Ident
where
toString
{
id_name
}
=
id_name
...
...
frontend/trans.icl
View file @
65e7e453
...
...
@@ -2,7 +2,7 @@ implementation module trans
import
StdEnv
import
syntax
,
transform
,
checksupport
,
compare_types
,
check
,
utilities
,
expand_types
,
unitype
,
type
support
,
type
import
syntax
,
transform
,
checksupport
,
compare_types
,
utilities
,
expand_types
,
unitype
,
type
import
classify
,
partition
SwitchCaseFusion
fuse
dont_fuse
:==
fuse
...
...
frontend/typesupport.dcl
View file @
65e7e453
definition
module
typesupport
import
checksupport
import
checksupport
,
utilities
from
unitype
import
::
Coercions
,
::
CoercionTree
,
::
AttributePartition
,
CT_Empty
...
...
main/coclmain.icl
View file @
65e7e453
/*
module owner: Ronny Wichers Schreur
*/
implementation
module
coclmain
import
StdEnv
...
...
@@ -9,7 +6,7 @@ import ArgEnv
import
set_return_code
import
CoclSystemDependent
import
compile
import
compile
,
utilities
coclMain
::
![{#
Char
}]
!*
World
->
*
World
coclMain
testArgs
world
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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