From 9d6c383c07a2ec88ca63c4dbd08621a11fb6eef0 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 22 May 2008 13:05:12 +0000 Subject: move GF.Devel.GetGrammar to GF.Compile.GetGrammar --- src-3.0/GF/Compile.hs | 2 +- src-3.0/GF/Compile/GetGrammar.hs | 54 ++++++++++++++++++++++++++++++++++++++++ src-3.0/GF/Devel/GetGrammar.hs | 54 ---------------------------------------- 3 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 src-3.0/GF/Compile/GetGrammar.hs delete mode 100644 src-3.0/GF/Devel/GetGrammar.hs diff --git a/src-3.0/GF/Compile.hs b/src-3.0/GF/Compile.hs index dba6c96cc..80f5c0fd4 100644 --- a/src-3.0/GF/Compile.hs +++ b/src-3.0/GF/Compile.hs @@ -1,7 +1,7 @@ module GF.Compile (batchCompile, compileToGFCC) where -- the main compiler passes -import GF.Devel.GetGrammar +import GF.Compile.GetGrammar import GF.Compile.Extend import GF.Compile.Rebuild import GF.Compile.Rename diff --git a/src-3.0/GF/Compile/GetGrammar.hs b/src-3.0/GF/Compile/GetGrammar.hs new file mode 100644 index 000000000..0687c081b --- /dev/null +++ b/src-3.0/GF/Compile/GetGrammar.hs @@ -0,0 +1,54 @@ +---------------------------------------------------------------------- +-- | +-- Module : GetGrammar +-- Maintainer : AR +-- Stability : (stable) +-- Portability : (portable) +-- +-- > CVS $Date: 2005/11/15 17:56:13 $ +-- > CVS $Author: aarne $ +-- > CVS $Revision: 1.16 $ +-- +-- this module builds the internal GF grammar that is sent to the type checker +----------------------------------------------------------------------------- + +module GF.Compile.GetGrammar where + +import GF.Data.Operations +import qualified GF.Source.ErrM as E + +import GF.Devel.UseIO +import GF.Grammar.Grammar +import GF.Infra.Modules +import GF.Devel.PrGrammar +import qualified GF.Source.AbsGF as A +import GF.Source.SourceToGrammar +---- import Macros +---- import Rename +import GF.Infra.Option +--- import Custom +import GF.Source.ParGF +import qualified GF.Source.LexGF as L + +import GF.Devel.ReadFiles ---- + +import Data.Char (toUpper) +import Data.List (nub) +import qualified Data.ByteString.Char8 as BS +import Control.Monad (foldM) +import System (system) + +getSourceModule :: Options -> FilePath -> IOE SourceModule +getSourceModule opts file0 = do + file <- case getOptVal opts usePreprocessor of + Just p -> do + let tmp = "_gf_preproc.tmp" + cmd = p +++ file0 ++ ">" ++ tmp + ioeIO $ system cmd + -- ioeIO $ putStrLn $ "preproc" +++ cmd + return tmp + _ -> return file0 + string <- readFileIOE file + let tokens = myLexer string + mo1 <- ioeErr $ pModDef tokens + ioeErr $ transModDef mo1 diff --git a/src-3.0/GF/Devel/GetGrammar.hs b/src-3.0/GF/Devel/GetGrammar.hs deleted file mode 100644 index cdd275ace..000000000 --- a/src-3.0/GF/Devel/GetGrammar.hs +++ /dev/null @@ -1,54 +0,0 @@ ----------------------------------------------------------------------- --- | --- Module : GetGrammar --- Maintainer : AR --- Stability : (stable) --- Portability : (portable) --- --- > CVS $Date: 2005/11/15 17:56:13 $ --- > CVS $Author: aarne $ --- > CVS $Revision: 1.16 $ --- --- this module builds the internal GF grammar that is sent to the type checker ------------------------------------------------------------------------------ - -module GF.Devel.GetGrammar where - -import GF.Data.Operations -import qualified GF.Source.ErrM as E - -import GF.Devel.UseIO -import GF.Grammar.Grammar -import GF.Infra.Modules -import GF.Devel.PrGrammar -import qualified GF.Source.AbsGF as A -import GF.Source.SourceToGrammar ----- import Macros ----- import Rename -import GF.Infra.Option ---- import Custom -import GF.Source.ParGF -import qualified GF.Source.LexGF as L - -import GF.Devel.ReadFiles ---- - -import Data.Char (toUpper) -import Data.List (nub) -import qualified Data.ByteString.Char8 as BS -import Control.Monad (foldM) -import System (system) - -getSourceModule :: Options -> FilePath -> IOE SourceModule -getSourceModule opts file0 = do - file <- case getOptVal opts usePreprocessor of - Just p -> do - let tmp = "_gf_preproc.tmp" - cmd = p +++ file0 ++ ">" ++ tmp - ioeIO $ system cmd - -- ioeIO $ putStrLn $ "preproc" +++ cmd - return tmp - _ -> return file0 - string <- readFileIOE file - let tokens = myLexer string - mo1 <- ioeErr $ pModDef tokens - ioeErr $ transModDef mo1 -- cgit v1.2.3