command dg for showing source grammar dep graph restored

This commit is contained in:
aarne
2008-12-19 14:28:58 +00:00
parent f9e9c582f3
commit f7dfc6f1d7
2 changed files with 63 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import GF.Command.Abstract
import GF.Command.Parse
import GF.Data.ErrM
import GF.Grammar.API -- for cc command
import GF.Infra.Dependencies
import GF.Infra.UseIO
import GF.Infra.Option
import GF.System.Readline
@@ -101,6 +102,10 @@ loop opts gfenv0 = do
Ok x -> putStrLn $ enc (showTerm style x)
Bad s -> putStrLn $ enc s
loopNewCPU gfenv
"dg":ws -> do
writeFile "_gfdepgraph.dot" (depGraph sgr)
putStrLn "wrote graph in file _gfdepgraph.dot"
loopNewCPU gfenv
"i":args -> do
gfenv' <- case parseOptions args of
Ok (opts',files) ->