summaryrefslogtreecommitdiff
path: root/src/GF/Devel/Compile/GFC.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:43:48 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:43:48 +0000
commitb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (patch)
tree0992334be13cec6538a1dea22fbbf26ad6bdf224 /src/GF/Devel/Compile/GFC.hs
parentfe367412e0aeb4ad5c02de68e6eca382e0f96984 (diff)
removed src for 2.9
Diffstat (limited to 'src/GF/Devel/Compile/GFC.hs')
-rw-r--r--src/GF/Devel/Compile/GFC.hs72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/GF/Devel/Compile/GFC.hs b/src/GF/Devel/Compile/GFC.hs
deleted file mode 100644
index f60ec9380..000000000
--- a/src/GF/Devel/Compile/GFC.hs
+++ /dev/null
@@ -1,72 +0,0 @@
-module GF.Devel.Compile.GFC (mainGFC) where
--- module Main where
-
-import GF.Devel.Compile.Compile
-import GF.Devel.Compile.GFtoGFCC
-import GF.Devel.PrintGFCC
-import GF.GFCC.OptimizeGFCC
-import GF.GFCC.CheckGFCC
-import GF.GFCC.DataGFCC
-import GF.GFCC.Raw.ParGFCCRaw
-import GF.GFCC.Raw.ConvertGFCC
-import GF.Devel.UseIO
-import GF.Infra.Option
-import GF.GFCC.API
-import GF.Data.ErrM
-
-mainGFC :: [String] -> IO ()
-mainGFC xx = do
- let (opts,fs) = getOptions "-" xx
- case opts of
- _ | oElem (iOpt "help") opts -> putStrLn usageMsg
- _ | oElem (iOpt "-make") opts -> do
- gr <- batchCompile opts fs
- let name = justModuleName (last fs)
- let (abs,gc0) = mkCanon2gfcc opts name gr
- gc1 <- checkGFCCio gc0
- let gc = if oElem (iOpt "noopt") opts then gc1 else optGFCC gc1
- let target = targetName opts abs
- let gfccFile = target ++ ".gfcc"
- writeFile gfccFile (printGFCC gc)
- putStrLn $ "wrote file " ++ gfccFile
- mapM_ (alsoPrint opts target gc) printOptions
-
- -- gfc -o target.gfcc source_1.gfcc ... source_n.gfcc
- _ | all ((==".gfcc") . takeExtensions) fs -> do
- gfccs <- mapM file2gfcc fs
- let gfcc = foldl1 unionGFCC gfccs
- let abs = printCId $ absname gfcc
- let target = targetName opts abs
- let gfccFile = target ++ ".gfcc"
- writeFile gfccFile (printGFCC gfcc)
- putStrLn $ "wrote file " ++ gfccFile
- mapM_ (alsoPrint opts target gfcc) printOptions
-
- _ -> do
- mapM_ (batchCompile opts) (map return fs)
- putStrLn "Done."
-
-targetName opts abs = case getOptVal opts (aOpt "target") of
- Just n -> n
- _ -> abs
-
----- TODO: nicer and richer print options
-
-alsoPrint opts abs gr (opt,name) = do
- if oElem (iOpt opt) opts
- then do
- let outfile = name
- let output = prGFCC opt gr
- writeFile outfile output
- putStrLn $ "wrote file " ++ outfile
- else return ()
-
-printOptions = [
- ("haskell","GSyntax.hs"),
- ("haskell_gadt","GSyntax.hs"),
- ("js","grammar.js"),
- ("jsref","grammarReference.js")
- ]
-
-usageMsg =
- "usage: gfc (-h | --make (-noopt) (-target=PREFIX) (-js | -jsref | -haskell | -haskell_gadt)) (-src) FILES"