From af1a3a2473747942dcec647a42e5724fcb21d1b9 Mon Sep 17 00:00:00 2001 From: bringert Date: Thu, 3 Jan 2008 17:10:05 +0000 Subject: Store FCFPInfo (all information needed for FCFG parsing) in GFCC files, and in the internal DataGFCC.GFCC structure. The parsing information format is still in flux. --- src/GF/Conversion/SimpleToFCFG.hs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/GF/Conversion/SimpleToFCFG.hs') diff --git a/src/GF/Conversion/SimpleToFCFG.hs b/src/GF/Conversion/SimpleToFCFG.hs index 081a2485d..1c5901fcf 100644 --- a/src/GF/Conversion/SimpleToFCFG.hs +++ b/src/GF/Conversion/SimpleToFCFG.hs @@ -13,7 +13,7 @@ module GF.Conversion.SimpleToFCFG - (convertGrammar) where + (convertConcrete) where import GF.Infra.PrintClass @@ -39,19 +39,14 @@ import Data.Maybe ---------------------------------------------------------------------- -- main conversion function -convertGrammar :: GFCC -> [(CId,FGrammar)] -convertGrammar gfcc = - [(cncname,convert abs_defs conc cats) - | cncname <- cncnames gfcc, - cnc <- Map.lookup cncname (concretes gfcc), - let conc = Map.union (opers cnc) (lins cnc) -- "union big+small most efficient" +convertConcrete :: Abstr -> Concr -> FGrammar +convertConcrete abs cnc = convert abs_defs conc cats + where abs_defs = Map.assocs (funs abs) + conc = Map.union (opers cnc) (lins cnc) -- "union big+small most efficient" cats = lincats cnc - ] - where - abs_defs = Map.assocs (funs (abstract gfcc)) - convert :: [(CId,(Type,Exp))] -> TermMap -> TermMap -> FGrammar - convert abs_defs cnc_defs cat_defs = getFGrammar (loop frulesEnv) +convert :: [(CId,(Type,Exp))] -> TermMap -> TermMap -> FGrammar +convert abs_defs cnc_defs cat_defs = getFGrammar (loop frulesEnv) where srules = [ (XRule id args res (map findLinType args) (findLinType res) term) | -- cgit v1.2.3