diff options
| author | hallgren <hallgren@chalmers.se> | 2014-10-16 15:00:49 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-10-16 15:00:49 +0000 |
| commit | 2e2e7acf12c1b84eb1d4f0ac28d120a4d0c4a1c4 (patch) | |
| tree | f0de89cd93e68ea63e4ace685840ef6edf3a44e0 /src/compiler/GF.hs | |
| parent | c924491289259fa8a5a259ed97f2d9e817e3338c (diff) | |
Turn the GF compiler into a library. Main program is now in src/programs/gf.hs
The module src/compiler/GF.hs now serves as a prelimiary compiler API. It just
exports a selection of functions and types from the compiler.
Haddock documentation can be generated with
cabal haddock --hyperlink-source
Also bumbed the version number to 3.6.10.
Diffstat (limited to 'src/compiler/GF.hs')
| -rw-r--r-- | src/compiler/GF.hs | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/src/compiler/GF.hs b/src/compiler/GF.hs index cb63cadbe..bdb3e9b48 100644 --- a/src/compiler/GF.hs +++ b/src/compiler/GF.hs @@ -1,37 +1,36 @@ -module Main where +module GF( + -- * Command line interface + module GF.Main, + module GF.Compiler, + module GF.Interactive, + -- * Compiling GF grammars + module GF.Compile, + module GF.CompileInParallel, + module GF.CompileOne, + + -- * Abstract syntax, parsing and pretty printing + module GF.Compile.GetGrammar, + module GF.Grammar, + + -- * Supporting infrastructure and system utilities + module GF.Data.Operations, + module GF.Infra.UseIO, + module GF.Infra.Option, + module GF.System.Console + ) where +import GF.Main import GF.Compiler import GF.Interactive -import GF.Data.ErrM -import GF.Infra.Option -import GF.Infra.UseIO -import GF.Infra.BuildInfo (buildInfo) -import Paths_gf -import Data.Version -import System.Directory -import System.Environment (getArgs) -import System.Exit -import GF.System.Console (setConsoleEncoding) +import GF.Compile +import GF.CompileInParallel +import GF.CompileOne -main :: IO () -main = do - setConsoleEncoding - args <- getArgs - case parseOptions args of - Ok (opts,files) -> do curr_dir <- getCurrentDirectory - lib_dir <- getLibraryDirectory opts - mainOpts (fixRelativeLibPaths curr_dir lib_dir opts) files - Bad err -> do ePutStrLn err - ePutStrLn "You may want to try --help." - exitFailure +import GF.Compile.GetGrammar +import GF.Grammar -mainOpts :: Options -> [FilePath] -> IO () -mainOpts opts files = - case flag optMode opts of - ModeVersion -> putStrLn $ "Grammatical Framework (GF) version " ++ showVersion version ++ "\n" ++ buildInfo - ModeHelp -> putStrLn helpMessage - ModeInteractive -> mainGFI opts files - ModeRun -> mainRunGFI opts files - ModeServer port -> mainServerGFI opts port files - ModeCompiler -> mainGFC opts files +import GF.Data.Operations +import GF.Infra.Option +import GF.Infra.UseIO +import GF.System.Console |
