aboutsummaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-30 17:55:19 +0100
committerAkshay <[email protected]>2021-04-30 17:55:19 +0100
commitda1764a9f839e1d29b2bee12d35534f71f05c6ff (patch)
treed410c2191e571f9e6945ed88afd3faa1175675b3 /6
parent9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff)
law & order
Diffstat (limited to '6')
-rw-r--r--6/main.l15
-rw-r--r--6/main.y28
2 files changed, 0 insertions, 43 deletions
diff --git a/6/main.l b/6/main.l
deleted file mode 100644
index d2eded0..0000000
--- a/6/main.l
+++ /dev/null
@@ -1,15 +0,0 @@
1%{
2#include <stdlib.h>
3%}
4
5%%
6
7a return A;
8b return B;
9. return yytext[0];
10\n return 0;
11%%
12
13int yywrap() {
14 return 1;
15}
diff --git a/6/main.y b/6/main.y
deleted file mode 100644
index 25005df..0000000
--- a/6/main.y
+++ /dev/null
@@ -1,28 +0,0 @@
1%{
2#include <stdio.h>
3#include <stdlib.h>
4int yylex();
5int yyerror(char *);
6%}
7
8%token A B ERR
9
10%%
11
12S:
13 A S B
14 |
15 ;
16
17%%
18
19int yyerror(char *s) {
20 printf("error: %s", s);
21 exit(0);
22}
23
24int main() {
25 yyparse();
26 printf("valid string\n");
27 return 0;
28}