{ open Lexing p; exception LexicalError of string fun lexerError lexbuf s = raise LexicalError (s); (* [` ` `\t` `\n` `\r`] { Token lexbuf } *) } rule Token = parse [`0`-`9`'a'-'f''A'-'F']+ { case Int.fromString "0x" ^ (getLexeme lexbuf) of NONE => lexerError lexbuf "internal error" | SOME i => BYTE i } | ['+' { PLUS } | eof { EOF } | _ { lexerError lexbuf "Illegal symbol in input" } ;