summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GF/CF/ChartParser.hs28
-rw-r--r--src/GF/CFGM/PrintCFGrammar.hs16
-rw-r--r--src/GF/Compile/ShellState.hs6
-rw-r--r--src/GF/Speech/PrGSL.hs12
-rw-r--r--src/GF/Speech/PrJSGF.hs12
-rw-r--r--src/GF/Speech/SRG.hs12
-rw-r--r--src/GF/Speech/TransformCFG.hs12
-rw-r--r--src/GF/UseGrammar/Custom.hs12
-rw-r--r--src/GF/UseGrammar/Parsing.hs6
9 files changed, 59 insertions, 57 deletions
diff --git a/src/GF/CF/ChartParser.hs b/src/GF/CF/ChartParser.hs
index 71b25730c..793ce8b40 100644
--- a/src/GF/CF/ChartParser.hs
+++ b/src/GF/CF/ChartParser.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/02/18 19:21:07 $
+-- > CVS $Date: 2005/03/21 13:54:24 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.5 $
+-- > CVS $Revision: 1.6 $
--
-- Bottom-up Kilbury chart parser from "Pure Functional Parsing", chapter 5.
-- OBSOLETE -- should use new MCFG parsers instead
@@ -15,9 +15,9 @@
module ChartParser (chartParser) where
-import Tracing
-import PrintParser
-import PrintSimplifiedTerm
+-- import Tracing
+-- import PrintParser
+-- import PrintSimplifiedTerm
import Operations
import CF
@@ -117,11 +117,11 @@ chartParser0 (productions, terminal) = cparse
| otherwise = [cats]
cparse :: Category -> [Token] -> ([ParseTree], String)
- cparse start input = trace "ChartParser" $
+ cparse start input = -- trace "ChartParser" $
case lookup (0, length input, start) $
- tracePrt "#edgeTrees" (prt . map (length.snd)) $
+ -- tracePrt "#edgeTrees" (prt . map (length.snd)) $
edgeTrees of
- Just trees -> tracePrt "#trees" (prt . length . fst) $
+ Just trees -> -- tracePrt "#trees" (prt . length . fst) $
(trees, "Chart:" ++++ prChart passiveEdges)
Nothing -> ([], "Chart:" ++++ prChart passiveEdges)
where
@@ -136,7 +136,7 @@ chartParser0 (productions, terminal) = cparse
(i, b, a:bs) <- elems state ]
initialChart :: Chart
- initialChart = tracePrt "#initialChart" (prt . map (length.elems)) $
+ initialChart = -- tracePrt "#initialChart" (prt . map (length.elems)) $
emptySet : map initialState (zip [0..] input)
where initialState (j, sym) = makeSet [ (j, cat, []) |
(cat, _) <- terminal sym ]
@@ -151,12 +151,12 @@ chartParser0 (productions, terminal) = cparse
a `elemSet` emptyCats ]
passiveEdges :: [Passive]
- passiveEdges = tracePrt "#passiveEdges" (prt . length) $
+ passiveEdges = -- tracePrt "#passiveEdges" (prt . length) $
[ (i, j, cat) |
(j, state) <- zip [0..] $
- tracePrt "#passiveChart"
- (prt . map (length.filter (\(_,_,x)->null x).elems)) $
- tracePrt "#activeChart" (prt . map (length.elems)) $
+ -- tracePrt "#passiveChart"
+ -- (prt . map (length.filter (\(_,_,x)->null x).elems)) $
+ -- tracePrt "#activeChart" (prt . map (length.elems)) $
finalChart,
(i, cat, []) <- elems state ]
++
@@ -190,9 +190,11 @@ chartParser0 (productions, terminal) = cparse
tree <- trees ]
+{-
instance Print ParseTree where
prt (Node name cat trees) = prt name++"."++prt cat++"^{"++prtSep "," trees++"}"
prt (Leaf token) = prt token
+-}
-- AR 10/12/2002
diff --git a/src/GF/CFGM/PrintCFGrammar.hs b/src/GF/CFGM/PrintCFGrammar.hs
index cc61fcfab..6178139e2 100644
--- a/src/GF/CFGM/PrintCFGrammar.hs
+++ b/src/GF/CFGM/PrintCFGrammar.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:10 $
+-- > CVS $Date: 2005/03/21 13:54:24 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.8 $
+-- > CVS $Revision: 1.9 $
--
-- Handles printing a CFGrammar in CFGM format.
-----------------------------------------------------------------------------
@@ -19,13 +19,13 @@ import qualified PrintCFG
import Ident
import GFC
import Modules
-import qualified ConvertGrammar as Cnv
-import qualified PrintParser as Prt
-import qualified CFGrammar
-import qualified GrammarTypes as GT
+import qualified GF.Conversion.ConvertGrammar as Cnv
+import qualified GF.Parsing.PrintParser as Prt
+import qualified GF.Conversion.CFGrammar as CFGrammar
+import qualified GF.Conversion.GrammarTypes as GT
import qualified AbsCFG
-import qualified Parser
-import qualified PrintParser
+import qualified GF.Parsing.Parser as Parser
+import qualified GF.Parsing.PrintParser as PrintParser
import ErrM
import qualified Option
diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs
index b5975af8d..50625c15f 100644
--- a/src/GF/Compile/ShellState.hs
+++ b/src/GF/Compile/ShellState.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:10 $
+-- > CVS $Date: 2005/03/21 13:54:24 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.38 $
+-- > CVS $Revision: 1.39 $
--
-- (Description of the module)
-----------------------------------------------------------------------------
@@ -36,7 +36,7 @@ import Arch (ModTime)
-- peb 25/5-04
-- import CFtoCFG
-import qualified ConvertGrammar as Cnv
+import qualified GF.Conversion.ConvertGrammar as Cnv
import List (nub,nubBy)
diff --git a/src/GF/Speech/PrGSL.hs b/src/GF/Speech/PrGSL.hs
index ce55960ee..f69bd0956 100644
--- a/src/GF/Speech/PrGSL.hs
+++ b/src/GF/Speech/PrGSL.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:10 $
+-- > CVS $Date: 2005/03/21 13:54:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.11 $
+-- > CVS $Revision: 1.12 $
--
-- This module prints a CFG as a Nuance GSL 2.0 grammar.
--
@@ -19,10 +19,10 @@ module PrGSL (gslPrinter) where
import SRG
import Ident
-import CFGrammar
-import Parser (Symbol(..))
-import GrammarTypes
-import PrintParser
+import GF.Conversion.CFGrammar
+import GF.Parsing.Parser (Symbol(..))
+import GF.Conversion.GrammarTypes
+import GF.Parsing.PrintParser
import Option
import Data.Char (toUpper,toLower)
diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs
index a5b81cfea..b8f36fed1 100644
--- a/src/GF/Speech/PrJSGF.hs
+++ b/src/GF/Speech/PrJSGF.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:11 $
+-- > CVS $Date: 2005/03/21 13:54:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.5 $
+-- > CVS $Revision: 1.6 $
--
-- This module prints a CFG as a JSGF grammar.
--
@@ -21,10 +21,10 @@ module PrJSGF (jsgfPrinter) where
import SRG
import Ident
-import CFGrammar
-import Parser (Symbol(..))
-import GrammarTypes
-import PrintParser
+import GF.Conversion.CFGrammar
+import GF.Parsing.Parser (Symbol(..))
+import GF.Conversion.GrammarTypes
+import GF.Parsing.PrintParser
import Option
jsgfPrinter :: Ident -- ^ Grammar name
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index cf474f6a1..ad2239202 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:11 $
+-- > CVS $Date: 2005/03/21 13:54:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.7 $
+-- > CVS $Revision: 1.8 $
--
-- Representation of, conversion to, and utilities for
-- printing of a general Speech Recognition Grammar.
@@ -21,10 +21,10 @@
module SRG where
import Ident
-import CFGrammar
-import Parser (Symbol(..))
-import GrammarTypes
-import PrintParser
+import GF.Conversion.CFGrammar
+import GF.Parsing.Parser (Symbol(..))
+import GF.Conversion.GrammarTypes
+import GF.Parsing.PrintParser
import TransformCFG
import Option
diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs
index 560687faf..ff804da11 100644
--- a/src/GF/Speech/TransformCFG.hs
+++ b/src/GF/Speech/TransformCFG.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/18 10:17:11 $
+-- > CVS $Date: 2005/03/21 13:54:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.5 $
+-- > CVS $Revision: 1.6 $
--
-- This module does some useful transformations on CFGs.
--
@@ -17,10 +17,10 @@
module TransformCFG (makeNice, CFRule_) where
import Ident
-import CFGrammar
-import Parser (Symbol(..))
-import GrammarTypes
-import PrintParser
+import GF.Conversion.CFGrammar
+import GF.Parsing.Parser (Symbol(..))
+import GF.Conversion.GrammarTypes
+import GF.Parsing.PrintParser
import Data.FiniteMap
import Data.List
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs
index 7a5ce63e6..c9eac9c11 100644
--- a/src/GF/UseGrammar/Custom.hs
+++ b/src/GF/UseGrammar/Custom.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/02 14:25:45 $
--- > CVS $Author: aarne $
--- > CVS $Revision: 1.44 $
+-- > CVS $Date: 2005/03/21 13:54:44 $
+-- > CVS $Author: peb $
+-- > CVS $Revision: 1.45 $
--
-- A database for customizable GF shell commands.
--
@@ -66,15 +66,15 @@ import GrammarToHaskell
-- the cf parsing algorithms
import ChartParser -- or some other CF Parser
-import qualified ParseCF as PCF
+import qualified GF.Parsing.ParseCF as PCF
--import qualified ParseGFCviaCFG as PGFC
--import NewChartParser
--import NewerChartParser
-- grammar conversions -- peb 19/4-04
-- see also customGrammarPrinter
-import qualified ConvertGrammar as Cnv
-import qualified PrintParser as Prt
+import qualified GF.Conversion.ConvertGrammar as Cnv
+import qualified GF.Parsing.PrintParser as Prt
import GFC
import qualified MkGFC as MC
diff --git a/src/GF/UseGrammar/Parsing.hs b/src/GF/UseGrammar/Parsing.hs
index 4ed16b7d4..5c24e4566 100644
--- a/src/GF/UseGrammar/Parsing.hs
+++ b/src/GF/UseGrammar/Parsing.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/02/24 11:46:39 $
+-- > CVS $Date: 2005/03/21 13:54:45 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.14 $
+-- > CVS $Revision: 1.15 $
--
-- (Description of the module)
-----------------------------------------------------------------------------
@@ -35,7 +35,7 @@ import Custom
import ShellState
import PPrCF (prCFTree)
-import qualified ParseGFC as N
+import qualified GF.Parsing.ParseGFC as N
import Operations