blob: cebe4ef2891adb3909b24f6d04370e799b0ab0fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 ----
|