*** empty log message ***

original commit: fbcf3d8ee9a552a0d725d5be1f7ec9c5a6d90718
tokens
Scott Owens 21 years ago
parent 81d49eda64
commit 0576acf1c1

@ -180,17 +180,25 @@
((null? res) #f) ((null? res) #f)
((re-nullable? (caar res)) (cdar res)) ((re-nullable? (caar res)) (cdar res))
(else (get-final (cdr res))))) (else (get-final (cdr res)))))
(print-struct #t)
(test-block ((c (make-cache)) (test-block ((c (make-cache))
(r1 (->re #\a c)) (r1 (->re #\a c))
(r2 (->re #\b c)) (r2 (->re #\b c))
(b (list (cons z 1) (cons z 2) (cons z 3) (cons e 4) (cons z 5)))
(a (list (cons r1 1) (cons r2 2)))) (a (list (cons r1 1) (cons r2 2))))
((derive null #\a c) #f) ((derive null #\a c) #f)
((derive a #\a c) (list (cons e 1) (cons z 2))) ((derive a #\a c) (list (cons e 1) (cons z 2)))
((derive a #\b c) (list (cons z 1) (cons e 2))) ((derive a #\b c) (list (cons z 1) (cons e 2)))
((derive a #\c c) #f) ((derive a #\c c) #f)
((derive (list (cons (->re `(: " " "\n" ",") c) 1)
(cons (->re `(@ (? "-") (+ (- "0" "9"))) c) 2)
(cons (->re `(@ "-" (+ "-")) c) 3)
(cons (->re "[" c) 4)
(cons (->re "]" c) 5)) #\[ c)
b)
((get-final a) #f) ((get-final a) #f)
((get-final (list (cons e 1) (cons e 2))) 1)) ((get-final (list (cons e 1) (cons e 2))) 1)
((get-final b) 4))
;; A state is (make-state (list-of re-action) nat) ;; A state is (make-state (list-of re-action) nat)
@ -310,5 +318,10 @@
(define t7 (build-test-dfa `((@ (* #\a) (* #\b) (* #\c) (* #\d) (* #\e))))) (define t7 (build-test-dfa `((@ (* #\a) (* #\b) (* #\c) (* #\d) (* #\e)))))
(define t8 (define t8
(build-test-dfa `((@ (* (: #\a #\b)) #\a (: #\a #\b) (: #\a #\b) (: #\a #\b) (: #\a #\b))))) (build-test-dfa `((@ (* (: #\a #\b)) #\a (: #\a #\b) (: #\a #\b) (: #\a #\b) (: #\a #\b)))))
(define x (build-test-dfa `((: " " "\n" ",")
(@ (? "-") (+ (- "0" "9")))
(@ "-" (+ "-"))
"["
"]")))
|# |#
) )

@ -25,9 +25,9 @@
;; ;;
;; Every re must have an index field globally different from all ;; Every re must have an index field globally different from all
;; other re index fields. ;; other re index fields.
(define-struct re (nullable? index)) (define-struct re (nullable? index) (make-inspector))
(define-struct (epsilonR re) ()) (define-struct (epsilonR re) () (make-inspector))
(define-struct (zeroR re) ()) (define-struct (zeroR re) () (make-inspector))
(define-struct (char-setR re) (chars) (make-inspector)) (define-struct (char-setR re) (chars) (make-inspector))
(define-struct (concatR re) (re1 re2) (make-inspector)) (define-struct (concatR re) (re1 re2) (make-inspector))
(define-struct (repeatR re) (re)) (define-struct (repeatR re) (re))

Loading…
Cancel
Save