summaryrefslogtreecommitdiff
path: root/src-3.0/GF
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@chalmers.se>2008-05-22 12:57:33 +0000
committerkr.angelov <kr.angelov@chalmers.se>2008-05-22 12:57:33 +0000
commita28b61be1c28ce82bf00a514b63f53b2652b8d0b (patch)
tree83387d63a21b949473ba6b067722aa1cd89f10ee /src-3.0/GF
parent2e49f7f5b15e106f46e6d714b6e91aaf1a303bcd (diff)
move GF.Devel.Compile and GF.Compile.API to GF.Compile
Diffstat (limited to 'src-3.0/GF')
-rw-r--r--src-3.0/GF/Command/Importing.hs2
-rw-r--r--src-3.0/GF/Compile.hs (renamed from src-3.0/GF/Devel/Compile.hs)24
-rw-r--r--src-3.0/GF/Compile/API.hs21
-rw-r--r--src-3.0/GF/Devel/GFC.hs2
4 files changed, 22 insertions, 27 deletions
diff --git a/src-3.0/GF/Command/Importing.hs b/src-3.0/GF/Command/Importing.hs
index a09ba8de6..bca59048f 100644
--- a/src-3.0/GF/Command/Importing.hs
+++ b/src-3.0/GF/Command/Importing.hs
@@ -1,6 +1,6 @@
module GF.Command.Importing (importGrammar) where
-import GF.Compile.API
+import GF.Compile
import GF.GFCC.DataGFCC
import GF.GFCC.API
diff --git a/src-3.0/GF/Devel/Compile.hs b/src-3.0/GF/Compile.hs
index b746812f7..dba6c96cc 100644
--- a/src-3.0/GF/Devel/Compile.hs
+++ b/src-3.0/GF/Compile.hs
@@ -1,4 +1,4 @@
-module GF.Devel.Compile (batchCompile) where
+module GF.Compile (batchCompile, compileToGFCC) where
-- the main compiler passes
import GF.Devel.GetGrammar
@@ -8,10 +8,8 @@ import GF.Compile.Rename
import GF.Grammar.Refresh
import GF.Devel.CheckGrammar
import GF.Devel.Optimize
---import GF.Compile.Evaluate ----
import GF.Devel.OptimizeGF
---import GF.Canon.Share
---import GF.Canon.Subexpressions (elimSubtermsMod,unSubelimModule)
+import GF.Devel.GrammarToGFCC
import GF.Grammar.Grammar
import GF.Infra.Ident
@@ -36,6 +34,24 @@ import System.FilePath
import System.Time
import qualified Data.Map as Map
+import GF.GFCC.OptimizeGFCC
+import GF.GFCC.CheckGFCC
+import GF.GFCC.DataGFCC
+
+
+-- | Compiles a number of source files and builds a 'GFCC' structure for them.
+compileToGFCC :: Options -> [FilePath] -> IOE GFCC
+compileToGFCC opts fs =
+ do gr <- batchCompile opts fs
+ let name = justModuleName (last fs)
+ gc1 <- putPointE opts "linking ... " $
+ let (abs,gc0) = mkCanon2gfcc opts name gr
+ in ioeIO $ checkGFCCio gc0
+ let opt = if oElem (iOpt "noopt") opts then id else optGFCC
+ par = if oElem (iOpt "noparse") opts then id else addParsers
+ return (par (opt gc1))
+
+
batchCompile :: Options -> [FilePath] -> IOE SourceGrammar
batchCompile opts files = do
(_,gr,_) <- foldM (compileModule defOpts) emptyCompileEnv files
diff --git a/src-3.0/GF/Compile/API.hs b/src-3.0/GF/Compile/API.hs
deleted file mode 100644
index 7e852cf7a..000000000
--- a/src-3.0/GF/Compile/API.hs
+++ /dev/null
@@ -1,21 +0,0 @@
-module GF.Compile.API (batchCompile, compileToGFCC) where
-
-import GF.Devel.Compile
-import GF.Devel.GrammarToGFCC
-import GF.GFCC.OptimizeGFCC
-import GF.GFCC.CheckGFCC
-import GF.GFCC.DataGFCC
-import GF.Infra.Option
-import GF.Devel.UseIO
-
--- | Compiles a number of source files and builds a 'GFCC' structure for them.
-compileToGFCC :: Options -> [FilePath] -> IOE GFCC
-compileToGFCC opts fs =
- do gr <- batchCompile opts fs
- let name = justModuleName (last fs)
- gc1 <- putPointE opts "linking ... " $
- let (abs,gc0) = mkCanon2gfcc opts name gr
- in ioeIO $ checkGFCCio gc0
- let opt = if oElem (iOpt "noopt") opts then id else optGFCC
- par = if oElem (iOpt "noparse") opts then id else addParsers
- return (par (opt gc1))
diff --git a/src-3.0/GF/Devel/GFC.hs b/src-3.0/GF/Devel/GFC.hs
index 13e47e788..562570f14 100644
--- a/src-3.0/GF/Devel/GFC.hs
+++ b/src-3.0/GF/Devel/GFC.hs
@@ -1,7 +1,7 @@
module GF.Devel.GFC (mainGFC) where
-- module Main where
-import GF.Compile.API
+import GF.Compile
import GF.Devel.PrintGFCC
import GF.GFCC.CId
import GF.GFCC.DataGFCC