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