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.
20 lines
504 B
Racket
20 lines
504 B
Racket
#lang br/quicklang
|
|
(require "parser.rkt")
|
|
|
|
(define (read-syntax path port)
|
|
(define parse-tree (parse path (make-tokenizer port)))
|
|
(define module-datum `(module bf-mod bf-demo/expander
|
|
,parse-tree))
|
|
(datum->syntax #f module-datum))
|
|
(provide read-syntax)
|
|
|
|
(require brag/support)
|
|
(define (make-tokenizer port)
|
|
(define (next-token)
|
|
(define bf-lexer
|
|
(lexer
|
|
[(char-set "><-.,+[]") lexeme]
|
|
[any-char (next-token)]))
|
|
(bf-lexer port))
|
|
next-token)
|