option -mac to vt command (uses open with ps)

This commit is contained in:
aarne
2008-03-06 21:27:14 +00:00
parent 9779c35b8e
commit 71d3221e12
7 changed files with 32 additions and 15 deletions

View File

@@ -365,9 +365,10 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
CShowTreeGraph | oElem emitCode opts -> do -- -o
returnArg (AString $ visualizeTrees opts $ strees $ s2t a) sa
CShowTreeGraph -> do
let gv = if oElem (iOpt "mac") opts then "open" else "gv" ---- config!
let g0 = writeFile "grphtmp.dot" $ visualizeTrees opts $ strees $ s2t a
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"
g2 = system "gv grphtmp.ps &"
g2 = system (gv +++ "grphtmp.ps &")
g3 = return () ---- system "rm -f grphtmp.*"
justOutput opts (g0 >> g1 >> g2 >> g3 >> return ()) sa
@@ -453,9 +454,10 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
returnArg (AString (optPrintMultiGrammar opts cgr')) sa
CShowGrammarGraph -> do
---- sa' <- changeState purgeShellState sa
let gv = if oElem (iOpt "mac") opts then "open" else "gv" ---- config!
let g0 = writeFile "grphtmp.dot" $ visualizeCanonGrammar opts cgr
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"
g2 = system "gv grphtmp.ps &"
g2 = system (gv +++ "grphtmp.ps &")
g3 = return () ---- system "rm -f grphtmp.*"
justOutput opts (g0 >> g1 >> g2 >> g3 >> return ()) sa
CPrintSourceGrammar ->