forked from AOP-PHP/AOP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lexer.h
37 lines (29 loc) · 747 Bytes
/
Lexer.h
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
//--------------------------------------------------------- ./scanner.h
#ifndef _LEXER_H
# define _LEXER_H
#define SCANNER_RETCODE_EOF -1
#define SCANNER_RETCODE_ERR -2
#define SCANNER_RETCODE_IMPOSSIBLE -3
#define TOKEN_SPACE 0
#define TOKEN_FUNCTION 1
#define TOKEN_CLASS 2
#define TOKEN_JOKER 3
#define TOKEN_SUPER_JOKER 4
#define TOKEN_PROPERTY 5
#define TOKEN_SCOPE 6
#define TOKEN_STATIC 7
#define TOKEN_OR 8
#define TOKEN_TEXT 9
typedef struct _scanner_state {
char* start;
char* end;
char* marker;
} scanner_state;
typedef struct _scanner_token {
int TOKEN;
char *str_val;
int int_val;
} scanner_token;
int scan(scanner_state *state, scanner_token *token);
//TODO: some functions to manipulate scanner states
#endif