Commit ba608ce6 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl
Browse files

make type ExprInfo extensible, move constructors VI_LetVar, VI_LetExpression,...

make type ExprInfo extensible, move constructors VI_LetVar, VI_LetExpression, EI_CaseTypeAndRefCounts and EI_CaseTypeAndSplits from module syntax to module convertcases, make types LetVarInfo, LetExpressionInfo, RefCountsInCase and SplitsInCase local, remove imports of these types
parent ea357ac2
/*
module owner: Ronny Wichers Schreur
*/
definition module convertcases
import syntax
from checksupport import ::Component
:: LetVarInfo
:: LetExpressionInfo
:: RefCountsInCase
:: SplitsInCase
convertCasesOfFunctions :: !*{!Component} !Int !{# {# FunType} } !{# CommonDefs} !*{#FunDef} !*{#{# CheckedTypeDef}}
!ImportedConstructors !*VarHeap !*TypeHeaps !*ExpressionHeap
-> (!ImportedFunctions, !*{!Component}, !*{#FunDef}, !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap)
......@@ -4,6 +4,14 @@ import StdStrictLists
import syntax, compare_types, utilities, expand_types, general
from checksupport import ::Component(..),::ComponentMembers(..)
:: VarInfo
| VI_LetVar !LetVarInfo
| VI_LetExpression !LetExpressionInfo
:: ExprInfo
| EI_CaseTypeAndRefCounts !CaseType !RefCountsInCase
| EI_CaseTypeAndSplits !CaseType !SplitsInCase
// exactZip fails when its arguments are of unequal length
exactZip :: ![.a] ![.b] -> [(.a,.b)]
exactZip [x:xs][y:ys]
......
......@@ -5,7 +5,6 @@ import StdEnv
import scanner, general, typeproperties, Heap
import IndexType
from containers import ::NumberSet
from convertcases import :: LetVarInfo, :: LetExpressionInfo, :: RefCountsInCase, :: SplitsInCase
:: Ident =
{ id_name :: !String
......@@ -810,7 +809,7 @@ pIsSafe :== True
VI_ClassVar !Ident !VarInfoPtr !Int | /* to hold dictionary variables during overloading */
VI_EmptyConstructorClassVar |
VI_ForwardClassVar !VarInfoPtr | /* to hold the dictionary variable generated during overloading */
VI_Forward !BoundVar | VI_LetVar !LetVarInfo | VI_LetExpression !LetExpressionInfo |
VI_Forward !BoundVar |
VI_CaseOrStrictLetVar !VarInfoPtr | VI_StrictLetVar |
VI_CorrespondenceNumber !Int | /* it is assumed that this alternative is _only_ used in module comparedefimp */
VI_SequenceNumber !Int | VI_AliasSequenceNumber !BoundVar |
......@@ -970,8 +969,6 @@ cNotVarNumber :== -1
| EI_CaseType !CaseType
| EI_LetType ![AType]
| EI_CaseTypeWithContexts !CaseType ![(DefinedSymbol,[TypeContext])]
| EI_CaseTypeAndRefCounts !CaseType !RefCountsInCase
| EI_CaseTypeAndSplits !CaseType !SplitsInCase
| EI_LetTypeAndRefCounts ![AType] ![Int]
/* for converting case into function patterns the following auxiliary constuctors are used */
......@@ -979,6 +976,7 @@ cNotVarNumber :== -1
| EI_Default !Expression !AType !ExprInfoPtr
| EI_DefaultFunction !SymbIdent ![Expression]
| EI_Extended !ExtendedExprInfo !ExprInfo
| ..
:: ExtendedExprInfo
= EEI_ActiveCase !ActiveCaseInfo
......
......@@ -4,7 +4,6 @@ import StdEnv, compare_constructor
import scanner, general, Heap, typeproperties, utilities, compare_types
import IndexType
from containers import ::NumberSet
from convertcases import :: LetVarInfo, :: LetExpressionInfo, :: RefCountsInCase, :: SplitsInCase
instance toString Ident
where toString {id_name} = id_name
......
Markdown is supported
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