You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
505 B
Scheme
23 lines
505 B
Scheme
#cs
|
|
(module token mzscheme
|
|
|
|
;; Defining tokens
|
|
|
|
(require-for-syntax "token-syntax.ss")
|
|
|
|
(provide define-tokens define-empty-tokens make-token token-name token-value token?)
|
|
|
|
(define-struct token (name value) (make-inspector))
|
|
|
|
(define-syntax (define-tokens stx)
|
|
(syntax-case stx ()
|
|
((_ name ...)
|
|
(define-tokens-helper stx #'here #f))))
|
|
|
|
(define-syntax (define-empty-tokens stx)
|
|
(syntax-case stx ()
|
|
((_ name ...)
|
|
(define-tokens-helper stx #'here #t))))
|
|
)
|
|
|