summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-11-03 22:37:18 +0000
committeraarne <aarne@cs.chalmers.se>2007-11-03 22:37:18 +0000
commitfdc39cf18c3cb8be2c142bef4a1bf80432a0cb3d (patch)
tree14ea273559aafb43998a2c6cb51b4971da729168 /src
parent5956ba6b38f56c4aa41f7216f7dabade368bb2f2 (diff)
started command interpreter for gfcc
Diffstat (limited to 'src')
-rw-r--r--src/GF/Command/Interpreter.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/GF/Command/Interpreter.hs b/src/GF/Command/Interpreter.hs
new file mode 100644
index 000000000..cebe4ef28
--- /dev/null
+++ b/src/GF/Command/Interpreter.hs
@@ -0,0 +1,26 @@
+module GF.Command.Interpreter where
+
+import GF.Command.AbsGFShell
+import GF.Command.ParGFShell
+import GF.GFCC.API
+
+import GF.Command.ErrM
+
+
+interpretCommandLine :: MultiGrammar -> CommandLine -> IO ()
+interpretCommandLine gr line = case line of
+ CEmpty -> return ()
+ CLine pipes -> mapM_ interPipe pipes
+ where
+ interPipe (PComm cs) = do
+ ts <- intercs [] cs
+ mapM_ (putStrLn . showTree) ts
+ intercs trees [] = return trees
+ intercs trees (c:cs) = do
+ trees2 <- interc trees c
+ intercs trees2 cs
+ interc = interpret gr
+
+interpret :: MultiGrammar -> [Tree] -> Command -> IO [Tree]
+interpret gr trees comm = case (trees,command comm) of
+ _ -> return trees ----