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 /5 | |
parent | 9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff) |
law & order
Diffstat (limited to '5')
-rw-r--r-- | 5/input | 5 | ||||
-rw-r--r-- | 5/main.l | 24 |
2 files changed, 0 insertions, 29 deletions
diff --git a/5/input b/5/input deleted file mode 100644 index 8be510e..0000000 --- a/5/input +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | int main() { | ||
2 | int one, two, three; | ||
3 | three = two + one; | ||
4 | printf(three); | ||
5 | } | ||
diff --git a/5/main.l b/5/main.l deleted file mode 100644 index ee13053..0000000 --- a/5/main.l +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | %{ | ||
2 | int k = 0; | ||
3 | int o = 0; | ||
4 | int i = 0; | ||
5 | %} | ||
6 | |||
7 | %% | ||
8 | int|main|printf|scanf|char|if|else|for|switch|case k++; | ||
9 | [+*/%&=] o++; | ||
10 | [a-zA-Z_][a-zA-Z0-9_]* i++; | ||
11 | . ; | ||
12 | \n ; | ||
13 | %% | ||
14 | |||
15 | int main(void) { | ||
16 | yylex(); | ||
17 | printf("%d keywords\n", k); | ||
18 | printf("%d operators\n", o); | ||
19 | printf("%d identifiers\n", i); | ||
20 | } | ||
21 | |||
22 | int yywrap() { | ||
23 | return 1; | ||
24 | } | ||