2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
15 let out s = if !O.debug_lexer then prerr_endline s
20 let UNI = ['\x80'-'\xBF']+
21 let SPC = ['\r' '\n' '\t' ' ']+
22 let WRD = ['0'-'9' 'A'-'Z' 'a'-'z' '_']+
26 | OL { out "COM"; block lexbuf; token lexbuf }
27 | QT { out "STR"; O.chars := !O.chars + str lexbuf; token lexbuf }
28 | SPC { out "SPC"; incr O.chars; token lexbuf }
29 | UNI { out "UNI"; incr O.chars; token lexbuf }
30 | WRD { out "WRD"; incr O.chars; token lexbuf }
31 | _ { out "CHR"; incr O.chars; token lexbuf }
35 | "\\\"" { succ (str lexbuf) }
36 | UNI { succ (str lexbuf) }
37 | WRD { succ (str lexbuf) }
38 | _ { succ (str lexbuf) }
41 | OL { block lexbuf; block lexbuf }
42 | QT { let _ = str lexbuf in block lexbuf }