|
|
@ -82,6 +82,9 @@
|
|
|
|
(enter-empty-term $1)
|
|
|
|
(enter-empty-term $1)
|
|
|
|
(cons $1 $2)))))))
|
|
|
|
(cons $1 $2)))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (symbol<? a b)
|
|
|
|
|
|
|
|
(string<? (symbol->string a) (symbol->string b)))
|
|
|
|
|
|
|
|
|
|
|
|
(define (trans filename)
|
|
|
|
(define (trans filename)
|
|
|
|
(let* ((i (open-input-file filename))
|
|
|
|
(let* ((i (open-input-file filename))
|
|
|
|
(terms (make-hash-table))
|
|
|
|
(terms (make-hash-table))
|
|
|
@ -107,8 +110,8 @@
|
|
|
|
(let ((t (get-token-grammar i)))
|
|
|
|
(let ((t (get-token-grammar i)))
|
|
|
|
t)))))
|
|
|
|
t)))))
|
|
|
|
`(begin
|
|
|
|
`(begin
|
|
|
|
(define-tokens t ,(quicksort (hash-table-map terms (lambda (k v) k)) string<?))
|
|
|
|
(define-tokens t ,(quicksort (hash-table-map terms (lambda (k v) k)) symbol<?))
|
|
|
|
(define-empty-tokens et ,(quicksort (hash-table-map eterms (lambda (k v) k)) string<?))
|
|
|
|
(define-empty-tokens et ,(quicksort (hash-table-map eterms (lambda (k v) k)) symbol<?))
|
|
|
|
(parser
|
|
|
|
(parser
|
|
|
|
(start ___)
|
|
|
|
(start ___)
|
|
|
|
(end ___)
|
|
|
|
(end ___)
|
|
|
|