]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/applications/radtest/load_lexer.mll
Initial revision
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20001129-0.1.0 / applications / radtest / load_lexer.mll
1 {
2 open Load_parser
3
4
5 rule token = parse
6   [ ' ' '\t' '\n']+     { token lexbuf }
7 | "<window"             { WINDOW_START }
8 | "</window>"           { WINDOW_END }
9 | "name"                { NAME }
10 |  '='                  { EQUAL }
11 |  '>'                  { SUP }
12
13 | "<" ['A'-'Z' 'a'-'z' '0'-'9' '_']+
14   {
15     let l = Lexing.lexeme lexbuf in
16     let s = String.sub l ~pos:1 ~len:(String.length l - 1) in
17     WIDGET_START s
18   }
19
20 | "</" ['A'-'Z' 'a'-'z' '0'-'9' '_']+ '>'
21   {
22     let l = Lexing.lexeme lexbuf in
23     let s = String.sub l ~pos:2 ~len:(String.length l - 3) in
24     WIDGET_END s
25   }
26
27 | '"' [^ '"']* '"'
28   {
29     let l = Lexing.lexeme lexbuf in
30     let s = String.sub l ~pos:1 ~len:(String.length l - 2) in
31     IDENT s
32   }
33
34 | '\'' [^ '\'']* '\''
35   {
36     let l = Lexing.lexeme lexbuf in
37     let s = String.sub l ~pos:1 ~len:(String.length l - 2) in
38     IDENT s
39   }
40
41 | ['A'-'Z' 'a'-'z' '0'-'9' '_' '.']+
42   {
43     let s = Lexing.lexeme lexbuf in IDENT s
44   }
45
46 | eof               { EOF }