diff options
| author | krasimir <krasimir@chalmers.se> | 2016-03-22 10:28:15 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2016-03-22 10:28:15 +0000 |
| commit | ce7072085947f4981c8d6d49b571e3cf5683fbb6 (patch) | |
| tree | a55cda99032e48c6f251a082f0e157bac5a71b27 /src/compiler/GF/Speech/PGFToCFG.hs | |
| parent | fbdf21d8626c0c0d8fc5cd45b373afe98c9e8f38 (diff) | |
CFGtoPGF is now extended to support context-free grammars with primitive parameters
Diffstat (limited to 'src/compiler/GF/Speech/PGFToCFG.hs')
| -rw-r--r-- | src/compiler/GF/Speech/PGFToCFG.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Speech/PGFToCFG.hs b/src/compiler/GF/Speech/PGFToCFG.hs index 49c679aea..8cb01f3a9 100644 --- a/src/compiler/GF/Speech/PGFToCFG.hs +++ b/src/compiler/GF/Speech/PGFToCFG.hs @@ -64,17 +64,17 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co extCats :: Set Cat - extCats = Set.fromList $ map lhsCat startRules + extCats = Set.fromList $ map ruleLhs startRules startRules :: [CFRule] - startRules = [CFRule (showCId c) [NonTerminal (fcatToCat fc r)] (CFRes 0) + startRules = [Rule (showCId c) [NonTerminal (fcatToCat fc r)] (CFRes 0) | (c,CncCat s e lbls) <- Map.toList (cnccats cnc), fc <- range (s,e), not (isPredefFId fc), r <- [0..catLinArity fc-1]] ruleToCFRule :: (FId,Production) -> [CFRule] ruleToCFRule (c,PApply funid args) = - [CFRule (fcatToCat c l) (mkRhs row) (profilesToTerm [fixProfile row n | n <- [0..length args-1]]) + [Rule (fcatToCat c l) (mkRhs row) (profilesToTerm [fixProfile row n | n <- [0..length args-1]]) | (l,seqid) <- Array.assocs rhs , let row = sequences cnc ! seqid , not (containsLiterals row)] @@ -119,5 +119,5 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co profileToTerm t [] = CFMeta t profileToTerm _ xs = CFRes (last xs) -- FIXME: unify ruleToCFRule (c,PCoerce c') = - [CFRule (fcatToCat c l) [NonTerminal (fcatToCat c' l)] (CFRes 0) + [Rule (fcatToCat c l) [NonTerminal (fcatToCat c' l)] (CFRes 0) | l <- [0..catLinArity c-1]] |
