-
Notifications
You must be signed in to change notification settings - Fork 3
/
thin_delta_scanner.fl
61 lines (54 loc) · 1.44 KB
/
thin_delta_scanner.fl
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
49
50
51
52
53
54
55
56
57
58
59
60
61
%{
#include <stdio.h>
#include "thin_delta_scanner.h"
//#define DP printf("%s", yytext);
#define DP
char *str_value;
%}
%option noyywrap
%option nounput
%option noinput
WS [ \t\r\n]
OP [<>=/]
STR \"[^\"\r\n]{0,20}\"
%%
{WS} /* skip silently */ DP;
{OP} DP; return yytext[0];
{STR} DP; {
if (yyleng > 2) {
yytext[yyleng-1] = 0;
str_value = yytext + 1;
} else {
str_value = NULL;
}
return TK_VALUE;
}
diff DP; return TK_DIFF;
left DP; return TK_LEFT;
uuid DP; return TK_UUID;
time DP; return TK_TIME;
same DP; return TK_SAME;
flags DP; return TK_FLAGS;
right DP; return TK_RIGHT;
begin DP; return TK_BEGIN;
device DP; return TK_DEVICE;
dev_id DP; return TK_DEV_ID;
length DP; return TK_LENGTH;
version DP; return TK_VERSION;
different DP; return TK_DIFFERENT;
left_only DP; return TK_LEFT_ONLY;
snap_time DP; return TK_SNAP_TIME;
data_block DP; return TK_DATA_BLOCK;
data_begin DP; return TK_DATA_BEGIN;
right_only DP; return TK_RIGHT_ONLY;
superblock DP; return TK_SUPERBLOCK;
transaction DP; return TK_TRANSACTION;
origin_block DP; return TK_ORIGIN_BLOCK;
origin_begin DP; return TK_ORIGIN_BEGIN;
mapped_blocks DP; return TK_MAPPED_BLOCKS;
creation_time DP; return TK_CREATION_TIME;
range_mapping DP; return TK_RANGE_MAPPING;
nr_data_blocks DP; return TK_NR_DATA_BLOCKS;
single_mapping DP; return TK_SINGLE_MAPPING;
data_block_size DP; return TK_DATA_BLOCK_SIZE;
. DP; return TK_UNEXPECTED_TOKEN;