Friday, April 12, 2019

lex program for the language of all string containing either 10 or 001


%{
     #include<stdio.h>
%}
%%
(0|1)*(10|001)(0|1)* printf("Valid");
.* printf("invalid");
%%
main()
{
     printf("string contains either 10 or 001::");
     yylex();
}
ScreenShot:


No comments:

Post a Comment