3 exception BadToken of string
5 let incr_linenum lexbuf =
6 let pos = lexbuf.Lexing.lex_curr_p in
7 lexbuf.Lexing.lex_curr_p <- { pos with
8 Lexing.pos_lnum = pos.Lexing.pos_lnum + 1;
9 Lexing.pos_bol = pos.Lexing.pos_cnum;
16 let comment = '%' [^ '\n' ] * '\n'
18 ['a'-'z'] ['a'-'z''A'-'Z''0'-'9''_']*
20 ['A'-'Z'] ['a'-'z''A'-'Z''0'-'9''_']*
21 let qstring = ''' [^ ''' ]+ '''
23 "axiom" | "hypothesis" | "definition" | "lemma" | "theorem" |
24 "conjecture" | "lemma_conjecture" | "negated_conjecture" |
32 | dust { yylex lexbuf }
33 | '\n' { incr_linenum lexbuf; yylex lexbuf }
34 | comment { incr_linenum lexbuf; COMMENT (Lexing.lexeme lexbuf) }
35 | "include" { INCLUSION }
36 | type_ { TYPE (Lexing.lexeme lexbuf) }
42 | lname { LNAME (Lexing.lexeme lexbuf) }
43 | uname { UNAME (Lexing.lexeme lexbuf) }
44 | ['0' - '9']+ { NUM (int_of_string (Lexing.lexeme lexbuf)) }
53 | qstring { QSTRING (Lexing.lexeme lexbuf) }
55 | _ { raise (BadToken (Lexing.lexeme lexbuf)) }