summaryrefslogtreecommitdiff
path: root/src/GF/Devel/GFC.hs
blob: ba2759c874693211714fe0fe89749be9f0e58494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Main where

import GF.Devel.Compile
import GF.Devel.GrammarToGFCC
import GF.Devel.UseIO
---import GF.Devel.PrGrammar ---

import System


main = do
  xx <- getArgs
  case xx of
    "-help":[] -> putStrLn "usage: gfc (--make) FILES"
    "--make":fs -> do
      gr <- batchCompile fs
      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."