-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab2.l
111 lines (109 loc) · 2.87 KB
/
lab2.l
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%{
#include<stdio.h>
%}
quote \\\"
space " "
%%
\/\/.* ECHO;
\/\*.*\*\/ ECHO;
\/\*(\n*.*\n*)*\*\/ ECHO;
\"[\t!#%&'()*+,-./0-9:; <=>?A-Z\[\]\^_a-z{|}]*\" ECHO;
\"[(\\n)(\\\n) \t!#%&'\(\)*+,\-./0-9:;<=>?A-Z\[\]\^_a-z{|}]*[\n \t!#%%&'\(\)*+,\-./0-9:;<=>?A-Z\[\]\^_a-z{|}]\" ECHO;
\"((\\\")|[(\\.)(\\\n) \t!#%&'\(\)*+,\-./0-9:;<=>?A-Z\[\]\^_a-z{|}])*[\n \t!#%%&'\(\)*+,\-./0-9:;<=>?A-Z\[\]\^_a-z{|}]\" ECHO;
#.* ECHO ;
[0-9a-zA-Z]auto ECHO;
auto[0-9a-zA-Z] ECHO;
auto printf("AUTO");
[0-9a-zA-Z]break ECHO;
break[0-9a-zA-Z] ECHO;
break printf("BREAK");
[0-9a-zA-Z]case ECHO;
case[0-9a-zA-Z] ECHO;
case printf("CASE");
[0-9a-zA-Z]char ECHO;
char[0-9a-zA-Z] ECHO;
char printf("CHAR");
[0-9a-zA-Z]const ECHO;
const[0-9a-zA-Z] ECHO;
const printf("CONST");
[0-9a-zA-Z]continue ECHO;
continue[0-9a-zA-Z] ECHO;
continue printf("CONTINUE");
[0-9a-zA-Z]default ECHO;
default[0-9a-zA-Z] ECHO;
default printf("DEFAULT");
[0-9a-zA-Z]do ECHO;
do[0-9a-zA-Z] ECHO;
do printf("DO");
[0-9a-zA-Z]double ECHO;
double[0-9a-zA-Z] ECHO;
double printf("DOUBLE");
[0-9a-zA-Z]else ECHO;
else[0-9a-zA-Z] ECHO;
else printf("ELSE");
[0-9a-zA-Z]enum ECHO;
enum[0-9a-zA-Z] ECHO;
enum printf("ENUM");
[0-9a-zA-Z]extern ECHO;
extern[0-9a-zA-Z] ECHO;
extern printf("EXTERN");
[0-9a-zA-Z]float ECHO;
float[0-9a-zA-Z] ECHO;
float printf("FLOAT");
[0-9a-zA-Z]for ECHO;
for[0-9a-zA-Z] ECHO;
for printf("FOR");
[0-9a-zA-Z]goto ECHO;
goto[0-9a-zA-Z] ECHO;
goto printf("GOTO");
[0-9a-zA-Z]if ECHO;
if[0-9a-zA-Z] ECHO;
if printf("IF");
[0-9a-zA-Z]int ECHO;
int[0-9a-zA-Z] ECHO;
int printf("INT");
[0-9a-zA-Z]long ECHO;
long[0-9a-zA-Z] ECHO;
long printf("LONG");
[0-9a-zA-Z]register ECHO;
register[0-9a-zA-Z] ECHO;
register printf("REGISTER");
[0-9a-zA-Z]return ECHO;
return[0-9a-zA-Z] ECHO;
return printf("RETURN");
[0-9a-zA-Z]short ECHO;
short[0-9a-zA-Z] ECHO;
short printf("SHORT");
[0-9a-zA-Z]signed ECHO;
signed[0-9a-zA-Z] ECHO;
signed printf("SIGNED");
[0-9a-zA-Z]sizeof ECHO;
sizeof[0-9a-zA-Z] ECHO;
sizeof printf("SIZEOF");
[0-9a-zA-Z]static ECHO;
static[0-9a-zA-Z] ECHO;
static printf("STATIC");
[0-9a-zA-Z]struct ECHO;
struct[0-9a-zA-Z] ECHO;
struct printf("STRUCT");
[0-9a-zA-Z]switch ECHO;
switch[0-9a-zA-Z] ECHO;
switch printf("SWITCH");
[0-9a-zA-Z]typedef ECHO;
typedef[0-9a-zA-Z] ECHO;
typedef printf("TYPEDEF");
[0-9a-zA-Z]union ECHO;
union[0-9a-zA-Z] ECHO;
union printf("UNION");
[0-9a-zA-Z]unsigned ECHO;
unsigned[0-9a-zA-Z] ECHO;
unsigned printf("UNSIGNED");
[0-9a-zA-Z]void ECHO;
void[0-9a-zA-Z] ECHO;
void printf("VOID");
[0-9a-zA-Z]volatile ECHO;
volatile[0-9a-zA-Z] ECHO;
volatile printf("VOLATILE");
[0-9a-zA-Z]while ECHO;
while[0-9a-zA-Z] ECHO;
while printf("WHILE");