|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
(define-lex-abbrev regex-chars (char-set "()*+?.^$|<!=[]"))
|
|
|
|
(define-lex-abbrev regex-chars (char-set "()*+?.^$|<!=[]"))
|
|
|
|
|
|
|
|
|
|
|
|
(define lex
|
|
|
|
(define tokenize
|
|
|
|
(lexer
|
|
|
|
(lexer
|
|
|
|
[(:+ "\n") (token 'NEWLINE lexeme)]
|
|
|
|
[(:+ "\n") (token 'NEWLINE lexeme)]
|
|
|
|
[(from/stop-before ";" "\n") (token 'COMMENT #:skip? #t)]
|
|
|
|
[(from/stop-before ";" "\n") (token 'COMMENT #:skip? #t)]
|
|
|
@ -16,7 +16,7 @@
|
|
|
|
[alphabetic (token 'LITERAL lexeme)]))
|
|
|
|
[alphabetic (token 'LITERAL lexeme)]))
|
|
|
|
|
|
|
|
|
|
|
|
(define (read-syntax src ip)
|
|
|
|
(define (read-syntax src ip)
|
|
|
|
(define parse-tree (parse (λ () (lex ip))))
|
|
|
|
(define parse-tree (parse (λ () (tokenize ip))))
|
|
|
|
(strip-context
|
|
|
|
(strip-context
|
|
|
|
(with-syntax ([PT parse-tree])
|
|
|
|
(with-syntax ([PT parse-tree])
|
|
|
|
#'(module regexcellent-mod regexcellent-demo
|
|
|
|
#'(module regexcellent-mod regexcellent-demo
|
|
|
|