From 249d506f58a8b5f8ef87295ab3dde2d13ddd3885 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 10 Nov 2003 07:55:45 +0000 Subject: Morphological analysis and glueing. --- src/GF/UseGrammar/Custom.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/GF/UseGrammar/Custom.hs') 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 -- cgit v1.2.3