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 /01/main.l | |
parent | 9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff) |
law & order
Diffstat (limited to '01/main.l')
-rw-r--r-- | 01/main.l | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/01/main.l b/01/main.l new file mode 100644 index 0000000..24f78ca --- /dev/null +++ b/01/main.l | |||
@@ -0,0 +1,20 @@ | |||
1 | %{ | ||
2 | int v = 0; | ||
3 | int c = 0; | ||
4 | %} | ||
5 | |||
6 | %% | ||
7 | [aeiouAEIOU] v++; | ||
8 | [a-zA-Z] c++; | ||
9 | . ; | ||
10 | %% | ||
11 | |||
12 | int main(void) { | ||
13 | yylex(); | ||
14 | printf("%d vowels\n", v); | ||
15 | printf("%d consonants\n", c); | ||
16 | } | ||
17 | |||
18 | int yywrap() { | ||
19 | return(1); | ||
20 | } | ||