diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:54:35 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:54:35 +0000 |
| commit | e9e80fc389365e24d4300d7d5390c7d833a96c50 (patch) | |
| tree | f0b58473adaa670bd8fc52ada419d8cad470ee03 /src/PGF/Parsing/FCFG.hs | |
| parent | b96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff) | |
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'src/PGF/Parsing/FCFG.hs')
| -rw-r--r-- | src/PGF/Parsing/FCFG.hs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/PGF/Parsing/FCFG.hs b/src/PGF/Parsing/FCFG.hs new file mode 100644 index 000000000..4ca6a956a --- /dev/null +++ b/src/PGF/Parsing/FCFG.hs @@ -0,0 +1,40 @@ +---------------------------------------------------------------------- +-- | +-- Maintainer : Krasimir Angelov +-- Stability : (stable) +-- Portability : (portable) +-- +-- FCFG parsing +----------------------------------------------------------------------------- + +module PGF.Parsing.FCFG + (buildParserInfo,ParserInfo,parseFCFG) where + +import GF.Data.ErrM +import GF.Data.Assoc +import GF.Data.SortedList + +import PGF.CId +import PGF.Data +import PGF.Macros +import PGF.BuildParser +import PGF.Parsing.FCFG.Utilities +import qualified PGF.Parsing.FCFG.Active as Active +import qualified PGF.Parsing.FCFG.Incremental as Incremental + +import qualified Data.Map as Map + +---------------------------------------------------------------------- +-- parsing + +-- main parsing function + +parseFCFG :: String -- ^ parsing strategy + -> ParserInfo -- ^ compiled grammar (fcfg) + -> CId -- ^ starting category + -> [String] -- ^ input tokens + -> Err [Tree] -- ^ resulting GF terms +parseFCFG "bottomup" pinfo start toks = return $ Active.parse "b" pinfo start toks +parseFCFG "topdown" pinfo start toks = return $ Active.parse "t" pinfo start toks +parseFCFG "incremental" pinfo start toks = return $ Incremental.parse pinfo start toks +parseFCFG strat pinfo start toks = fail $ "FCFG parsing strategy not defined: " ++ strat |
