summaryrefslogtreecommitdiff
path: root/src/GF/Parsing/CFG.hs
diff options
context:
space:
mode:
authorpeb <unknown>2005-04-11 12:57:45 +0000
committerpeb <unknown>2005-04-11 12:57:45 +0000
commitac00f77dadd4d447803dd7cab5a36f47365325d0 (patch)
tree2fd02b19234f8d1fcc20ee67a2367d4d4eebfcd8 /src/GF/Parsing/CFG.hs
parentf6273f7033b85eea9a8d0cc7d31e9697ba95d5b7 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Parsing/CFG.hs')
-rw-r--r--src/GF/Parsing/CFG.hs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/GF/Parsing/CFG.hs b/src/GF/Parsing/CFG.hs
new file mode 100644
index 000000000..6af1de8ac
--- /dev/null
+++ b/src/GF/Parsing/CFG.hs
@@ -0,0 +1,44 @@
+----------------------------------------------------------------------
+-- |
+-- Maintainer : PL
+-- Stability : (stable)
+-- Portability : (portable)
+--
+-- > CVS $Date: 2005/04/11 13:52:51 $
+-- > CVS $Author: peb $
+-- > CVS $Revision: 1.1 $
+--
+-- CFG parsing
+-----------------------------------------------------------------------------
+
+module GF.NewParsing.CFG
+ (parseCF, module GF.NewParsing.CFG.PInfo) where
+
+import GF.Formalism.Utilities
+import GF.Formalism.CFG
+import GF.NewParsing.CFG.PInfo
+
+import qualified GF.NewParsing.CFG.Incremental as Inc
+import qualified GF.NewParsing.CFG.General as Gen
+
+----------------------------------------------------------------------
+-- parsing
+
+--parseCF :: (Ord n, Ord c, Ord t) => String -> CFParser c n t
+parseCF "gb" = Gen.parse bottomup
+parseCF "gt" = Gen.parse topdown
+parseCF "ib" = Inc.parse (bottomup, noFilter)
+parseCF "it" = Inc.parse (topdown, noFilter)
+parseCF "ibFT" = Inc.parse (bottomup, topdown)
+parseCF "ibFB" = Inc.parse (bottomup, bottomup)
+parseCF "ibFTB" = Inc.parse (bottomup, bothFilters)
+parseCF "itF" = Inc.parse (topdown, bottomup)
+-- default parser:
+parseCF _ = parseCF "gb"
+
+bottomup = (True, False)
+topdown = (False, True)
+noFilter = (False, False)
+bothFilters = (True, True)
+
+