mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Started on a stub GFC.Main
This commit is contained in:
28
src/GF/Devel/GFC/Main.hs
Normal file
28
src/GF/Devel/GFC/Main.hs
Normal file
@@ -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 ()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user