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

module structure for run time system

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