Changeset 14379 in project


Ignore:
Timestamp:
04/23/09 03:27:41 (11 years ago)
Author:
Ivan Raikov
Message:

format-graph ported to Chicken 4

Location:
release/4/format-graph/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • release/4/format-graph/trunk/format-graph-eggdoc.scm

    r11485 r14379  
    88     (description "Output graph nodes and edges in different formats.")
    99
    10      (author (url "http://chicken.wiki.br/ivan raikov" "Ivan Raikov"))
     10     (author (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov"))
    1111
    1212     (history
     13      (version "1.7" "Ported to Chicken 4")
    1314      (version "1.6" "Somes updates to the .setup and .meta files")
    1415      (version "1.5" "Fixed a bug in printing the title of a VCG graph")
  • release/4/format-graph/trunk/format-graph.meta

    r11484 r14379  
    55 ; List here all the files that should be bundled as part of your egg. 
    66
    7  (files "format-graph.scm" "format-graph-eggdoc.scm" "format-graph.setup" "tests/run.scm")
     7 (files "format-graph.scm" "format-graph-eggdoc.scm" "format-graph.setup" "tests")
    88
    99 ; Your egg's license:
     
    1818 ; A list of eggs format-graph depends on.
    1919
    20  (needs eggdoc)
     20 (needs eggdoc matchable)
    2121
    2222 (eggdoc "format-graph-eggdoc.scm")
  • release/4/format-graph/trunk/format-graph.scm

    r6814 r14379  
    22;; Prints a graph in various formats.
    33;;
    4 ;; Copyright 2007 Ivan Raikov
     4;; Copyright 2007-2009 Ivan Raikov.
    55;;
    66;;
     
    1919;;
    2020
    21 (require-extension srfi-13)
     21(module format-graph
    2222
    23 (define-extension format-graph)
     23 (make-format-graph
     24  graph->sexp)
     25                   
     26 (import scheme chicken data-structures )
    2427
    25 (declare (export graph->sexp  make-format-graph))
     28 (require-extension srfi-1 srfi-13 matchable)
     29
    2630
    2731(define (graph->sexp g)
     
    182186            ((g 'edges)))
    183187  (display "\n}\n" out))
    184  
     188)
  • release/4/format-graph/trunk/format-graph.setup

    r11484 r14379  
    1 ;; -*- Hen -*-
    2 
    3 (define has-exports? (string>=? (chicken-version) "2.310"))
     1;;;; -*- Hen -*-
    42
    53(define (dynld-name fn)         
    64  (make-pathname #f fn ##sys#load-dynamic-extension))   
    75
    8 (compile -O2 -d0 -s
    9          ,@(if has-exports? '(-check-imports -emit-exports format-graph.exports) '())
    10          format-graph.scm -lchicken -ldl -lm)
     6(compile -O2 -d0 -s format-graph.scm -j format-graph)
     7(compile -O2 -d0 -s format-graph.import.scm)
    118
    12 (run (csi -qbs format-graph-eggdoc.scm > format-graph.html))
     9(run (csi -s format-graph-eggdoc.scm > format-graph.html))
    1310
    1411(install-extension
     
    1815
    1916  ; Files to install for your extension:
    20   `(,(dynld-name "format-graph")
    21     ,@(if has-exports? '("format-graph.exports") (list)) )
     17  `(,(dynld-name "format-graph") ,(dynld-name "format-graph.import") )
    2218
    2319  ; Assoc list with properties for your extension:
    24   `((version 1.5)
     20  `((version 1.7)
    2521    (documentation "format-graph.html")
    26     ,@(if has-exports? `((exports "format-graph.exports")) (list)) ))
     22    ))
     23
  • release/4/format-graph/trunk/tests/run.scm

    r7357 r14379  
    1 (require-extension srfi-1)
    2 (require-extension digraph)
    3 (require-extension format-graph)
    41
    5 (define used-by
     2(require-library srfi-1 matchable digraph format-graph test)
     3(import srfi-1 matchable digraph format-graph test)
     4
     5(define used-by
    66  (list
    77    (cons 'dax_h 'foo_cpp) (cons 'dax_h 'bar_cpp) (cons 'dax_h 'yow_h)
     
    1616(define g (make-digraph 'depgraph "dependency graph"))
    1717
    18 (define node-list (delete-duplicates
    19                    (concatenate (list (map first used-by) (map second used-by)))))
     18(define node-list
     19  (delete-duplicates
     20   (concatenate (list (map car used-by) (map cdr used-by)))))
    2021           
    2122(define node-ids (list-tabulate (length node-list) values))
Note: See TracChangeset for help on using the changeset viewer.