aboutsummaryrefslogtreecommitdiff
path: root/10/main.l
diff options
context:
space:
mode:
Diffstat (limited to '10/main.l')
-rw-r--r--10/main.l22
1 files changed, 22 insertions, 0 deletions
diff --git a/10/main.l b/10/main.l
new file mode 100644
index 0000000..9962054
--- /dev/null
+++ b/10/main.l
@@ -0,0 +1,22 @@
1%{
2extern int yylval;
3%}
4
5d [0-9]+
6
7%%
8"+" return ADD;
9"-" return SUB;
10"*" return MUL;
11"/" return DIV;
12[0-9]+ {
13 yylval = atoi(yytext);
14 return NUM;
15};
16. return yytext[0];
17\n return 0;
18%%
19
20int yywrap() {
21 return 1;
22}