|
|
|
@ -64,7 +64,7 @@
|
|
|
|
|
(define (display-yacc grammar tokens start precs port)
|
|
|
|
|
(let-syntax ((p (syntax-rules ()
|
|
|
|
|
((_ args ...) (fprintf port args ...)))))
|
|
|
|
|
(let* ((tokens (map syntax-local-value (cdr (syntax->list tokens))))
|
|
|
|
|
(let* ((tokens (map syntax-local-value (syntax->list tokens)))
|
|
|
|
|
(eterms (filter e-terminals-def? tokens))
|
|
|
|
|
(terms (filter terminals-def? tokens))
|
|
|
|
|
(term-table (make-hash-table))
|
|
|
|
@ -97,7 +97,7 @@
|
|
|
|
|
(p " ~a" (hash-table-get term-table tok)))
|
|
|
|
|
(cdr prec))
|
|
|
|
|
(p "~n"))
|
|
|
|
|
(cdr precs)))
|
|
|
|
|
precs))
|
|
|
|
|
(p "%start ~a~n" start)
|
|
|
|
|
(p "%%~n")
|
|
|
|
|
|
|
|
|
@ -110,7 +110,7 @@
|
|
|
|
|
(display-rhs rhs))
|
|
|
|
|
(cddr prod))
|
|
|
|
|
(p ";~n")))
|
|
|
|
|
(cdr grammar))
|
|
|
|
|
grammar)
|
|
|
|
|
(p "%%~n"))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|