diff options
| author | bringert <bringert@cs.chalmers.se> | 2008-01-03 17:10:05 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2008-01-03 17:10:05 +0000 |
| commit | af1a3a2473747942dcec647a42e5724fcb21d1b9 (patch) | |
| tree | e08020dce28ad35a5434328e6483ec695693fc20 /src/GF/Conversion/SimpleToFCFG.hs | |
| parent | 43ddb41d314e7d547fa8f8bb1cd23397dfa30f65 (diff) | |
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.
Diffstat (limited to 'src/GF/Conversion/SimpleToFCFG.hs')
| -rw-r--r-- | src/GF/Conversion/SimpleToFCFG.hs | 19 |
1 files changed, 7 insertions, 12 deletions
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) | |
