diff options
author | ronny | 2002-11-01 12:40:49 +0000 |
---|---|---|
committer | ronny | 2002-11-01 12:40:49 +0000 |
commit | ed5f9a458b6b817ad609f23f50f09be85a56e9f2 (patch) | |
tree | 26b33bdf5586d198b7de2f6d895077a97b83d586 /frontend/convertcases.icl | |
parent | Fix bug where wrong type code constructor was selected. (diff) |
moved RefCountsInCase and SplitsInCase type definitions from syntax to convertcases
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1266 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/convertcases.icl')
-rw-r--r-- | frontend/convertcases.icl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/frontend/convertcases.icl b/frontend/convertcases.icl index 0c6fbd7..e55c7f0 100644 --- a/frontend/convertcases.icl +++ b/frontend/convertcases.icl @@ -141,6 +141,17 @@ convertCasesInBody (TransformedBody body) (Yes type) group_index common_defs cs , plvi_new :: !Bool } +:: RefCountsInCase = + { rcc_all_variables :: ![CountedVariable] + , rcc_default_variables :: ![CountedVariable] + , rcc_pattern_variables :: ![[CountedVariable]] + } + +:: CountedVariable = + { cv_variable :: !VarInfoPtr + , cv_count :: !Int + } + checkImportedSymbol :: SymbKind VarInfoPtr ([SymbKind], *VarHeap) -> ([SymbKind], *VarHeap) checkImportedSymbol symb_kind symb_type_ptr (collected_imports, var_heap) # (type_info, var_heap) = readPtr symb_type_ptr var_heap @@ -885,6 +896,27 @@ where The actual splitting, the introduction of new functions, and the introduction of calls to these functions is done in convertRootCases. */ +:: SplitCase = + { sc_alt_nr :: CaseAltNr // the number of the alternative, before which + // the case should be split + , sc_call :: Optional Expression // call to the function that was introduced for + // this split case + } + +:: NextAlt = + { na_case :: ExprInfoPtr // the case_info_ptr of the case + , na_alt_nr :: CaseAltNr // the number of the alternative + } + +:: CaseAltNr :== Int // the sequence number of the alternative (zero based), the + // default alternative is indicated by the number of the last + // alternative + 1 + +:: SplitsInCase = + { sic_next_alt :: Optional NextAlt // the alternative of an outer default, to which + // control should pass + , sic_splits :: [SplitCase] // the positions where this case should be split + } :: SplitState = { ss_expr_heap :: !.ExpressionHeap |