|
|
@ -40,23 +40,19 @@
|
|
|
|
(actions-stx `(vector ,@(vector->list (table-actions table)))))
|
|
|
|
(actions-stx `(vector ,@(vector->list (table-actions table)))))
|
|
|
|
(if wrap?
|
|
|
|
(if wrap?
|
|
|
|
(syntax
|
|
|
|
(syntax
|
|
|
|
(let-values (((a b c d e)
|
|
|
|
(lexer-body start-state-stx
|
|
|
|
(values start-state-stx
|
|
|
|
|
|
|
|
trans-table-stx
|
|
|
|
trans-table-stx
|
|
|
|
eof-table-stx
|
|
|
|
eof-table-stx
|
|
|
|
actions-stx
|
|
|
|
actions-stx
|
|
|
|
no-lookahead-stx)))
|
|
|
|
no-lookahead-stx
|
|
|
|
(lambda (lb)
|
|
|
|
#t))
|
|
|
|
(lexer-body lb a b c d e #t))))
|
|
|
|
|
|
|
|
(syntax
|
|
|
|
(syntax
|
|
|
|
(let-values (((a b c d e)
|
|
|
|
(lexer-body start-state-stx
|
|
|
|
(values start-state-stx
|
|
|
|
|
|
|
|
trans-table-stx
|
|
|
|
trans-table-stx
|
|
|
|
eof-table-stx
|
|
|
|
eof-table-stx
|
|
|
|
actions-stx
|
|
|
|
actions-stx
|
|
|
|
no-lookahead-stx)))
|
|
|
|
no-lookahead-stx
|
|
|
|
(lambda (lb)
|
|
|
|
#f))))))))))))
|
|
|
|
(lexer-body lb a b c d e #f))))))))))))))
|
|
|
|
|
|
|
|
(values
|
|
|
|
(values
|
|
|
|
(build-lexer #f)
|
|
|
|
(build-lexer #f)
|
|
|
|
(build-lexer #t))))
|
|
|
|
(build-lexer #t))))
|
|
|
@ -100,7 +96,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (lexer-body lb start-state trans-table eof-table actions no-lookahead wrap?)
|
|
|
|
(define (lexer-body start-state trans-table eof-table actions no-lookahead wrap?)
|
|
|
|
|
|
|
|
(lambda (lb)
|
|
|
|
(unless (lex-buffer? lb)
|
|
|
|
(unless (lex-buffer? lb)
|
|
|
|
(raise-type-error
|
|
|
|
(raise-type-error
|
|
|
|
'lexer
|
|
|
|
'lexer
|
|
|
@ -151,7 +148,7 @@
|
|
|
|
(add1 length)
|
|
|
|
(add1 length)
|
|
|
|
(if act
|
|
|
|
(if act
|
|
|
|
length
|
|
|
|
length
|
|
|
|
longest-match-length)))))))))
|
|
|
|
longest-match-length))))))))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (do-match lb first-pos longest-match-length longest-match-action wrap?)
|
|
|
|
(define (do-match lb first-pos longest-match-length longest-match-action wrap?)
|
|
|
|
(let* ((match (get-match lb longest-match-length))
|
|
|
|
(let* ((match (get-match lb longest-match-length))
|
|
|
|