replace GFCC with PGF in (almost) all places

This commit is contained in:
krasimir
2008-05-30 11:15:33 +00:00
parent 587eed4eaa
commit 56c34b5dd8
20 changed files with 246 additions and 267 deletions

View File

@@ -13,20 +13,18 @@ import Data.List (nubBy)
import System.FilePath
-- import a grammar in an environment where it extends an existing grammar
importGrammar :: MultiGrammar -> Options -> [FilePath] -> IO MultiGrammar
importGrammar mgr0 opts files =
importGrammar :: PGF -> Options -> [FilePath] -> IO PGF
importGrammar pgf0 opts files =
case takeExtensions (last files) of
s | elem s [".gf",".gfo"] -> do
res <- appIOE $ compileToGFCC opts files
res <- appIOE $ compileToPGF opts files
case res of
Ok gfcc2 -> do let gfcc3 = unionGFCC (gfcc mgr0) gfcc2
return $ MultiGrammar gfcc3
Bad msg -> do putStrLn msg
return mgr0
".gfcc" -> do
gfcc2 <- mapM file2gfcc files >>= return . foldl1 unionGFCC
let gfcc3 = unionGFCC (gfcc mgr0) gfcc2
return $ MultiGrammar gfcc3
Ok pgf2 -> do return $ unionPGF pgf0 pgf2
Bad msg -> do putStrLn msg
return pgf0
".pgf" -> do
pgf2 <- mapM file2pgf files >>= return . foldl1 unionPGF
return $ unionPGF pgf0 pgf2
importSource :: SourceGrammar -> Options -> [FilePath] -> IO SourceGrammar
importSource src0 opts files = do