-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlexanal.h
More file actions
39 lines (25 loc) · 1.01 KB
/
lexanal.h
File metadata and controls
39 lines (25 loc) · 1.01 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
/* ===================================================================
These are the SYMBOLIC CONSTANTS of the token codes
for the tokens return by the lexical analyzer
=================================================================== */
enum Token
{
IDENTIFIER = 128,
INTEGER_NUMBER,
FLOAT_NUMBER,
STRING,
// Use the ASCII code for the single char tokens:
// , ( ) [ ] . : ; * + - / < > = "
LESSOREQ, GREATEROREQ, NOTEQ, // <= >= !=
ALL, AND, ANY, AS, AVG, BETWEEN, BY, CHAR,
CHECK, CLOSE, COMMIT, COUNT, CREATE, DECIMAL, DELETE, DISTINCT,
DOUBLE, DROP, EXISTS, FLOAT, FROM, GO, GROUP, HAVING,
IN, INSERT, INT, INTO, IS, LIKE, MAX, MIN,
NOT,
NULL0, // Because NULL is already defined in C, we use NULL0
NUMERIC, OF, ON, OR, ORDER, PRIMARY,
REAL, SCHEMA, SELECT, SET, SOME, SUM, TABLE, TO,
UNION, UNIQUE, UPDATE, USER, VALUES, VIEW, WHERE, WITH
};
int read_command(char *input);
char *lex_anal(char *current_pos, char *token, int *token_type);