Lex program for changing capital case to lower and vice versa
%{
#include<stdio.h>
%}
%%
{lower} {printf("%c",yytext[0]-32);}
{capital} {printf("%c",yytext[0]+32);}
%%
int main()
{
yylex();
return(0);
}
#include<stdio.h>
%}
%%
{lower} {printf("%c",yytext[0]-32);}
{capital} {printf("%c",yytext[0]+32);}
%%
int main()
{
yylex();
return(0);
}
Comments
Post a Comment