*** empty log message ***

original commit: e991867a352dd24ea000c7adb439503eafd93f8d
tokens
Scott Owens 23 years ago
parent 09d88646df
commit 04d11c1558

@ -94,8 +94,14 @@
"Form should be (define-lex-abbrevs (name re) ...)" "Form should be (define-lex-abbrevs (name re) ...)"
stx)))) stx))))
(require (lib "cffi.ss" "compiler"))
(define get-next-state ;;(lambda (input-char state eof-table trans-table)
(c-lambda (scheme-object int scheme-object scheme-object) int
"if (SCHEME_EOFP(___arg1))
return (SCHEME_VEC_ELS(___arg3))[___arg2];
else
return (SCHEME_VEC_ELS(___arg4))[SCHEME_CHAR_VAL(___arg1) | ___arg2 << 8]; "))
(define (lexer-body 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) (lambda (lb)
(unless (lex-buffer? lb) (unless (lex-buffer? lb)
@ -121,13 +127,13 @@
(longest-match-length 1)) (longest-match-length 1))
(let ((next-state (let ((next-state
(cond (cond
((eof-object? char) ((eof-object? char)
(vector-ref eof-table state)) (vector-ref eof-table state))
(else (else
(vector-ref (vector-ref
trans-table trans-table
(bitwise-ior (char->integer char) (bitwise-ior (char->integer char)
(arithmetic-shift state 8))))))) (arithmetic-shift state 8)))))))
(cond (cond
((not next-state) ((not next-state)
(do-match lb first-pos longest-match-length longest-match-action wrap?)) (do-match lb first-pos longest-match-length longest-match-action wrap?))

Loading…
Cancel
Save