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 /9 | |
parent | 9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff) |
law & order
Diffstat (limited to '9')
-rw-r--r-- | 9/input | 1 | ||||
-rw-r--r-- | 9/main.l | 15 | ||||
-rw-r--r-- | 9/main.y | 30 |
3 files changed, 0 insertions, 46 deletions
diff --git a/9/input b/9/input deleted file mode 100644 index 01efb5e..0000000 --- a/9/input +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | aaabbbbc | ||
diff --git a/9/main.l b/9/main.l deleted file mode 100644 index 7e888e9..0000000 --- a/9/main.l +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | %{ | ||
2 | extern int yylval; | ||
3 | %} | ||
4 | |||
5 | %% | ||
6 | a return A; | ||
7 | b return B; | ||
8 | c return C; | ||
9 | . return yytext[0]; | ||
10 | \n return 0; | ||
11 | %% | ||
12 | |||
13 | int yywrap() { | ||
14 | return 1; | ||
15 | } | ||
diff --git a/9/main.y b/9/main.y deleted file mode 100644 index 0db29c1..0000000 --- a/9/main.y +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | %{ | ||
2 | #include <stdio.h> | ||
3 | #include <stdlib.h> | ||
4 | int yylex(); | ||
5 | int yyerror(char *); | ||
6 | %} | ||
7 | |||
8 | %token A B C | ||
9 | |||
10 | %% | ||
11 | S: X Y | ||
12 | | | ||
13 | ; | ||
14 | X: A X B | ||
15 | | | ||
16 | ; | ||
17 | Y: B Y C | ||
18 | | | ||
19 | ; | ||
20 | %% | ||
21 | |||
22 | int main() { | ||
23 | yyparse(); | ||
24 | printf("valid string"); | ||
25 | } | ||
26 | |||
27 | int yyerror(char *s) { | ||
28 | printf("error: %s", s); | ||
29 | exit(0); | ||
30 | } | ||