Commit 65e7e453 authored by John van Groningen's avatar John van Groningen
Browse files

move type TypeCodeVariableInfo to module syntax, remove type DynamicValueAliasInfo,

adjust imports
parent 55884093
/*
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
......
implementation module analunitypes
import StdEnv, compare_types
import syntax, checksupport, analtypes, typesupport, checktypes, utilities
import syntax, checksupport, analtypes, checktypes, utilities
instance + SignClassification
where
......
......@@ -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
......
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
......
definition module checksupport
import StdEnv
import syntax, predef, containers, utilities
import syntax, predef, containers
CS_NotChecked :== -1
NotFound :== -1
......
definition module checktypes
import checksupport, typesupport
import checksupport
checkTypeDefs :: !Index !(Optional (CopiedDefinitions, Int))
!*{#CheckedTypeDef} !*{#ConsDef} !*{#SelectorDef} !*{#DclModule} !*Heaps !*CheckState
......
/*
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
......
......@@ -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}},
......
/*
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
......
......@@ -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)
......
......@@ -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
......
......@@ -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 =
......
......@@ -3,7 +3,7 @@
*/
implementation module partition
import syntax, transform
import syntax, transform, utilities
// PARTITIONING
......
implementation module predef
import syntax, hashtable, type_io_common
import syntax, hashtable
(<<=) infixl
(<<=) symbol_table val
......
implementation module scanner
import StdEnv, compare_constructor, general, compilerSwitches
import StdEnv, compare_constructor, general
from utilities import revCharListToString, isSpecialChar
......
......@@ -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 =
......
......@@ -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
......
......@@ -2,7 +2,7 @@ implementation module trans
import StdEnv
import syntax, transform, checksupport, compare_types, check, utilities, expand_types, unitype, typesupport, type
import syntax, transform, checksupport, compare_types, utilities, expand_types, unitype, type
import classify, partition
SwitchCaseFusion fuse dont_fuse :== fuse
......
definition module typesupport
import checksupport
import checksupport,utilities
from unitype import ::Coercions, ::CoercionTree, ::AttributePartition, CT_Empty
......
/*
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
......
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