diff options
| author | bringert <bringert@cs.chalmers.se> | 2007-09-28 13:27:12 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2007-09-28 13:27:12 +0000 |
| commit | 5fedbc53ae997bd8d4071d05fc10853f80065698 (patch) | |
| tree | 5f094d8e189dc2856683afdff3a582d5c333e878 /src | |
| parent | 64b7683ee4bff3ed0fc67b38f0b1e9f595290492 (diff) | |
Started on a stub GFC.Main
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Devel/GFC/Main.hs | 28 | ||||
| -rw-r--r-- | src/GF/Devel/GFC/Options.hs | 9 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/GF/Devel/GFC/Main.hs b/src/GF/Devel/GFC/Main.hs new file mode 100644 index 000000000..d9ceb8e70 --- /dev/null +++ b/src/GF/Devel/GFC/Main.hs @@ -0,0 +1,28 @@ +module GF.Devel.GFC.Main where + +import GF.Devel.GFC.Options + +import System.Environment +import System.Exit +import System.IO + + +version = "X.X" + +main :: IO () +main = + do args <- getArgs + case parseOptions args of + Ok (opts, files) -> + case optMode opts of + Version -> putStrLn $ "GF, version " ++ version + Help -> putStr helpMessage + Compiler -> gfcMain opts files + Errors errs -> + do mapM_ (hPutStrLn stderr) errs + exitFailure + +gfcMain :: Options -> [FilePath] -> IO () +gfcMain opts files = return () + + diff --git a/src/GF/Devel/GFC/Options.hs b/src/GF/Devel/GFC/Options.hs index 97d229b36..af8bfa6af 100644 --- a/src/GF/Devel/GFC/Options.hs +++ b/src/GF/Devel/GFC/Options.hs @@ -1,4 +1,11 @@ -module GF.Devel.Options where +module GF.Devel.GFC.Options + ( + Err(..), -- FIXME: take from somewhere else + + Options(..), + Mode(..), Phase(..), OutputFormat(..), Optimization(..), + parseOptions, helpMessage + ) where import Control.Monad import Data.Maybe |
