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_______________________________________________________________ *)
17 let out s = if debug then L.warn s else ()
23 let SPC = [' ' '\t' '\n']+
25 let ID = ['0'-'9' 'A'-'Z' 'a'-'z' '_' '\'' '`']+
27 rule line_comment = parse
29 | OC { block_comment lexbuf; line_comment lexbuf }
30 | _ { line_comment lexbuf }
32 and block_comment = parse
34 | OC { block_comment lexbuf; block_comment lexbuf }
35 | LC { line_comment lexbuf; block_comment lexbuf }
36 | _ { block_comment lexbuf }
39 | SPC { token lexbuf }
40 | LC { line_comment lexbuf; token lexbuf }
41 | OC { block_comment lexbuf; token lexbuf }
42 | "_E" { out "E"; P.E }
43 | "'_E'" { out "E"; P.E }
44 | "---" { out "EB"; P.EB }
45 | "'eb'" { out "EB"; P.EB }
46 | "EB" { out "EB"; P.EB }
47 | "--" { out "EXIT"; P.EXIT }
48 | "PN" { out "PN"; P.PN }
49 | "'pn'" { out "PN"; P.PN }
50 | "PRIM" { out "PN"; P.PN }
51 | "'prim'" { out "PN"; P.PN }
52 | "???" { out "PN"; P.PN }
53 | "PROP" { out "PROP"; P.PROP }
54 | "'prop'" { out "PROP"; P.PROP }
55 | "TYPE" { out "TYPE"; P.TYPE }
56 | "'type'" { out "TYPE"; P.TYPE }
57 | ID { out "ID"; P.IDENT (Lexing.lexeme lexbuf) }
58 | ":=" { out "DEF"; P.DEF }
59 | "(" { out "OP"; P.OP }
60 | ")" { out "CP"; P.CP }
61 | "[" { out "OB"; P.OB }
62 | "]" { out "CB"; P.CB }
63 | "<" { out "OA"; P.OA }
64 | ">" { out "CA"; P.CA }
65 | "@" { out "AT"; P.AT }
66 | "~" { out "TD"; P.TD }
67 | "\"" { out "QT"; P.QT }
68 | ":" { out "CN"; P.CN }
69 | "," { out "CM"; P.CM }
70 | ";" { out "SC"; P.SC }
71 | "." { out "FS"; P.FS }
72 | "+" { out "PLUS"; P.PLUS }
73 | "-" { out "MINUS"; P.MINUS }
74 | "*" { out "TIMES"; P.TIMES }
75 | "=" { out "DEF"; P.DEF }
76 | eof { out "EOF"; P.EOF }