summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-06-18 12:55:58 +0000
committerkrasimir <krasimir@chalmers.se>2010-06-18 12:55:58 +0000
commit992a7ffb381190ffa67f59f33d0dfadf41f84e78 (patch)
treef76a7b6120f4bcc92b41a17651efb51717c8f7bb /src/compiler/GF/Compile.hs
parent5dfc9bbc0b87d27b4ef8848a36520605fa868fe3 (diff)
Yay!! Direct generation of PMCFG from GF grammar
Diffstat (limited to 'src/compiler/GF/Compile.hs')
-rw-r--r--src/compiler/GF/Compile.hs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs
index bf872c138..ecb533c3f 100644
--- a/src/compiler/GF/Compile.hs
+++ b/src/compiler/GF/Compile.hs
@@ -35,9 +35,9 @@ import qualified Data.Set as Set
import Data.List(nub)
import Data.Maybe (isNothing)
import Data.Binary
+import qualified Data.ByteString.Char8 as BS
import Text.PrettyPrint
-import PGF.Check
import PGF.CId
import PGF.Data
import PGF.Macros
@@ -49,20 +49,15 @@ compileToPGF :: Options -> [FilePath] -> IOE PGF
compileToPGF opts fs =
do gr <- batchCompile opts fs
let name = justModuleName (last fs)
- link opts name gr
+ link opts (identC (BS.pack name)) gr
-link :: Options -> String -> SourceGrammar -> IOE PGF
+link :: Options -> Ident -> SourceGrammar -> IOE PGF
link opts cnc gr = do
let isv = (verbAtLeast opts Normal)
putPointE Normal opts "linking ... " $ do
- gc0 <- ioeIO (mkCanon2pgf opts cnc gr)
- case checkPGF gc0 of
- Ok (gc,b) -> do case (isv,b) of
- (True, True) -> ioeIO $ putStrLn "OK"
- (False,True) -> return ()
- _ -> ioeIO $ putStrLn $ "Corrupted PGF"
- return $ if flag optOptimizePGF opts then optimizePGF gc else gc
- Bad s -> fail s
+ gc <- ioeIO (mkCanon2pgf opts cnc gr)
+ ioeIO $ putStrLn "OK"
+ return $ if flag optOptimizePGF opts then optimizePGF gc else gc
batchCompile :: Options -> [FilePath] -> IOE SourceGrammar
batchCompile opts files = do