diff options
| author | peb <unknown> | 2005-04-16 04:40:48 +0000 |
|---|---|---|
| committer | peb <unknown> | 2005-04-16 04:40:48 +0000 |
| commit | 9e510f5245ac8ee1a7524fbbf49447daaef846d3 (patch) | |
| tree | 1a4f923fa1a4247146d7d0b4caf56021fc0f70a6 /src/GF/Parsing/CFG | |
| parent | 9d112935dc072c399ae86be4fa9cc273b479928e (diff) | |
"Committed_by_peb"
Diffstat (limited to 'src/GF/Parsing/CFG')
| -rw-r--r-- | src/GF/Parsing/CFG/General.hs | 9 | ||||
| -rw-r--r-- | src/GF/Parsing/CFG/Incremental.hs | 7 | ||||
| -rw-r--r-- | src/GF/Parsing/CFG/PInfo.hs | 14 |
3 files changed, 17 insertions, 13 deletions
diff --git a/src/GF/Parsing/CFG/General.hs b/src/GF/Parsing/CFG/General.hs index ea67ec94f..33e0b9232 100644 --- a/src/GF/Parsing/CFG/General.hs +++ b/src/GF/Parsing/CFG/General.hs @@ -4,9 +4,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/11 13:52:51 $ +-- > CVS $Date: 2005/04/16 05:40:49 $ -- > CVS $Author: peb $ --- > CVS $Revision: 1.1 $ +-- > CVS $Revision: 1.2 $ -- -- CFG parsing with a general chart ----------------------------------------------------------------------------- @@ -24,12 +24,13 @@ import GF.NewParsing.GeneralChart import GF.Data.Assoc import Monad ---parse :: (Ord n, Ord c, Ord t) => Strategy -> CFParser c n t +parse :: (Ord n, Ord c, Ord t) => Strategy -> CFParser c n t parse strategy grammar start = extract . tracePrt "#internal chart" (prt . length . chartList) . process strategy grammar start -type Strategy = (Bool, Bool) -- ^ (isBottomup, isTopdown) +-- | parsing strategy: (isBottomup, isTopdown) +type Strategy = (Bool, Bool) extract :: (Ord n, Ord c, Ord t) => IChart n (Symbol c t) -> CFChart c n t diff --git a/src/GF/Parsing/CFG/Incremental.hs b/src/GF/Parsing/CFG/Incremental.hs index af0f79bf0..e934b48c5 100644 --- a/src/GF/Parsing/CFG/Incremental.hs +++ b/src/GF/Parsing/CFG/Incremental.hs @@ -4,9 +4,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/11 13:52:51 $ +-- > CVS $Date: 2005/04/16 05:40:49 $ -- > CVS $Author: peb $ --- > CVS $Revision: 1.1 $ +-- > CVS $Revision: 1.2 $ -- -- Incremental chart parsing for CFG ----------------------------------------------------------------------------- @@ -29,7 +29,8 @@ import GF.NewParsing.CFG.PInfo import GF.NewParsing.IncrementalChart -type Strategy = ((Bool, Bool), (Bool, Bool)) -- ^ (predict:(BU, TD), filter:(BU, TD)) +-- | parsing strategy: (predict:(BU, TD), filter:(BU, TD)) +type Strategy = ((Bool, Bool), (Bool, Bool)) parse :: (Ord n, Ord c, Ord t) => Strategy -> CFParser c n t parse strategy grammar start = extract . diff --git a/src/GF/Parsing/CFG/PInfo.hs b/src/GF/Parsing/CFG/PInfo.hs index eff0767c1..63c506e19 100644 --- a/src/GF/Parsing/CFG/PInfo.hs +++ b/src/GF/Parsing/CFG/PInfo.hs @@ -4,14 +4,15 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/11 13:52:52 $ +-- > CVS $Date: 2005/04/16 05:40:49 $ -- > CVS $Author: peb $ --- > CVS $Revision: 1.1 $ +-- > CVS $Revision: 1.2 $ -- -- CFG parsing, parser information ----------------------------------------------------------------------------- -module GF.NewParsing.CFG.PInfo where +module GF.NewParsing.CFG.PInfo + (CFParser, CFPInfo(..), buildCFPInfo) where import GF.System.Tracing import GF.Infra.Print @@ -24,9 +25,10 @@ import GF.Data.Assoc ---------------------------------------------------------------------- -- type declarations +-- | the list of categories = possible starting categories type CFParser c n t = CFPInfo c n t - -> [c] -- ^ possible starting categories - -> Input t -- ^ the input tokens + -> [c] + -> Input t -> CFChart c n t ------------------------------------------------------------ @@ -45,7 +47,7 @@ data CFPInfo c n t -- ^ DOES NOT WORK WITH EMPTY RULES!!! } ---buildCFPInfo :: (Ord n, Ord c, Ord t) => CFGrammar c n t -> CFPInfo c n t +buildCFPInfo :: (Ord n, Ord c, Ord t) => CFGrammar c n t -> CFPInfo c n t -- this is not permanent... buildCFPInfo grammar = traceCalcFirst grammar $ |
