diff options
author | Akshay <[email protected]> | 2021-06-11 06:04:27 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-06-11 06:08:19 +0100 |
commit | f9f62e75f3b234b5daf3bc25e995f9f0f56ca0a2 (patch) | |
tree | aa3920ebfd44f98ceaec6ef501cd445c59bfaead /15/main.l | |
parent | e3c610a06bdad5c68ac59f5f4d42cc30b1e2b10f (diff) |
add prog 15
Diffstat (limited to '15/main.l')
-rw-r--r-- | 15/main.l | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/15/main.l b/15/main.l new file mode 100644 index 0000000..ffcb97e --- /dev/null +++ b/15/main.l | |||
@@ -0,0 +1,23 @@ | |||
1 | %{ | ||
2 | #include <stdlib.h> | ||
3 | extern int yylval; | ||
4 | %} | ||
5 | |||
6 | %% | ||
7 | |||
8 | [0-9]+? { | ||
9 | yylval=yytext[0]; | ||
10 | return NUM; | ||
11 | }; | ||
12 | [a-zA-Z]+? { | ||
13 | yylval=yytext[0]; | ||
14 | return IDENT; | ||
15 | } | ||
16 | . return yytext[0]; | ||
17 | \n return 0; | ||
18 | %% | ||
19 | |||
20 | int yywrap() { | ||
21 | return 1; | ||
22 | } | ||
23 | |||