summaryrefslogtreecommitdiff
path: root/src/GF/UseGrammar/Custom.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-11-10 07:55:45 +0000
committeraarne <unknown>2003-11-10 07:55:45 +0000
commit249d506f58a8b5f8ef87295ab3dde2d13ddd3885 (patch)
tree658679a324c4f360901c38637464e8f63b59515d /src/GF/UseGrammar/Custom.hs
parent4c99687f217ce258f821d55e68f5403233f6dea7 (diff)
Morphological analysis and glueing.
Diffstat (limited to 'src/GF/UseGrammar/Custom.hs')
-rw-r--r--src/GF/UseGrammar/Custom.hs18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs
index 1048aab95..4d5eb8122 100644
--- a/src/GF/UseGrammar/Custom.hs
+++ b/src/GF/UseGrammar/Custom.hs
@@ -21,11 +21,13 @@ import CFIdent
---- import CFtoGrammar
import PPrCF
+import PrLBNF
import PrGrammar
+import MkGFC
import Zipper
-----import Morphology
+import Morphology
-----import GrammarToHaskell
-----import GrammarToCanon (showCanon, showCanonOpt)
-----import qualified GrammarToGFC as GFC
@@ -141,16 +143,16 @@ customGrammarParser =
customGrammarPrinter =
customData "Grammar printers, selected by option -printer=x" $
[
----- (strCI "gf", prt) -- DEFAULT
- (strCI "cf", prCF . stateCF)
-
+ (strCI "gfc", prCanon . stateGrammarST) -- DEFAULT
+ ,(strCI "cf", prCF . stateCF)
+ ,(strCI "lbnf", prLBNF . stateCF)
+ ,(strCI "morpho", prMorpho . stateMorpho)
+ ,(strCI "opts", prOpts . stateOptions)
{- ----
(strCI "gf", prt . st2grammar . stateGrammarST) -- DEFAULT
,(strCI "canon", showCanon "Lang" . stateGrammarST)
,(strCI "gfc", GFC.showGFC . stateGrammarST)
,(strCI "canonOpt",showCanonOpt "Lang" . stateGrammarST)
- ,(strCI "morpho", prMorpho . stateMorpho)
- ,(strCI "opts", prOpts . stateOptions)
-}
-- add your own grammar printers here
--- also include printing via grammar2syntax!
@@ -236,6 +238,7 @@ customTokenizer =
,(strCI "chars", const $ map (tS . singleton))
,(strCI "code", const $ lexHaskell)
,(strCI "text", const $ lexText)
+ ,(strCI "unglue", \gr -> map tS . decomposeWords (stateMorpho gr))
---- ,(strCI "codelit", lexHaskellLiteral . stateIsWord)
---- ,(strCI "textlit", lexTextLiteral . stateIsWord)
,(strCI "codeC", const $ lexC2M)
@@ -253,7 +256,8 @@ customUntokenizer =
,(strCI "textlit", const $ formatAsTextLit)
,(strCI "codelit", const $ formatAsCodeLit)
,(strCI "concat", const $ concat . words)
- ,(strCI "bind", const $ performBinds)
+ ,(strCI "glue", const $ performBinds)
+ ,(strCI "bind", const $ performBinds) -- backward compat
-- add your own untokenizers here
]
++ moreCustomUntokenizer