summaryrefslogtreecommitdiff
path: root/src/GF/API.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2005-11-25 17:40:51 +0000
committeraarne <aarne@cs.chalmers.se>2005-11-25 17:40:51 +0000
commitfe1fdf3afd7755f6b5d8282d85f53924c662bf90 (patch)
tree228842fe464f242a5a091b37b54287d6dfa7ed1a /src/GF/API.hs
parentdbe8e61acc616b8f5ac07e8df89eb98a7997c29d (diff)
questions and transfer in shell state
Diffstat (limited to 'src/GF/API.hs')
-rw-r--r--src/GF/API.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/GF/API.hs b/src/GF/API.hs
index 7f2d95770..ff199f589 100644
--- a/src/GF/API.hs
+++ b/src/GF/API.hs
@@ -63,6 +63,8 @@ import GF.UseGrammar.Editing
----import GrammarToMGrammar as M
+import qualified Transfer.InterpreterAPI as T
+
import GF.System.Arch (myStdGen)
import GF.Text.UTF8
@@ -356,6 +358,23 @@ wrapByFun opts gr f t =
t' = qualifTerm (absId gr) $ M.appCons f [tree2exp t]
g = grammar gr
+applyTransfer :: Options -> GFGrammar -> [(Ident,T.Env)] ->
+ (Maybe Ident,Ident) -> Tree -> Tree
+applyTransfer opts gr trs (mm,f) t =
+ err (const t) id $ annotate g t'
+ where
+ t' = qualifTerm (absId gr) $ trans tr f $ tree2exp t
+ g = grammar gr
+ tr = case mm of
+ Just m -> maybe empty id $ lookup m trs
+ _ -> ifNull empty (snd . head) trs
+
+ -- these are missing
+ trans = error "no transfer yet"
+ ----- core2exp . T.appTransfer tr . exp2core
+ empty = error "emptyEnv"
+ ---- T.emptyEnv
+
{-
optTransfer :: Options -> StateGrammar -> G.Term -> G.Term
optTransfer opts g = case getOptVal opts transferFun of