[project @ 2000-09-29 15:59:28 by sewardj]
[ghc-hetmet.git] / ghc / compiler / ghci / CompManager.lhs
1 %
2 % (c) The AQUA Project, Glasgow University, 1993-2000
3 %
4 \section[CompManager]{The Compilation Manager}
5
6 \begin{code}
7 module CompManager ( cmInit, cmLoadModule, 
8                      cmGetExpr, cmRunExpr,
9                      CmState  -- abstract
10                    )
11 where
12
13 #include "HsVersions.h"
14
15 import Outputable       ( SDoc )
16
17 import CmStaticInfo     ( FLAGS, PCI, SI, mkSI )
18 import CmFind           ( Finder, ModName )
19 import CmSummarise      ( )
20 import CmCompile        ( PCS, HST, HIT )
21 import CmLink           ( PLS, HValue, Linkable )
22
23
24
25 cmInit :: FLAGS 
26        -> PCI
27        -> IO CmState
28 cmInit flags pkginfo
29    = return (error "cmInit:unimp")
30
31 cmLoadModule :: CmState 
32              -> ModName
33              -> IO (CmState, Either [SDoc] ModHandle)
34 cmLoadModule cmstate modname
35    = return (error "cmLoadModule:unimp")
36
37 cmGetExpr :: CmState
38           -> ModHandle
39           -> String
40           -> IO (CmState, Either [SDoc] HValue)
41 cmGetExpr cmstate modhdl expr
42    = return (error "cmGetExpr:unimp")
43
44 cmRunExpr :: HValue -> IO ()
45 cmRunExpr hval
46    = return (error "cmRunExpr:unimp")
47
48 type ModHandle = String   -- ToDo: do better?
49
50
51 -- Persistent state just for CM, excluding link & compile subsystems
52 data PCMS
53    = PCMS HST   -- home symbol table
54           HIT   -- home interface table
55           UI    -- the unlinked images
56           MG    -- the module graph
57
58 -- Persistent state for the entire system
59 data CmState
60    = CmState PCMS      -- CM's persistent state
61              PCS       -- compile's persistent state
62              PLS       -- link's persistent state
63              SI        -- static info, never changes
64              Finder    -- the module finder
65
66 -- CM internal types
67 type UI = [Linkable]    -- the unlinked images (should be a set, really)
68 data MG = MG            -- the module graph
69
70
71
72
73 \end{code}