-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlexer.mll
More file actions
35 lines (34 loc) · 1.88 KB
/
lexer.mll
File metadata and controls
35 lines (34 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
open Parser;;
exception Eof;;
}
rule token = parse
| [' ' '\t' '\n'] { token lexbuf }
| "SELECT" { SELECT }
| "FROM" { FROM }
| "WHERE" { WHERE }
| "MINUS" { MINUS }
| "UNION" { UNION }
| '(' { LPAREN }
| ')' { RPAREN }
| ',' { COMMA }
| '.' { DOT }
| "IN" { IN }
| "NOT" { NOT }
| "AND" { AND }
| "OR" { OR }
| "GROUP" { GROUP }
| "BY" { BY }
| "ORDER" { ORDER }
| "MIN" { MIN }
| "MAX" { MAX }
| "COUNT" { COUNT }
| "AVG" { AVG }
| "SUM" { SUM }
| '<' { LT }
| '=' { EQ }
| "AS" { AS }
| '"' { QUOTES }
| ['A'-'Z''a'-'z']['A'-'Z''a'-'z''0'-'9''_']* as i { VAL i }
| ['A'-'Z''a'-'z''\\''-''_''0'-'9']+".csv" as i { FILE i }
| eof { EOF }