-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.l
More file actions
48 lines (46 loc) · 972 Bytes
/
sql.l
File metadata and controls
48 lines (46 loc) · 972 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
%{
#include <stdio.h>
#include "y.tab.h"
extern int yylval;
%}
%%
select return SELECT;
drop return DROP;
table return TABLE;
alter return ALTER;
add return ADD;
create return CREATE;
insert return INSERT;
update return UPDATE;
set return SET;
column return COLUMN;
delete return DELETE;
from return FROM;
where return WHERE;
into return INTO;
values return VALUES;
and return AND;
or return OR;
int return INT;
char return CHAR;
varchar return VARCHAR;
primary return PRIMARY;
key return KEY;
[;] return *yytext;
[(] return *yytext;
[)] return *yytext;
[*] return *yytext;
[,] return *yytext;
"<=" |
">=" |
"<" |
">" |
[=] return *yytext;
[\"][^\"]*[\"] return STRING;
[A-Za-z_][A-Z0a-z0-9_]* return IDENTIFIER;
[0-9]+ |
[0-9]+"."[0-9]+ |
"."[0-9]+ return NUMBER;
\n return *yytext;
[ \t]+ /* ignore whitespace */;
%%