*** empty log message ***

original commit: 65d66e4bc44b3d24ded43a8437fc019cdf9043c7
tokens
Scott Owens 20 years ago
parent d3ed80f6c8
commit 982dba75db

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

Loading…
Cancel
Save