command vg

This commit is contained in:
aarne
2005-02-11 15:08:10 +00:00
parent a38ee961b5
commit eb1c336e48
5 changed files with 17 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ import GetTree
import ShellCommands import ShellCommands
import VisualizeGrammar (visualizeCanonGrammar, visualizeSourceGrammar)
import API import API
import IOGrammar import IOGrammar
import Compile import Compile
@@ -244,6 +245,13 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
CPrintMultiGrammar -> do CPrintMultiGrammar -> do
sa' <- changeState purgeShellState sa sa' <- changeState purgeShellState sa
returnArg (AString (optPrintMultiGrammar opts cgr)) sa' returnArg (AString (optPrintMultiGrammar opts cgr)) sa'
CShowGrammarGraph -> do
---- sa' <- changeState purgeShellState sa
let g0 = writeFile "grphtmp.dot" $ visualizeCanonGrammar cgr
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"
g2 = system "gv grphtmp.ps &"
g3 = return () ---- system "rm -f grphtmp.*"
justOutput opts (g0 >> g1 >> g2 >> g3 >> return ()) sa
CPrintSourceGrammar -> CPrintSourceGrammar ->
returnArg (AString (visualizeSourceGrammar src)) sa returnArg (AString (visualizeSourceGrammar src)) sa

View File

@@ -129,7 +129,8 @@ pCommand ws = case ws of
"pxs" : [] -> aUnit CPrintCanonXMLStruct "pxs" : [] -> aUnit CPrintCanonXMLStruct
"px" : [] -> aUnit CPrintCanonXML "px" : [] -> aUnit CPrintCanonXML
"pm" : [] -> aUnit CPrintMultiGrammar "pm" : [] -> aUnit CPrintMultiGrammar
"sg" : [] -> aUnit CPrintSourceGrammar "vg" : [] -> aUnit CShowGrammarGraph
"sg" : [] -> aUnit CPrintSourceGrammar
"po" : [] -> aUnit CPrintGlobalOptions "po" : [] -> aUnit CPrintGlobalOptions
"pl" : [] -> aUnit CPrintLanguages "pl" : [] -> aUnit CPrintLanguages
"h" : c : [] -> aUnit $ CHelp (Just (abbrevCommand c)) "h" : c : [] -> aUnit $ CHelp (Just (abbrevCommand c))

View File

@@ -73,6 +73,7 @@ data Command =
| CPrintInformation I.Ident | CPrintInformation I.Ident
| CPrintMultiGrammar | CPrintMultiGrammar
| CPrintSourceGrammar | CPrintSourceGrammar
| CShowGrammarGraph
| CPrintGramlet | CPrintGramlet
| CPrintCanonXML | CPrintCanonXML
| CPrintCanonXMLStruct | CPrintCanonXMLStruct

View File

@@ -87,6 +87,9 @@ pm, print_multigrammar: pm
pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm
pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps' pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'
vg, visualize_graph: vg
Show the dependency graph of multilingual grammar via dot and gv.
po, print_options: po po, print_options: po
Print what modules there are in the state. Also Print what modules there are in the state. Also
prints those flag values in the current state that differ from defaults. prints those flag values in the current state that differ from defaults.

View File

@@ -116,6 +116,9 @@ txtHelpFile =
"\n pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm" ++ "\n pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm" ++
"\n pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'" ++ "\n pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'" ++
"\n" ++ "\n" ++
"\nvg, visualize_graph: vg" ++
"\n Show the dependency graph of multilingual grammar via dot and gv." ++
"\n" ++
"\npo, print_options: po" ++ "\npo, print_options: po" ++
"\n Print what modules there are in the state. Also" ++ "\n Print what modules there are in the state. Also" ++
"\n prints those flag values in the current state that differ from defaults." ++ "\n prints those flag values in the current state that differ from defaults." ++