The question is self explanatory
Here is the code:
%{
int i=0;
%}
%%
[ ] {printf(" ");i++;}
%%
main()
{
extern FILE *yyin;
yyin=fopen("new","r");
yylex();
printf("\nTotal spaces = %d\n",i);
}
Here is the code:
%{
int i=0;
%}
%%
[ ] {printf(" ");i++;}
%%
main()
{
extern FILE *yyin;
yyin=fopen("new","r");
yylex();
printf("\nTotal spaces = %d\n",i);
}