Friday, April 12, 2019

lex program for string with odd number of 1’s

%{
#include<stdio.h>
%}
%%
0*10*(10*10*)* printf("Valid String");
.* printf("invalid string");
%%
main()
{
     printf("strings contains odd number of 1s::");
     yylex();
}

ScreenShot:

No comments:

Post a Comment