module lex. accumulate scan. type lparen, rparen, period, comma, backslash, truthtok, falsetok, negtok, andtok, ortok, imptok, foralltok, existstok, lambdatok lex. type tok string -> lex. % kind lex type. % type white_space, in_symbol int -> o. % type single int -> lex -> o. % type string_to_lex string -> lex -> o. white_space 9. % tab white_space 10. % carrage return white_space 12. % form feed white_space 32. % space in_symbol 35. % # in_symbol 38. % & in_symbol 45. % - in_symbol 58. % : in_symbol 60. % < in_symbol 61. % = in_symbol 62. % > in_symbol 63. % ? in_symbol 64. % @ in_symbol 92. % \ in_symbol 95. % _ in_symbol C :- C > 47, C < 58. % 0,1,...,9 in_symbol C :- C > 64, C < 91. % A,B,...,Z in_symbol C :- C > 96, C < 123. % a,b,...,z single 40 lparen. single 41 rparen. single 44 comma. single 46 period. single 47 backslash. string_to_lex "forall" foralltok :- !. string_to_lex "exists" existstok :- !. string_to_lex "lambda" lambdatok :- !. string_to_lex "neg" negtok :- !. string_to_lex "truth" truthtok :- !. string_to_lex "false" falsetok :- !. string_to_lex "and" andtok :- !. string_to_lex "or" ortok :- !. string_to_lex "=>" imptok :- !. string_to_lex Str (tok Str).