mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
replace GFCC with PGF in (almost) all places
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user