我试图计算do-while循环发生的总数
%{
int count=0,count2=0;
%}
letter [a-zA-Z]
num[0-9]
%%
do^while count++;
while count2++;
\n {; }
. {;}
%%
int main()
{
yyin = fopen("pract.c","r");
yylex();
printf("There were %d do-while loop and %d while loop\n",
count,count2);
return 0;
}
int yywrap(){
}
我无法正确计数。请帮助。