diff options
| author | aarne <aarne@cs.chalmers.se> | 2006-03-01 17:36:34 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2006-03-01 17:36:34 +0000 |
| commit | c30936dc16adf799c94722c54635b914aeca33c6 (patch) | |
| tree | 68dc016a17274c490fc538672cbdda000290b82e /src/GF/Compile | |
| parent | 8cf236bfbba7212908d35bed9b20b6b879913851 (diff) | |
refreshing gfe example
Diffstat (limited to 'src/GF/Compile')
| -rw-r--r-- | src/GF/Compile/MkConcrete.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/GF/Compile/MkConcrete.hs b/src/GF/Compile/MkConcrete.hs index d96e3e774..c8b5e338e 100644 --- a/src/GF/Compile/MkConcrete.hs +++ b/src/GF/Compile/MkConcrete.hs @@ -18,10 +18,11 @@ import GF.Grammar.Values (Tree,tree2exp) import GF.Grammar.PrGrammar (prt_) import GF.Grammar.Grammar (Term(Q,QC)) --- import GF.Grammar.Macros (composSafeOp, record2subst) -import GF.Compile.ShellState (firstStateGrammar) +import GF.Compile.ShellState --(firstStateGrammar,stateGrammarWords) import GF.Compile.PGrammar (pTerm) import GF.Compile.Compile import GF.API +import GF.API.IOGrammar import qualified GF.Embed.EmbedAPI as EA import GF.Data.Operations @@ -43,9 +44,6 @@ import Data.List -- Format of resource path (on first line): -- --# -resource=PATH -- Other lines are copied verbatim. --- The resource has to be built with --- i -src -optimize=share SOURCE --- because mcfg parsing is used. -- A sequence of files can be processed with the same resource without -- rebuilding the grammar and parser. @@ -62,12 +60,12 @@ mkConcretes files = do mkCncGroups (res,files) = do putStrLnFlush $ "Going to preprocess examples in " ++ unwords files putStrLn $ "Compiling resource " ++ res - egr <- appIOE $ - optFile2grammar (options [beSilent]) res - -- [useOptimizer "share",fromSource,beSilent,notEmitCode]) res --- for -mcfg - gr <- err (\s -> putStrLn s >> error "resource file rejected") return egr - let parser cat = errVal ([],"No parse") . - optParseArgErrMsg (options [newMParser, firstCat cat, beVerbose]) gr + egr <- appIOE $ shellStateFromFiles (options [beSilent]) emptyShellState res + gr <- err (\s -> putStrLn s >> error "resource grammar rejected") + (return . firstStateGrammar) egr + let parser cat = + errVal ([],"No parse") . + optParseArgErrMsg (options [newMParser, firstCat cat, beVerbose]) gr let morpho = isKnownWord gr putStrLn "Building parser" mapM_ (mkConcrete parser morpho) files |
