aboutsummaryrefslogtreecommitdiff
path: root/14/main.l
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-06-11 05:19:05 +0100
committerAkshay <[email protected]>2021-06-11 05:19:05 +0100
commite3c610a06bdad5c68ac59f5f4d42cc30b1e2b10f (patch)
tree7ccd6a248f29ad8c9f77d13c2e617a9bc324e8aa /14/main.l
parentfc943f4f73c8d22c4a820ca94c0b16590ad61adf (diff)
add prog 14
Diffstat (limited to '14/main.l')
-rw-r--r--14/main.l23
1 files changed, 23 insertions, 0 deletions
diff --git a/14/main.l b/14/main.l
new file mode 100644
index 0000000..ffcb97e
--- /dev/null
+++ b/14/main.l
@@ -0,0 +1,23 @@
1%{
2#include <stdlib.h>
3extern 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
20int yywrap() {
21 return 1;
22}
23