{ open Exp exception EOF exception ILLÉGAL } rule token = parse [' ' '\t' '\n'] { token lexbuf } (* skip blanks *) | ";;" { EOP } | ['a' - 'z'] + ['0' - '9'] * { ID (Lexing.lexeme lexbuf) } | ['0'-'9']+ { NUM(int_of_string (Lexing.lexeme lexbuf)) } | '+' { PLUS } | '-' { MINUS } | eof { raise EOF } | _ { raise ILLÉGAL } { let parse s = let lexbuf = Lexing.from_string s in Exp._S token lexbuf;; }