From 18b01b5e638151124207d602d7a751f1f87b50d3 Mon Sep 17 00:00:00 2001 From: martinw Date: Fri, 12 Jan 2001 16:25:02 +0000 Subject: New algorithm for explicit imports that also works with cyclic module dependencies git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@286 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/explicitimports.dcl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'frontend/explicitimports.dcl') diff --git a/frontend/explicitimports.dcl b/frontend/explicitimports.dcl index 68f9690..0104e79 100644 --- a/frontend/explicitimports.dcl +++ b/frontend/explicitimports.dcl @@ -2,9 +2,20 @@ definition module explicitimports import syntax, checksupport -possiblyFilterExplImportedDecls :: ![ImportDeclaration] u:[w:(.Index,y:Declarations)] Position *{#DclModule} !*CheckState - -> (!v:[x:(Index,z:Declarations)],!.{#DclModule},!.CheckState), [y <= z, w <= x, u <= v] +:: ImportNrAndIdents = + { ini_symbol_nr :: !Index + , ini_belonging :: !Optional [ImportedIdent] + } -checkExplicitImportCompleteness :: !Int ![ExplicitImport] !*{#DclModule} !*{#FunDef} !*ExpressionHeap !*CheckState +:: SolvedImports = + { si_explicit :: ![([Declaration], Position)] + , si_implicit :: ![(Index, Position)] // module indices + } + + +solveExplicitImports :: !(IntKeyHashtable [(Int,Position,[ImportNrAndIdents])]) !{#Int} !Index + !*(!{#x:DclModule},!*{#Int},!{!*ExplImpInfo},!*CheckState) + -> (!.SolvedImports,!(!{#x:DclModule},!.{#Int},!{!.ExplImpInfo},!.CheckState)) +checkExplicitImportCompleteness :: ![(Declaration, Position)] !*{#DclModule} !*{#FunDef} !*ExpressionHeap !*CheckState -> (!.{#DclModule},!.{#FunDef},!.ExpressionHeap,!.CheckState) -- cgit v1.2.3