mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-13 14:59:32 -06:00
command vg
This commit is contained in:
@@ -30,6 +30,7 @@ import GetTree
|
||||
|
||||
import ShellCommands
|
||||
|
||||
import VisualizeGrammar (visualizeCanonGrammar, visualizeSourceGrammar)
|
||||
import API
|
||||
import IOGrammar
|
||||
import Compile
|
||||
@@ -244,6 +245,13 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
|
||||
CPrintMultiGrammar -> do
|
||||
sa' <- changeState purgeShellState 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 ->
|
||||
returnArg (AString (visualizeSourceGrammar src)) sa
|
||||
|
||||
|
||||
@@ -129,7 +129,8 @@ pCommand ws = case ws of
|
||||
"pxs" : [] -> aUnit CPrintCanonXMLStruct
|
||||
"px" : [] -> aUnit CPrintCanonXML
|
||||
"pm" : [] -> aUnit CPrintMultiGrammar
|
||||
"sg" : [] -> aUnit CPrintSourceGrammar
|
||||
"vg" : [] -> aUnit CShowGrammarGraph
|
||||
"sg" : [] -> aUnit CPrintSourceGrammar
|
||||
"po" : [] -> aUnit CPrintGlobalOptions
|
||||
"pl" : [] -> aUnit CPrintLanguages
|
||||
"h" : c : [] -> aUnit $ CHelp (Just (abbrevCommand c))
|
||||
|
||||
@@ -73,6 +73,7 @@ data Command =
|
||||
| CPrintInformation I.Ident
|
||||
| CPrintMultiGrammar
|
||||
| CPrintSourceGrammar
|
||||
| CShowGrammarGraph
|
||||
| CPrintGramlet
|
||||
| CPrintCanonXML
|
||||
| CPrintCanonXMLStruct
|
||||
|
||||
Reference in New Issue
Block a user