|
|
@ -12,14 +12,6 @@
|
|
|
|
(listof identifier?) (union syntax? false?) syntax?) . ->* .
|
|
|
|
(listof identifier?) (union syntax? false?) syntax?) . ->* .
|
|
|
|
(any? any? any? any?))))
|
|
|
|
(any? any? any? any?))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (strip so)
|
|
|
|
|
|
|
|
(syntax-local-introduce
|
|
|
|
|
|
|
|
(datum->syntax-object
|
|
|
|
|
|
|
|
#f
|
|
|
|
|
|
|
|
(syntax-object->datum so)
|
|
|
|
|
|
|
|
so
|
|
|
|
|
|
|
|
so)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; fix-check-syntax : (listof identifier?) (listof identifier?) (listof identifier?)
|
|
|
|
;; fix-check-syntax : (listof identifier?) (listof identifier?) (listof identifier?)
|
|
|
|
;; (union syntax? false?) syntax?) -> syntax?
|
|
|
|
;; (union syntax? false?) syntax?) -> syntax?
|
|
|
|
(define (fix-check-syntax input-terms start end assocs prods)
|
|
|
|
(define (fix-check-syntax input-terms start end assocs prods)
|
|
|
@ -36,8 +28,7 @@
|
|
|
|
(syntax-case prods ()
|
|
|
|
(syntax-case prods ()
|
|
|
|
(((_ rhs ...) ...)
|
|
|
|
(((_ rhs ...) ...)
|
|
|
|
(syntax->list (syntax (rhs ... ...)))))))
|
|
|
|
(syntax->list (syntax (rhs ... ...)))))))
|
|
|
|
(with-syntax (((tmp ...) term-binders)
|
|
|
|
(with-syntax (((term-group ...)
|
|
|
|
((term-group ...)
|
|
|
|
|
|
|
|
(map (lambda (tg)
|
|
|
|
(map (lambda (tg)
|
|
|
|
(syntax-property
|
|
|
|
(syntax-property
|
|
|
|
(datum->syntax-object tg #f)
|
|
|
|
(datum->syntax-object tg #f)
|
|
|
@ -46,9 +37,12 @@
|
|
|
|
input-terms))
|
|
|
|
input-terms))
|
|
|
|
((end ...)
|
|
|
|
((end ...)
|
|
|
|
(map get-term-binder end))
|
|
|
|
(map get-term-binder end))
|
|
|
|
|
|
|
|
((start ...)
|
|
|
|
|
|
|
|
(map get-term-binder start))
|
|
|
|
((bind ...)
|
|
|
|
((bind ...)
|
|
|
|
(syntax-case prods ()
|
|
|
|
(syntax-case prods ()
|
|
|
|
(((bind _ ...) ...) (syntax->list (syntax (bind ...))))))
|
|
|
|
(((bind _ ...) ...)
|
|
|
|
|
|
|
|
(syntax->list (syntax (bind ...))))))
|
|
|
|
(((bound ...) ...)
|
|
|
|
(((bound ...) ...)
|
|
|
|
(map
|
|
|
|
(map
|
|
|
|
(lambda (rhs)
|
|
|
|
(lambda (rhs)
|
|
|
@ -68,9 +62,9 @@
|
|
|
|
((_ (__ term ...) ...)
|
|
|
|
((_ (__ term ...) ...)
|
|
|
|
(syntax->list (syntax (term ... ...))))))
|
|
|
|
(syntax->list (syntax (term ... ...))))))
|
|
|
|
null)))
|
|
|
|
null)))
|
|
|
|
#`(when #f
|
|
|
|
#`(when #f
|
|
|
|
(let ((bind void) ... (tmp void) ...)
|
|
|
|
(let ((bind void) ...)
|
|
|
|
(void bound ... ... term-group ... end ... prec ...))))))
|
|
|
|
(void bound ... ... term-group ... start ... end ... prec ...))))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (build-parser filename src-pos suppress input-terms start end assocs prods)
|
|
|
|
(define (build-parser filename src-pos suppress input-terms start end assocs prods)
|
|
|
|
(let* ((grammar (parse-input input-terms start end assocs prods src-pos))
|
|
|
|
(let* ((grammar (parse-input input-terms start end assocs prods src-pos))
|
|
|
|