printing new source format

This commit is contained in:
aarne
2007-12-04 15:01:01 +00:00
parent 836583cfac
commit 3d74432c54
6 changed files with 748 additions and 20 deletions

View File

@@ -1,30 +1,21 @@
module Main where
import GF.Devel.Grammar.LexGF
import GF.Devel.Grammar.ParGF
---- import GF.Devel.Grammar.PrintGF
import GF.Devel.Grammar.Modules
import GF.Devel.Compile.Compile
import GF.Devel.Grammar.SourceToGF
import qualified GF.Devel.Grammar.ErrM as GErr ----
import GF.Data.Operations
import GF.Infra.Option ----
import Data.Map
import System (getArgs)
main = do
f:_ <- getArgs
s <- readFile f
let tt = myLexer s
case pGrammar tt of
GErr.Bad s -> putStrLn s
GErr.Ok g -> compile g
xx <- getArgs
mainGFC xx
compile g = do
let eg = transGrammar g
case eg of
Ok gr -> print (length (assocs (gfmodules gr))) >> putStrLn "OK"
Bad s -> putStrLn s
return ()
mainGFC :: [String] -> IO ()
mainGFC xx = do
let (opts,fs) = getOptions "-" xx
case opts of
_ -> do
mapM_ (batchCompile opts) (map return fs)
putStrLn "Done."