Changeset 11784 in project


Ignore:
Timestamp:
08/27/08 22:00:24 (11 years ago)
Author:
sjamaan
Message:

Port sxml-transforms to Chicken 4

Location:
release/4/sxml-transforms
Files:
106 added
2 edited
5 copied

Legend:

Unmodified
Added
Removed
  • release/4/sxml-transforms/README.txt

    r11777 r11784  
    1 Egg created with:
    2 tar zcvf ../sxml-transforms.egg . --exclude CVS --exclude \*~ --exclude \#*\# --exclude .\#* --exclude \*.swp
    3 
    4 SSAX/ should be a straight CVS checkout from http://cvs.sourceforge.net/viewcvs.py/ssax/SSAX
     1SSAX/ should be a straight CVS export from http://cvs.sourceforge.net/viewcvs.py/ssax/SSAX
  • release/4/sxml-transforms/chicken/sxml-to-sxml.scm

    r4 r11784  
    1 ;; This file has been modified for chicken: tests are deleted, and
    2 ;; pre-post-order is renamed to pre-post-order-composable.
    3 (declare (export pre-post-order-composable))
    4 ;
    5 ; Transforming SXML to SXML: Composing SXML transformations
     1;; This file has been modified for chicken:
     2;; tests were deleted and module declaration was added
     3(module sxml-to-sxml
     4 (pre-post-order)
     5
     6(import chicken scheme)
     7
     8;       Transforming SXML to SXML: Composing SXML transformations
    69;
    710; The present code introduces and tests a version of pre-post-order
     
    2730;       '(Data (repeat 3 (random-Header 3))))
    2831; a sample transformation
    29 ; (pre-post-order-composable sxml
     32; (pre-post-order sxml
    3033;   `((repeat *macro*
    3134;      . ,(lambda (tag count . elems)
     
    117120; in the code below.
    118121
    119 (define (pre-post-order-composable tree bindings)
     122(define (pre-post-order tree bindings)
    120123  (let* ((default-binding (assq '*default* bindings))
    121124         (text-binding (or (assq '*text* bindings) default-binding))
     
    148151              (else                         ; (cadr binding) is a local binding
    149152                (apply (cddr binding) trigger
    150                   (pre-post-order-composable (cdr tree) (append (cadr binding) bindings)))
     153                  (pre-post-order (cdr tree) (append (cadr binding) bindings)))
    151154                ))))))))
    152155
     156)
  • release/4/sxml-transforms/chicken/sxml-transforms.scm

    r85 r11784  
    11;; $Revision: 1.2 $ $Date: 2005/07/11 23:36:16 $
    22
    3 (declare
    4  (export
    5 
     3(module sxml-transforms
     4 (
    65  ;; SXML-tree-trans.scm -- This does not depend on anything else
    76  SRV:send-reply pre-post-order post-order foldts replace-range
     
    2120  entag-xhtml
    2221  entag-html
    23   ))
     22  )
    2423
    25 (define inc add1) ;; for make-char-quotator
    26 (define-constant nl (string #\newline))  ;; for SXML->HTML
     24(import chicken scheme)
     25(require-extension posix srfi-13)
     26 
     27(define inc add1)
     28(define dec sub1)
     29(define nl (string #\newline))  ;; for SXML->HTML
     30
     31; like cout << arguments << args
     32; where argument can be any Scheme object. If it's a procedure
     33; (without args) it's executed rather than printed (like newline)
     34(define (cout . args)
     35  (for-each (lambda (x)
     36              (if (procedure? x) (x) (display x)))
     37            args))
     38
     39(define (cerr . args)
     40  (for-each (lambda (x)
     41              (if (procedure? x) (x (current-error-port)) (display x (current-error-port))))
     42            args))
    2743
    2844;;; Includes
     
    3046(include "SSAX/lib/util.scm") ;; for make-char-quotator only
    3147(include "SSAX/lib/SXML-tree-trans.scm")
     48(include "SSAX/lib/lookup-def.scm")
    3249(include "SSAX/lib/SXML-to-HTML.scm")      ;; Warning: this needs nl at runtime (unless macro)
    3350
     
    3855(define entag entag-xhtml)
    3956
     57(define OS:file-length file-size)
    4058(include "SSAX/lib/SXML-to-HTML-ext.scm")  ;; Not trimmed, but non-exported code
    4159                                           ;; will not be compiled in.
     
    5573  (set! universal-protected-rules
    5674        (append universal-protected-rules extra-rules)))
     75)
  • release/4/sxml-transforms/sxml-transforms.setup

    r11777 r11784  
    1 (define has-exports? (string>=? (chicken-version) "2.310"))
     1(compile -s -O2 -d0 -o "sxml-transforms.so" -j sxml-transforms chicken/sxml-transforms.scm)
     2(compile -s -O2 -d0 sxml-transforms.import.scm)
    23
    3 (define (dynld-name fn)
    4   (make-pathname #f fn ##sys#load-dynamic-extension) )
     4(install-extension 'sxml-transforms
     5  `("sxml-transforms.so"
     6    "sxml-transforms.import.so" )
     7  `((version 1.1)
     8    (documentation "sxml-transforms.html")))
    59
    6 (compile -s -O2 -d0
    7   ,@(if has-exports? '(-check-imports -emit-exports sxml-transforms.exports) '())
    8   -o ,(dynld-name "sxml-transforms")
    9   chicken/sxml-transforms.scm)
    10 (install-extension 'sxml-transforms
    11   `(,(dynld-name "sxml-transforms")
    12     "sxml-transforms.html" )
    13   `((version 1.1)
    14     (documentation "sxml-transforms.html")
    15     ,@(if has-exports? `((exports "sxml-transforms.exports")) '()) ) )
     10(compile -s -O2 -d0 -o "sxml-to-sxml.so" -j sxml-to-sxml chicken/sxml-to-sxml.scm)
     11(compile -s -O2 -d0 sxml-to-sxml.import.scm)
    1612
    17 (compile -s -O2 -d0
    18   ,@(if has-exports? '(-check-imports -emit-exports sxml-to-sxml.exports) '())
    19   -o ,(dynld-name "sxml-to-sxml")
    20   chicken/sxml-to-sxml.scm)
    2113(install-extension 'sxml-to-sxml
    22   `(,(dynld-name "sxml-to-sxml") )
     14  `("sxml-to-sxml.so"
     15    "sxml-to-sxml.import.so")
    2316  `((version 1.0)
    24     (documentation "sxml-transforms.html")
    25     ,@(if has-exports? `((exports "sxml-to-sxml.exports")) '()) ) )
     17    (documentation "sxml-transforms.html")))
Note: See TracChangeset for help on using the changeset viewer.