Changeset 14812 in project


Ignore:
Timestamp:
05/28/09 02:55:14 (11 years ago)
Author:
Ivan Raikov
Message:

numerous fixes to lexgen function invocations

Location:
release/4/abnf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/abnf/abnf.scm

    r14807 r14812  
    3737
    3838
    39 (module abnf
    40 
    41    (alpha binary decimal hexadecimal char lit cr lf crlf ctl
     39(module abnf
     40
     41   (alpha char
     42          binary decimal hexadecimal ascii-char lit cr lf crlf ctl
    4243          dquote htab lwsp octet sp vchar wsp
    4344          quoted-pair quoted-string
     
    106107;; Match any 7-bit US-ASCII character except for NUL (ASCII value 0, that is).
    107108
    108 (define char (lex:set (ucs-range->char-set 1 127)))
     109(define ascii-char (lex:set (ucs-range->char-set 1 127)))
    109110
    110111;; Match the carriage return character \r.
     
    134135(define htab    (char (integer->char 9)))
    135136
     137;; Match either 'sp' or 'htab'.
     138
     139(define wsp (lex:set char-set:whitespace))
     140
    136141;; Match "linear white-space". That is any number of consecutive wsp,
    137142;; optionally followed by a 'crlf' and (at least) one more wsp.
     
    145150
    146151(define sp (char #\space))
    147 
    148152
    149153;; Match any printable ASCII character. (The "v" stands for
     
    153157(define vchar  (lex:set char-set:graphic))
    154158
    155 ;; Match either 'sp' or 'htab'.
    156 
    157 (define wsp (lex:set char-set:whitespace))
    158 
    159159
    160160;; Match a "quoted pair". Any characters (excluding CR and LF) may be
    161161;; quoted.
    162162
    163 (define quoted-pair (lex:seq (char #\\) (lex:set char-set:not-crlf)))
    164163(define char-set:not-crlf (char-set-complement (string->char-set "\r\n")))
     164(define quoted-pair (lex:seq (list (char #\\) (lex:set char-set:not-crlf))))
    165165
    166166;; Match a quoted string. The specials \ and " must be escaped inside
    167167;; a quoted string; CR and LF are not allowed at all.
    168168
    169 (define quoted-string
    170   (lex:seq dquote (lex:star qcont) dquote))
    171 
    172 (define qcont (lex:bar (lex:pos qtext) quoted-pair))
     169(define char-set:quoted (char-set-complement (string->char-set "\\\"\r\n")))
    173170(define qtext (lex:set char-set:quoted))
    174 (define char-set:quoted (char-set-complement (string->char-set "\\\"\r\n")))
     171(define qcont (lex:bar (list (lex:pos qtext) quoted-pair)))
     172
     173(define quoted-string  (lex:seq (list dquote (lex:star qcont) dquote)))
    175174
    176175;;;; Additional convenience procedures and parser combinators
     
    218217          (and x1 (cons (make x1) (cdr x1))))))))
    219218
    220 
    221219)
  • release/4/abnf/abnf.setup

    r14756 r14812  
    44  (make-pathname #f fn ##sys#load-dynamic-extension))   
    55
    6 (compile -O2 -d0 -s abnf.scm -j abnf)
    7 (compile -O2 -d0 -s abnf.import.scm)
     6(compile -O -d2 -s abnf.scm -j abnf)
     7(compile -s abnf.import.scm)
    88
    99(install-extension
     
    1717
    1818  ;; Assoc list with properties for your extension:
    19   '((version 1.4)
     19  '((version 1.5)
    2020    (documentation "abnf.html")
    2121    ))
Note: See TracChangeset for help on using the changeset viewer.