diff options
author | Akshay <[email protected]> | 2021-04-30 17:55:19 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-30 17:55:19 +0100 |
commit | da1764a9f839e1d29b2bee12d35534f71f05c6ff (patch) | |
tree | d410c2191e571f9e6945ed88afd3faa1175675b3 /8 | |
parent | 9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff) |
law & order
Diffstat (limited to '8')
-rw-r--r-- | 8/input | 1 | ||||
-rw-r--r-- | 8/main.l | 14 | ||||
-rw-r--r-- | 8/main.y | 28 |
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 @@ | |||
1 | aaaab | ||
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 | %{ | ||
2 | extern int yylval; | ||
3 | %} | ||
4 | |||
5 | %% | ||
6 | a return A; | ||
7 | b return B; | ||
8 | . return yytext[0]; | ||
9 | \n return 0; | ||
10 | %% | ||
11 | |||
12 | int 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> | ||
4 | int yyerror(char *); | ||
5 | %} | ||
6 | |||
7 | %token A B | ||
8 | %start S | ||
9 | |||
10 | %% | ||
11 | |||
12 | S: C B | ||
13 | | | ||
14 | ; | ||
15 | C: A C | ||
16 | | A A A A | ||
17 | ; | ||
18 | %% | ||
19 | |||
20 | int main() { | ||
21 | yyparse(); | ||
22 | printf("valid string"); | ||
23 | } | ||
24 | |||
25 | int yyerror(char *s) { | ||
26 | printf("error: %s", s); | ||
27 | exit(0); | ||
28 | } | ||