; Tokens for the subset of Scheme used by the nboyer benchmark. (define character-classes `(;(letter isLetter?) ;(digit isDigit?) (space char-whitespace?) (notdoublequote isNotDoubleQuote?) (notnewline isNotNewline?) (anycharacter char?))) (define character-classes-for-java `(;(letter "Character.isLetter") ;(digit "Character.isDigit") (space "Character.isWhitespace") (notdoublequote "isNotDoubleQuote") (notnewline "isNotNewline") (anycharacter "isCharacter"))) (define scheme_terminals '( (whitespace (! (space (* space)) (#\; (* notnewline) #\newline))) (id (! #\+ #\- (#\. #\. #\.) ((! (! #\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z) #\! #\$ #\% #\& #\* #\/ #\: #\< #\= #\> #\? #\^ #\_ #\~) (* (! (! #\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z) #\! #\$ #\% #\& #\* #\/ #\: #\< #\= #\> #\? #\^ #\_ #\~ (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) #\+ #\- #\. #\@))))) (boolean (! (#\# #\t) (#\# #\f))) ; Woefully incomplete, because Scheme numbers are complicated. ; is enough to parse the nboyer benchmark, however. (number ((! () #\+ #\-) (! ((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#)) (((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#)) #\/ ((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#))) ((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#) (! () ((! #\e #\s #\f #\d #\l) (! () #\+ #\-) (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9))))) (#\. (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#) (! () ((! #\e #\s #\f #\d #\l) (! () #\+ #\-) (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9))))) ((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) #\. (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (* #\#) (! () ((! #\e #\s #\f #\d #\l) (! () #\+ #\-) (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9))))) ((! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) #\# (* #\#) #\. (* #\#) (! () ((! #\e #\s #\f #\d #\l) (! () #\+ #\-) (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (* (! #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)))))))) (character (#\# #\\ (! (#\s #\p #\a #\c #\e) (#\n #\e #\w #\l #\i #\n #\e) anycharacter))) (string (#\" (* notdoublequote) #\")) (lparen #\() (rparen #\)) (vecstart (#\# #\()) (quote #\') (backquote #\`) (comma #\,) (splicing (#\, #\@)) (period #\.) ))