blob: 24f78ca24f74a5106be4a08e9fae49b4f0f4dd73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
%{
int v = 0;
int c = 0;
%}
%%
[aeiouAEIOU] v++;
[a-zA-Z] c++;
. ;
%%
int main(void) {
yylex();
printf("%d vowels\n", v);
printf("%d consonants\n", c);
}
int yywrap() {
return(1);
}
|