gfcc generation in gfc works for some grammars

This commit is contained in:
aarne
2007-09-21 09:15:14 +00:00
parent 470038e017
commit 73ef8309ab
3 changed files with 184 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ module Main where
import GF.Devel.Compile
import GF.Devel.GrammarToGFCC
import GF.Devel.UseIO
---import GF.Devel.PrGrammar ---
import System
@@ -13,9 +14,11 @@ main = do
"-help":[] -> putStrLn "usage: gfc (--make) FILES"
"--make":fs -> do
gr <- batchCompile fs
--- putStrLn $ prGrammar gr
writeFile "a.gfcc" $ prGrammar2gfcc gr
putStrLn "Wrote file a.gfcc."
let name = justModuleName (last fs)
let (abs,gc) = prGrammar2gfcc name gr
let target = abs ++ ".gfcc"
writeFile target gc
putStrLn $ "wrote file " ++ target
_ -> do
mapM_ batchCompile (map return xx)
putStrLn "Done."