2 (******************************************************)
3 (* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
5 (******************************************************)
9 let comment_depth = ref 0;;
11 let charint_of_lexeme l =
17 let digit = ['0'-'9']|['A'-'F']
21 [' ' '\t' '\n'] { token lexbuf }
23 | (['a'-'z']|'_')(['a'-'z']|['A'-'Z']|'_'|['0'-'9']|'\'')*
24 { IDENT (Lexing.lexeme lexbuf) }
31 | "(*" { incr comment_depth ;
34 | "#x" digit digit digit digit { CHAR (charint_of_lexeme (Lexing.lexeme lexbuf)) }
39 "(*" { incr comment_depth ; comment lexbuf }
40 | "*)" { decr comment_depth ;
41 if !comment_depth = 0 then token lexbuf else comment lexbuf
43 | _ { comment lexbuf }