forked from GitHub/gf-core
remove some redundant dependencies from FCFG
This commit is contained in:
@@ -2,7 +2,7 @@ module GF.Canon.GFCC.FCFGParsing (parserLang,buildPInfo,FCFPInfo) where
|
||||
|
||||
import GF.Canon.GFCC.DataGFCC
|
||||
import GF.Canon.GFCC.AbsGFCC
|
||||
import GF.Conversion.SimpleToFCFG (convertGrammarCId,FCat(..))
|
||||
import GF.Conversion.SimpleToFCFG (convertGrammar,FCat(..))
|
||||
|
||||
--import GF.System.Tracing
|
||||
--import GF.Infra.Print
|
||||
@@ -35,11 +35,9 @@ import qualified GF.Parsing.FCFG as PF
|
||||
import GF.Canon.GFCC.ErrM
|
||||
import GF.Infra.PrintClass
|
||||
|
||||
--convertGrammarCId :: Grammar -> [(CId,FGrammar)]
|
||||
|
||||
parserLang :: GFCC -> CId -> CFCat -> [CFTok] -> Err [Exp]
|
||||
parserLang mgr lang = parse info where
|
||||
fcfgs = convertGrammarCId mgr
|
||||
fcfgs = convertGrammar mgr
|
||||
info = buildPInfo $ maybe (error "no parser") id $ lookup lang fcfgs
|
||||
|
||||
type CFTok = String ----
|
||||
|
||||
@@ -23,14 +23,14 @@ import GF.Canon.GFCC.PrintGFCC
|
||||
import GF.Canon.GFCC.ErrM
|
||||
import GF.Canon.GFCC.FCFGParsing
|
||||
import qualified GF.Canon.GFCC.GenGFCC as G
|
||||
import GF.Conversion.SimpleToFCFG (convertGrammarCId,FCat(..)) ----
|
||||
import GF.Conversion.SimpleToFCFG (convertGrammar,FCat(..))
|
||||
|
||||
--import GF.Data.Operations
|
||||
--import GF.Infra.UseIO
|
||||
import qualified Data.Map as Map
|
||||
import System.Random (newStdGen)
|
||||
import System.Directory (doesFileExist)
|
||||
import System
|
||||
|
||||
|
||||
-- This API is meant to be used when embedding GF grammars in Haskell
|
||||
-- programs. The embedded system is supposed to use the
|
||||
@@ -73,7 +73,7 @@ startCat :: MultiGrammar -> Category
|
||||
|
||||
file2grammar f = do
|
||||
gfcc <- file2gfcc f
|
||||
let fcfgs = convertGrammarCId gfcc
|
||||
let fcfgs = convertGrammar gfcc
|
||||
return (MultiGrammar gfcc [(lang, buildPInfo fcfg) | (CId lang,fcfg) <- fcfgs])
|
||||
|
||||
file2gfcc f =
|
||||
|
||||
@@ -4,7 +4,7 @@ module GF.Canon.GFCC.ParGFCC where
|
||||
import GF.Canon.GFCC.AbsGFCC
|
||||
import GF.Canon.GFCC.LexGFCC
|
||||
import GF.Canon.GFCC.ErrM
|
||||
import Array
|
||||
import Data.Array
|
||||
#if __GLASGOW_HASKELL__ >= 503
|
||||
import GHC.Exts
|
||||
#else
|
||||
|
||||
@@ -4,7 +4,7 @@ module GF.Canon.GFCC.PrintGFCC where
|
||||
-- pretty-printer generated by the BNF converter
|
||||
|
||||
import GF.Canon.GFCC.AbsGFCC
|
||||
import Char
|
||||
import Data.Char
|
||||
|
||||
-- the top-level printing method
|
||||
printTree :: Print a => a -> String
|
||||
|
||||
Reference in New Issue
Block a user