Sunday, 16 June 2019

Write a LEX program to remove all the whitespaces.




Code:

%{
%}
%%
[ \t\n]
{fprintf(yyout,”%s",yytext);};
%%
main()
{
yyin=fopen("l21ip.txt","r");
yyout=fopen("l21op.txt","w");
yylex();
return 0;
}
int yywrap()
{
return 1;
}

No comments:

Post a Comment

It's time To increase blogging capability. To have a chance to contribute in digital world. Any Interested People who want to make t...