blob: 3133e8758111ddac83ddc734165c1d88083caa6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
----------------------------------------------------------------------
-- |
-- Maintainer : PL
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/04/14 18:38:36 $
-- > CVS $Author: peb $
-- > CVS $Revision: 1.2 $
--
-- 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)
|