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.
beautiful-racket/beautiful-racket-demo/bf-demo/reader.rkt

21 lines
523 B
Racket

9 years ago
#lang br/quicklang
8 years ago
(require "parser.rkt")
(define (read-syntax path port)
8 years ago
(define parse-tree (parse path (make-tokenizer port)))
8 years ago
(define module-datum `(module bf-mod bf-demo/expander
,parse-tree))
(datum->syntax #f module-datum))
(provide read-syntax)
9 years ago
8 years ago
(require brag/support)
8 years ago
(define (make-tokenizer port)
9 years ago
(define (next-token)
8 years ago
(define bf-lexer
8 years ago
(lexer
[(eof) eof]
9 years ago
[(char-set "><-.,+[]") lexeme]
[any-char (next-token)]))
8 years ago
(bf-lexer port))
9 years ago
next-token)