diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | ccwl/graphviz.scm | 21 | ||||
-rwxr-xr-x | scripts/ccwl.in | 6 |
3 files changed, 15 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am index 083830a..8125079 100644 --- a/Makefile.am +++ b/Makefile.am @@ -130,7 +130,7 @@ doc/hello.tar.out: doc/hello.tar # Print out graph for graphviz's dot. %.dot: %.scm - $(CCWL_GEN)$(builddir)/pre-inst-env ccwl compile --to=graphviz $< > $@ + $(CCWL_GEN)$(builddir)/pre-inst-env ccwl compile --to=dot $< > $@ %.png: %.dot $(DOT_GEN)$(DOT) -Tpng -o$@ $< diff --git a/ccwl/graphviz.scm b/ccwl/graphviz.scm index 17650cf..7093bdb 100644 --- a/ccwl/graphviz.scm +++ b/ccwl/graphviz.scm @@ -19,7 +19,7 @@ ;;; Commentary: ;; This file implements conversion from ccwl objects (<workflow>, -;; <command>, <input>, <output>, <step>) to graphviz. +;; <command>, <input>, <output>, <step>) to the graphviz dot language. ;;; Code: @@ -31,13 +31,13 @@ #:use-module (ice-9 match) #:use-module (ccwl ccwl) #:use-module (ccwl utils) - #:export (workflow->graphviz)) + #:export (workflow->dot)) -(define (workflow->graphviz workflow port) - "Render WORKFLOW, a <workflow> object, to PORT in the graphviz +(define (workflow->dot workflow port) + "Render WORKFLOW, a <workflow> object, to PORT in the graphviz dot language." - (graph->graphviz (workflow->graph workflow) - port)) + (graph->dot (workflow->graph workflow) + port)) (define-immutable-record-type <graph> (make-graph name properties nodes edges subgraphs) @@ -113,7 +113,7 @@ language." (workflow-outputs workflow)))))) (define (escape-id id) - "Escape string ID if necessary according to graphviz syntax." + "Escape string ID if necessary according to graphviz dot syntax." (let ((id (if (symbol? id) (symbol->string id) id))) @@ -125,8 +125,9 @@ language." (call-with-output-string (cut write id <>))))) -(define* (graph->graphviz graph #:optional (port (current-output-port)) (level 0)) - "Render GRAPH, a <graph> object, in graphviz syntax to PORT." +(define* (graph->dot graph #:optional (port (current-output-port)) (level 0)) + "Render GRAPH, a <graph> object, in the graphviz dot syntax to +PORT." (indent-level port level) (display (format "~a ~a {~%" (if (zero? level) "digraph" "subgraph") @@ -159,7 +160,7 @@ language." port))) (graph-edges graph)) (for-each (lambda (subgraph) - (graph->graphviz subgraph port (1+ level))) + (graph->dot subgraph port (1+ level))) (graph-subgraphs graph)) (indent-level port level) (display (format "}~%") port)) diff --git a/scripts/ccwl.in b/scripts/ccwl.in index 300bc34..5fb7877 100755 --- a/scripts/ccwl.in +++ b/scripts/ccwl.in @@ -49,7 +49,7 @@ (let* ((args (args-fold args (list (option (list #\t "to") #t #f (lambda (opt name arg result) - (let ((supported (list "cwl" "graphviz"))) + (let ((supported (list "cwl" "dot"))) (unless (member arg supported) (scm-error 'misc-error #f @@ -72,7 +72,7 @@ Compile SOURCE-FILE. -t, --to=TARGET compile SOURCE-FILE to TARGET language; - Supported targets are cwl (default) and graphviz. + Supported targets are cwl (default) and dot. " program) @@ -84,7 +84,7 @@ Compile SOURCE-FILE. (let ((to (assq-ref args 'to))) ((cond ((string=? to "cwl") workflow->cwl) - ((string=? to "graphviz") workflow->graphviz)) + ((string=? to "dot") workflow->dot)) (load (canonicalize-path (assq-ref args 'source-file))) (current-output-port))))) ((program args ...) |