Commit 6ed00464 authored by Bernd Brassel's avatar Bernd Brassel
Browse files

module structure for run time system

parent 01276678
......@@ -7,7 +7,7 @@ Homepage: http://curry-language.org
License: OtherLicense
License-File: LICENSE
Category: Compiler
build-type: Simple
build-type: Custom
Synopsis: A compiler from Curry to Haskell
Description: This package builds two binaries, kics and kicsi, respectively.
The first is the Curry to Haskell compiler, the latter a text
......@@ -38,33 +38,24 @@ Executable kics
PreTrans
Simplification
Brace
InstallDir
MyReadline
Paths_KiCS
Executable kicsi
main-is: kicsi.hs
hs-source-dirs: src
Build-Depends:
base == 4.1.*,
haskell98,
old-time,
filepath,
mtl,
directory,
containers,
readline,
curry-base >= 0.2.4
readline
Library
hs-source-dirs: src
Build-Depends:
syb
Other-Modules:
Config
CurryToHaskell
SafeCalls
Names
KicsSubdir
FunctionalProg
ShowFunctionalProg
ShowFlatCurry
PreTrans
Simplification
Brace
InstallDir
MyReadline
Store,
BaseCurry,
RunTimeCurry,
Curry
import Distribution.Simple
import Distribution.Simple.PreProcess
import Distribution.Simple.LocalBuildInfo
import Distribution.PackageDescription
import Distribution.Simple.Program
import Distribution.Simple.Utils
main = defaultMainWithHooks
simpleUserHooks{hookedPreProcessors=
("curry",\_ _ -> mkCurryLibrary):
main = do
print 42
--getDataFileName "Prelude.curry" >>= print
defaultMainWithHooks
simpleUserHooks{hookedPrograms=[simpleProgram "cymake"]
,preConf=myPreConf
,preBuild=myPreBuild
,preInst=myPreInst
,hookedPreProcessors=
("curry",mkCurryLibrary):
hookedPreProcessors simpleUserHooks}
mkCurryLibrary :: PreProcessor
mkCurryLibrary = PreProcessor {
mkCurryLibrary :: BuildInfo -> LocalBuildInfo -> PreProcessor
mkCurryLibrary bi lbi = PreProcessor {
platformIndependent = True,
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
do info verbosity (inFile++" has been preprocessed to "++outFile)
do print 112
info verbosity (inFile++" has been preprocessed to "++outFile)
stuff <- readFile inFile
writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
return ExitSuccess
writeFile outFile ("module Curry.Module.Prelude where f=3")
return undefined }--ExitSuccess}
myPreConf a b = print 41 >> preConf simpleUserHooks a b
myPreInst a b = print 43 >> preInst simpleUserHooks a b
myPreBuild args buildflags = do
print 44
hookedBuildInfo <- preBuild simpleUserHooks args buildflags
return hookedBuildInfo
module Curry (
module RunTimeCurry,
) where
import RunTimeCurry
{-# OPTIONS -O0 #-}
module RunTimeCurry (
module BaseCurry,
module RunTimeCurry
module Curry.RunTimeSystem (
module Curry.RunTimeSystem.BaseCurry,
module Curry.RunTimeSystem
) where
import System.IO
import BaseCurry
import Curry.RunTimeSystem.BaseCurry
import System.IO.Unsafe
import Data.IORef
......
module BaseCurry (module BaseCurry, module Store) where
module Curry.RunTimeSystem.BaseCurry (
module Curry.RunTimeSystem.BaseCurry,
module Curry.RunTimeSystem.Store) where
import Store
import Curry.RunTimeSystem.Store
import Data.IORef
import System.IO.Unsafe
......
{-# LANGUAGE DeriveDataTypeable #-}
module Store
module Curry.RunTimeSystem.Store
(Store,
emptyStore,changeStore, storeSize,
......
......@@ -193,17 +193,6 @@ foldCompile (f:fs) opts
-- names of all haskell files associated with program
haskellFiles :: Options -> String -> [String]
haskellFiles opts name = [funcHsName name]
{-
ifAdd (extData opts) (add [extDataHsName]) $
ifAdd (extInsts opts) (add [dataHsName,extInstHsName]) $
ifAdd (extFuncs opts) (add [instHsName,extFuncHsName]) $
add [funcHsName] []
where
ifAdd (_:_) f ds = f ds
ifAdd [] _ ds = ds
add = foldr (\ f -> ((f name:) .)) id
-}
------------------------------------------------------
-- basic transformation
......
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