aboutsummaryrefslogtreecommitdiff
path: root/8
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 /8
parent9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff)
law & order
Diffstat (limited to '8')
-rw-r--r--8/input1
-rw-r--r--8/main.l14
-rw-r--r--8/main.y28
3 files changed, 0 insertions, 43 deletions
diff --git a/8/input b/8/input
deleted file mode 100644
index 5c11124..0000000
--- a/8/input
+++ /dev/null
@@ -1 +0,0 @@
1aaaab
diff --git a/8/main.l b/8/main.l
deleted file mode 100644
index ad755d5..0000000
--- a/8/main.l
+++ /dev/null
@@ -1,14 +0,0 @@
1%{
2extern int yylval;
3%}
4
5%%
6a return A;
7b return B;
8. return yytext[0];
9\n return 0;
10%%
11
12int yywrap() {
13 return 1;
14}
diff --git a/8/main.y b/8/main.y
deleted file mode 100644
index 04e98a7..0000000
--- a/8/main.y
+++ /dev/null
@@ -1,28 +0,0 @@
1%{
2#include <stdio.h>
3#include <stdlib.h>
4int yyerror(char *);
5%}
6
7%token A B
8%start S
9
10%%
11
12S: C B
13 |
14 ;
15C: A C
16 | A A A A
17 ;
18%%
19
20int main() {
21 yyparse();
22 printf("valid string");
23}
24
25int yyerror(char *s) {
26 printf("error: %s", s);
27 exit(0);
28}