mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Some small documentation improvements
This commit is contained in:
2
gf.cabal
2
gf.cabal
@@ -141,6 +141,7 @@ Library
|
|||||||
hs-source-dirs: src/compiler
|
hs-source-dirs: src/compiler
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
GF
|
GF
|
||||||
|
GF.Text.Pretty
|
||||||
|
|
||||||
other-modules:
|
other-modules:
|
||||||
GF.Main GF.Compiler GF.Interactive
|
GF.Main GF.Compiler GF.Interactive
|
||||||
@@ -247,7 +248,6 @@ Library
|
|||||||
GF.Text.Clitics
|
GF.Text.Clitics
|
||||||
GF.Text.Coding
|
GF.Text.Coding
|
||||||
GF.Text.Lexing
|
GF.Text.Lexing
|
||||||
GF.Text.Pretty
|
|
||||||
GF.Text.Transliterations
|
GF.Text.Transliterations
|
||||||
Paths_gf
|
Paths_gf
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,22 @@ module GF(
|
|||||||
module GF.CompileInParallel,
|
module GF.CompileInParallel,
|
||||||
module GF.CompileOne,
|
module GF.CompileOne,
|
||||||
|
|
||||||
-- * Abstract syntax, parsing and pretty printing
|
-- * Abstract syntax, parsing, pretty printing and serialisation
|
||||||
module GF.Compile.GetGrammar,
|
module GF.Compile.GetGrammar,
|
||||||
module GF.Grammar.Grammar,
|
module GF.Grammar.Grammar,
|
||||||
module GF.Grammar.Macros,
|
module GF.Grammar.Macros,
|
||||||
module GF.Grammar.Printer,
|
module GF.Grammar.Printer,
|
||||||
module GF.Infra.Ident,
|
module GF.Infra.Ident,
|
||||||
|
-- ** Binary serialisation
|
||||||
|
module GF.Grammar.Binary,
|
||||||
|
|
||||||
-- * Supporting infrastructure and system utilities
|
-- * Supporting infrastructure and system utilities
|
||||||
module GF.Data.Operations,
|
module GF.Data.Operations,
|
||||||
module GF.Infra.UseIO,
|
module GF.Infra.UseIO,
|
||||||
module GF.Infra.Option,
|
module GF.Infra.Option,
|
||||||
module GF.System.Console
|
module GF.System.Console,
|
||||||
|
-- ** Binary serialisation
|
||||||
|
Binary,encode,decode,encodeFile,decodeFile
|
||||||
) where
|
) where
|
||||||
import GF.Main
|
import GF.Main
|
||||||
import GF.Compiler
|
import GF.Compiler
|
||||||
@@ -35,8 +39,10 @@ import GF.Grammar.Grammar
|
|||||||
import GF.Grammar.Macros
|
import GF.Grammar.Macros
|
||||||
import GF.Grammar.Printer
|
import GF.Grammar.Printer
|
||||||
import GF.Infra.Ident
|
import GF.Infra.Ident
|
||||||
|
import GF.Grammar.Binary
|
||||||
|
|
||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Infra.UseIO
|
import GF.Infra.UseIO
|
||||||
import GF.System.Console
|
import GF.System.Console
|
||||||
|
import Data.Binary
|
||||||
@@ -30,6 +30,8 @@ import PGF(PGF,defaultProbabilities,setProbabilities,readProbabilitiesFromFile)
|
|||||||
compileToPGF :: Options -> [FilePath] -> IOE PGF
|
compileToPGF :: Options -> [FilePath] -> IOE PGF
|
||||||
compileToPGF opts fs = link opts =<< batchCompile opts fs
|
compileToPGF opts fs = link opts =<< batchCompile opts fs
|
||||||
|
|
||||||
|
-- | Link a grammar into a 'PGF' that can be used to 'PGF.linearize' and
|
||||||
|
-- 'PGF.parse' with the "PGF" run-time system.
|
||||||
link :: Options -> (Ident,t,SourceGrammar) -> IOE PGF
|
link :: Options -> (Ident,t,SourceGrammar) -> IOE PGF
|
||||||
link opts (cnc,_,gr) =
|
link opts (cnc,_,gr) =
|
||||||
putPointE Normal opts "linking ... " $ do
|
putPointE Normal opts "linking ... " $ do
|
||||||
@@ -40,6 +42,7 @@ link opts (cnc,_,gr) =
|
|||||||
return $ setProbabilities probs
|
return $ setProbabilities probs
|
||||||
$ if flag optOptimizePGF opts then optimizePGF pgf else pgf
|
$ if flag optOptimizePGF opts then optimizePGF pgf else pgf
|
||||||
|
|
||||||
|
-- | Returns the name of the abstract syntax corresponding to the named concrete syntax
|
||||||
srcAbsName gr cnc = err (const cnc) id $ abstractOfConcrete gr cnc
|
srcAbsName gr cnc = err (const cnc) id $ abstractOfConcrete gr cnc
|
||||||
|
|
||||||
-- | Compile the given grammar files and everything they depend on
|
-- | Compile the given grammar files and everything they depend on
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ main = do
|
|||||||
uncurry mainOpts =<< getOptions
|
uncurry mainOpts =<< getOptions
|
||||||
|
|
||||||
-- | Get and parse GF command line arguments. Fix relative paths.
|
-- | Get and parse GF command line arguments. Fix relative paths.
|
||||||
|
-- Calls 'getArgs' and 'parseOptions'.
|
||||||
getOptions = do
|
getOptions = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
case parseOptions args of
|
case parseOptions args of
|
||||||
|
|||||||
Reference in New Issue
Block a user