source: project/release/4/ssax/tags/5.0.6/ssax-chicken.scm @ 25929

Last change on this file since 25929 was 25929, checked in by sjamaan, 10 years ago

Release ssax 5.0.6

File size: 2.3 KB
Line 
1;========================================================================
2;               Highest-level parsers: XML to SXML
3
4(module ssax
5
6(ssax:read-char-data xml-token-kind xml-token-head
7 (ssax:make-parser ssax:scan-Misc ssax:Prefix-XML ssax:complete-start-tag ssax:read-char-data ssax:assert-token ssax:warn parser-error ssax:skip-internal-dtd ssax:ncname-starting-char? ssax:skip-pi ssax:skip-S ssax:S-chars ssax:read-external-id ssax:read-QName ssax:read-markup-token ssax:handle-parsed-entity)
8 (ssax:make-pi-parser ssax:scan-Misc ssax:Prefix-XML ssax:complete-start-tag ssax:read-char-data ssax:assert-token ssax:warn parser-error ssax:skip-internal-dtd ssax:ncname-starting-char? ssax:skip-pi ssax:skip-S ssax:S-chars ssax:read-external-id ssax:read-QName ssax:read-markup-token ssax:handle-parsed-entity)
9 (ssax:make-elem-parser ssax:scan-Misc ssax:Prefix-XML ssax:complete-start-tag ssax:read-char-data ssax:assert-token ssax:warn parser-error ssax:skip-internal-dtd ssax:ncname-starting-char? ssax:skip-pi ssax:skip-S ssax:S-chars ssax:read-external-id ssax:read-QName ssax:read-markup-token ssax:handle-parsed-entity)
10 ssax:xml->sxml
11 ssax:warn
12 html-entity-unicode-chars)
13
14(import (except scheme string make-string) (except chicken assert))
15(import (prefix (only chicken assert) core:))
16(require-extension ports)
17(require-library extras srfi-1 srfi-13)
18(import (except extras read-string) (except srfi-1 fold fold-right cons*))
19(import (except srfi-13 string-null?))
20(require-extension input-parse)
21
22(define ucscode->char integer->char)
23(define ascii->char integer->char)
24(define char-return (ascii->char 13))
25(define char-tab (ascii->char 9))
26(define char-newline (ascii->char 10))
27;; SSAX.scm expects STRING to work on characters > #\u00ff;
28;; this allows entities > 255 to be parsed correctly.
29(define (string x) (##sys#char->utf8-string x))
30;; For UTF8 (make-string 1 ch) in html-entity-codes.scm; no one else uses this,
31;; so don't bother to support k > 1.
32(define (make-string k x)
33  (core:assert (= k 1) "attempt to call ssax:make-string with k != 1")
34  (string x))
35
36(define parser-error error)
37
38(define (ssax:warn port msg . other-msg)
39  (apply cerr (cons* nl "Warning: " msg other-msg)))
40
41(include "myenv-chicken.scm")
42(include "look-for-str.scm")
43(include "SSAX.scm")
44(include "html-entity-codes.scm")
45
46)
Note: See TracBrowser for help on using the repository browser.